builtin: remove USE_THE_REPOSITORY_VARIABLE from builtin.h

Instead of including USE_THE_REPOSITORY_VARIABLE by default on every
builtin, remove it from builtin.h and add it to all the builtins that
include builtin.h (by definition, that means all builtins/*.c).

Also, remove the include statement for repository.h since it gets
brought in through builtin.h.

The next step will be to migrate each builtin
from having to use the_repository.

Signed-off-by: John Cai <johncai86@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
maint
John Cai 2024-09-13 21:16:15 +00:00 committed by Junio C Hamano
parent 9b1cb5070f
commit 03eae9afb4
125 changed files with 147 additions and 92 deletions

View File

@ -1,14 +1,6 @@
#ifndef BUILTIN_H #ifndef BUILTIN_H
#define BUILTIN_H #define BUILTIN_H


/*
* TODO: Almost all of our builtins access `the_repository` by necessity
* because they do not get passed a pointer to it. We should adapt the function
* signature of those main functions to accept a `struct repository *` and then
* remove the macro here.
*/
#define USE_THE_REPOSITORY_VARIABLE

#include "git-compat-util.h" #include "git-compat-util.h"
#include "repository.h" #include "repository.h"



View File

@ -3,7 +3,7 @@
* *
* Copyright (C) 2006 Linus Torvalds * Copyright (C) 2006 Linus Torvalds
*/ */

#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "advice.h" #include "advice.h"
#include "config.h" #include "config.h"
@ -18,7 +18,6 @@
#include "preload-index.h" #include "preload-index.h"
#include "diff.h" #include "diff.h"
#include "read-cache.h" #include "read-cache.h"
#include "repository.h"
#include "revision.h" #include "revision.h"
#include "bulk-checkin.h" #include "bulk-checkin.h"
#include "strvec.h" #include "strvec.h"

View File

@ -4,6 +4,7 @@
* Based on git-am.sh by Junio C Hamano. * Based on git-am.sh by Junio C Hamano.
*/ */


#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "abspath.h" #include "abspath.h"
#include "advice.h" #include "advice.h"
@ -38,7 +39,6 @@
#include "string-list.h" #include "string-list.h"
#include "pager.h" #include "pager.h"
#include "path.h" #include "path.h"
#include "repository.h"
#include "pretty.h" #include "pretty.h"


/** /**

View File

@ -3,6 +3,8 @@
* *
* Copyright (C) 2006 Ryan Anderson * Copyright (C) 2006 Ryan Anderson
*/ */

#define USE_THE_REPOSITORY_VARIABLE
#include "git-compat-util.h" #include "git-compat-util.h"
#include "builtin.h" #include "builtin.h"
#include "strvec.h" #include "strvec.h"

View File

@ -1,6 +1,6 @@
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "gettext.h" #include "gettext.h"
#include "repository.h"
#include "hash.h" #include "hash.h"
#include "apply.h" #include "apply.h"



View File

@ -2,13 +2,13 @@
* Copyright (c) 2006 Franck Bui-Huu * Copyright (c) 2006 Franck Bui-Huu
* Copyright (c) 2006 Rene Scharfe * Copyright (c) 2006 Rene Scharfe
*/ */
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "archive.h" #include "archive.h"
#include "gettext.h" #include "gettext.h"
#include "transport.h" #include "transport.h"
#include "parse-options.h" #include "parse-options.h"
#include "pkt-line.h" #include "pkt-line.h"
#include "repository.h"


static void create_output_file(const char *output_file) static void create_output_file(const char *output_file)
{ {

View File

@ -1,3 +1,4 @@
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "copy.h" #include "copy.h"
#include "environment.h" #include "environment.h"

View File

@ -4,7 +4,7 @@
* Copyright (c) 2006, 2014 by its authors * Copyright (c) 2006, 2014 by its authors
* See COPYING for licensing conditions * See COPYING for licensing conditions
*/ */

#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "config.h" #include "config.h"
#include "color.h" #include "color.h"
@ -12,7 +12,6 @@
#include "environment.h" #include "environment.h"
#include "gettext.h" #include "gettext.h"
#include "hex.h" #include "hex.h"
#include "repository.h"
#include "commit.h" #include "commit.h"
#include "diff.h" #include "diff.h"
#include "revision.h" #include "revision.h"

View File

@ -4,7 +4,7 @@
* Copyright (c) 2006 Kristian Høgsberg <krh@redhat.com> * Copyright (c) 2006 Kristian Høgsberg <krh@redhat.com>
* Based on git-branch.sh by Junio C Hamano. * Based on git-branch.sh by Junio C Hamano.
*/ */

#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "config.h" #include "config.h"
#include "color.h" #include "color.h"

View File

@ -1,3 +1,4 @@
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "abspath.h" #include "abspath.h"
#include "editor.h" #include "editor.h"

View File

@ -1,3 +1,4 @@
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "abspath.h" #include "abspath.h"
#include "gettext.h" #include "gettext.h"
@ -5,7 +6,6 @@
#include "strvec.h" #include "strvec.h"
#include "parse-options.h" #include "parse-options.h"
#include "pkt-line.h" #include "pkt-line.h"
#include "repository.h"
#include "bundle.h" #include "bundle.h"


/* /*

View File

@ -3,7 +3,7 @@
* *
* Copyright (C) Linus Torvalds, 2005 * Copyright (C) Linus Torvalds, 2005
*/ */

#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "config.h" #include "config.h"
#include "convert.h" #include "convert.h"

View File

@ -1,3 +1,4 @@
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "config.h" #include "config.h"
#include "attr.h" #include "attr.h"
@ -5,7 +6,6 @@
#include "gettext.h" #include "gettext.h"
#include "object-name.h" #include "object-name.h"
#include "quote.h" #include "quote.h"
#include "repository.h"
#include "setup.h" #include "setup.h"
#include "parse-options.h" #include "parse-options.h"
#include "write-or-die.h" #include "write-or-die.h"

View File

@ -1,3 +1,4 @@
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "config.h" #include "config.h"
#include "dir.h" #include "dir.h"
@ -5,7 +6,6 @@
#include "quote.h" #include "quote.h"
#include "pathspec.h" #include "pathspec.h"
#include "parse-options.h" #include "parse-options.h"
#include "repository.h"
#include "submodule.h" #include "submodule.h"
#include "write-or-die.h" #include "write-or-die.h"



View File

@ -1,3 +1,4 @@
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "config.h" #include "config.h"
#include "gettext.h" #include "gettext.h"

View File

@ -1,7 +1,7 @@
/* /*
* GIT - The information manager from hell * GIT - The information manager from hell
*/ */

#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "refs.h" #include "refs.h"
#include "setup.h" #include "setup.h"

View File

@ -1,3 +1,4 @@
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "config.h" #include "config.h"
#include "entry.h" #include "entry.h"

View File

@ -4,13 +4,12 @@
* Copyright (C) 2005 Linus Torvalds * Copyright (C) 2005 Linus Torvalds
* *
*/ */

#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "config.h" #include "config.h"
#include "gettext.h" #include "gettext.h"
#include "lockfile.h" #include "lockfile.h"
#include "quote.h" #include "quote.h"
#include "repository.h"
#include "cache-tree.h" #include "cache-tree.h"
#include "parse-options.h" #include "parse-options.h"
#include "entry.h" #include "entry.h"

View File

@ -1,3 +1,4 @@
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "advice.h" #include "advice.h"
#include "branch.h" #include "branch.h"

View File

@ -5,7 +5,7 @@
* *
* Based on git-clean.sh by Pavel Roskin * Based on git-clean.sh by Pavel Roskin
*/ */

#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "abspath.h" #include "abspath.h"
#include "config.h" #include "config.h"
@ -14,7 +14,6 @@
#include "parse-options.h" #include "parse-options.h"
#include "path.h" #include "path.h"
#include "read-cache-ll.h" #include "read-cache-ll.h"
#include "repository.h"
#include "setup.h" #include "setup.h"
#include "string-list.h" #include "string-list.h"
#include "quote.h" #include "quote.h"

View File

@ -7,8 +7,9 @@
* *
* Clone a repository into a different directory that does not yet exist. * Clone a repository into a different directory that does not yet exist.
*/ */

#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"

#include "abspath.h" #include "abspath.h"
#include "advice.h" #include "advice.h"
#include "config.h" #include "config.h"

View File

@ -1,3 +1,4 @@
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "config.h" #include "config.h"
#include "gettext.h" #include "gettext.h"

View File

@ -1,3 +1,4 @@
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "commit.h" #include "commit.h"
#include "config.h" #include "config.h"
@ -5,7 +6,6 @@
#include "gettext.h" #include "gettext.h"
#include "hex.h" #include "hex.h"
#include "parse-options.h" #include "parse-options.h"
#include "repository.h"
#include "commit-graph.h" #include "commit-graph.h"
#include "object-store-ll.h" #include "object-store-ll.h"
#include "progress.h" #include "progress.h"

View File

@ -3,13 +3,14 @@
* *
* Copyright (C) Linus Torvalds, 2005 * Copyright (C) Linus Torvalds, 2005
*/ */
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "config.h" #include "config.h"
#include "gettext.h" #include "gettext.h"
#include "hex.h" #include "hex.h"
#include "object-name.h" #include "object-name.h"
#include "object-store-ll.h" #include "object-store-ll.h"
#include "repository.h"
#include "commit.h" #include "commit.h"
#include "parse-options.h" #include "parse-options.h"



View File

@ -4,7 +4,7 @@
* Copyright (c) 2007 Kristian Høgsberg <krh@redhat.com> * Copyright (c) 2007 Kristian Høgsberg <krh@redhat.com>
* Based on git-commit.sh by Junio C Hamano and Linus Torvalds * Based on git-commit.sh by Junio C Hamano and Linus Torvalds
*/ */

#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "advice.h" #include "advice.h"
#include "config.h" #include "config.h"

View File

@ -1,10 +1,10 @@
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "abspath.h" #include "abspath.h"
#include "config.h" #include "config.h"
#include "color.h" #include "color.h"
#include "editor.h" #include "editor.h"
#include "environment.h" #include "environment.h"
#include "repository.h"
#include "gettext.h" #include "gettext.h"
#include "ident.h" #include "ident.h"
#include "parse-options.h" #include "parse-options.h"

View File

@ -3,14 +3,13 @@
* *
* Copyright (c) 2006 Junio C Hamano * Copyright (c) 2006 Junio C Hamano
*/ */

#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "config.h" #include "config.h"
#include "dir.h" #include "dir.h"
#include "environment.h" #include "environment.h"
#include "gettext.h" #include "gettext.h"
#include "path.h" #include "path.h"
#include "repository.h"
#include "parse-options.h" #include "parse-options.h"
#include "quote.h" #include "quote.h"
#include "packfile.h" #include "packfile.h"

View File

@ -1,3 +1,4 @@
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "abspath.h" #include "abspath.h"
#include "gettext.h" #include "gettext.h"

View File

@ -1,3 +1,4 @@
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "credential.h" #include "credential.h"
#include "gettext.h" #include "gettext.h"

View File

@ -1,3 +1,4 @@
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "config.h" #include "config.h"
#include "gettext.h" #include "gettext.h"

View File

@ -1,3 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE

#include "git-compat-util.h" #include "git-compat-util.h"
#include "credential.h" #include "credential.h"
#include "builtin.h" #include "builtin.h"

View File

@ -1,3 +1,4 @@
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "config.h" #include "config.h"
#include "environment.h" #include "environment.h"

View File

@ -1,3 +1,4 @@
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "abspath.h" #include "abspath.h"
#include "gettext.h" #include "gettext.h"

View File

@ -3,13 +3,13 @@
* *
* Copyright (C) Linus Torvalds, 2005 * Copyright (C) Linus Torvalds, 2005
*/ */
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "config.h" #include "config.h"
#include "diff.h" #include "diff.h"
#include "diff-merges.h" #include "diff-merges.h"
#include "commit.h" #include "commit.h"
#include "preload-index.h" #include "preload-index.h"
#include "repository.h"
#include "revision.h" #include "revision.h"


static const char diff_files_usage[] = static const char diff_files_usage[] =

View File

@ -1,10 +1,10 @@
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "config.h" #include "config.h"
#include "diff.h" #include "diff.h"
#include "diff-merges.h" #include "diff-merges.h"
#include "commit.h" #include "commit.h"
#include "preload-index.h" #include "preload-index.h"
#include "repository.h"
#include "revision.h" #include "revision.h"
#include "setup.h" #include "setup.h"



View File

@ -1,3 +1,4 @@
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "config.h" #include "config.h"
#include "diff.h" #include "diff.h"
@ -6,7 +7,6 @@
#include "hex.h" #include "hex.h"
#include "log-tree.h" #include "log-tree.h"
#include "read-cache-ll.h" #include "read-cache-ll.h"
#include "repository.h"
#include "revision.h" #include "revision.h"
#include "tmp-objdir.h" #include "tmp-objdir.h"
#include "tree.h" #include "tree.h"

View File

@ -3,7 +3,7 @@
* *
* Copyright (c) 2006 Junio C Hamano * Copyright (c) 2006 Junio C Hamano
*/ */

#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "config.h" #include "config.h"
#include "ewah/ewok.h" #include "ewah/ewok.h"

View File

@ -11,8 +11,9 @@
* *
* Copyright (C) 2016 Johannes Schindelin * Copyright (C) 2016 Johannes Schindelin
*/ */

#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"

#include "abspath.h" #include "abspath.h"
#include "config.h" #include "config.h"
#include "copy.h" #include "copy.h"

View File

@ -3,6 +3,7 @@
* *
* Copyright (C) 2007 Johannes E. Schindelin * Copyright (C) 2007 Johannes E. Schindelin
*/ */
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "config.h" #include "config.h"
#include "gettext.h" #include "gettext.h"

View File

@ -1,9 +1,9 @@
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "abspath.h" #include "abspath.h"
#include "environment.h" #include "environment.h"
#include "gettext.h" #include "gettext.h"
#include "hex.h" #include "hex.h"
#include "repository.h"
#include "config.h" #include "config.h"
#include "lockfile.h" #include "lockfile.h"
#include "object.h" #include "object.h"

View File

@ -1,3 +1,4 @@
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "gettext.h" #include "gettext.h"
#include "hex.h" #include "hex.h"

View File

@ -1,13 +1,13 @@
/* /*
* "git fetch" * "git fetch"
*/ */
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "advice.h" #include "advice.h"
#include "config.h" #include "config.h"
#include "gettext.h" #include "gettext.h"
#include "environment.h" #include "environment.h"
#include "hex.h" #include "hex.h"
#include "repository.h"
#include "refs.h" #include "refs.h"
#include "refspec.h" #include "refspec.h"
#include "object-name.h" #include "object-name.h"

View File

@ -1,3 +1,4 @@
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "config.h" #include "config.h"
#include "fmt-merge-msg.h" #include "fmt-merge-msg.h"

View File

@ -1,3 +1,4 @@
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "commit.h" #include "commit.h"
#include "config.h" #include "config.h"

View File

@ -1,9 +1,9 @@
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "config.h" #include "config.h"
#include "gettext.h" #include "gettext.h"
#include "parse-options.h" #include "parse-options.h"
#include "path.h" #include "path.h"
#include "repository.h"
#include "run-command.h" #include "run-command.h"
#include "string-list.h" #include "string-list.h"



View File

@ -1,7 +1,7 @@
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "gettext.h" #include "gettext.h"
#include "hex.h" #include "hex.h"
#include "repository.h"
#include "config.h" #include "config.h"
#include "commit.h" #include "commit.h"
#include "tree.h" #include "tree.h"

View File

@ -1,3 +1,4 @@
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "abspath.h" #include "abspath.h"
#include "config.h" #include "config.h"
@ -11,7 +12,7 @@
#include "compat/fsmonitor/fsm-health.h" #include "compat/fsmonitor/fsm-health.h"
#include "compat/fsmonitor/fsm-listen.h" #include "compat/fsmonitor/fsm-listen.h"
#include "fsmonitor--daemon.h" #include "fsmonitor--daemon.h"
#include "repository.h"
#include "simple-ipc.h" #include "simple-ipc.h"
#include "khash.h" #include "khash.h"
#include "run-command.h" #include "run-command.h"

View File

@ -9,13 +9,12 @@
* *
* Copyright (c) 2006 Shawn O. Pearce * Copyright (c) 2006 Shawn O. Pearce
*/ */

#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "abspath.h" #include "abspath.h"
#include "date.h" #include "date.h"
#include "environment.h" #include "environment.h"
#include "hex.h" #include "hex.h"
#include "repository.h"
#include "config.h" #include "config.h"
#include "tempfile.h" #include "tempfile.h"
#include "lockfile.h" #include "lockfile.h"

View File

@ -1,6 +1,7 @@
/* /*
* Copyright (c) 2005, 2006 Rene Scharfe * Copyright (c) 2005, 2006 Rene Scharfe
*/ */
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "commit.h" #include "commit.h"
#include "tar.h" #include "tar.h"

View File

@ -3,11 +3,11 @@
* *
* Copyright (c) 2006 Junio C Hamano * Copyright (c) 2006 Junio C Hamano
*/ */
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "abspath.h" #include "abspath.h"
#include "gettext.h" #include "gettext.h"
#include "hex.h" #include "hex.h"
#include "repository.h"
#include "config.h" #include "config.h"
#include "tag.h" #include "tag.h"
#include "tree-walk.h" #include "tree-walk.h"

View File

@ -4,6 +4,7 @@
* Copyright (C) Linus Torvalds, 2005 * Copyright (C) Linus Torvalds, 2005
* Copyright (C) Junio C Hamano, 2005 * Copyright (C) Junio C Hamano, 2005
*/ */
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "abspath.h" #include "abspath.h"
#include "config.h" #include "config.h"

View File

@ -1,6 +1,8 @@

/* /*
* Builtin help command * Builtin help command
*/ */
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "config.h" #include "config.h"
#include "exec-cmd.h" #include "exec-cmd.h"

View File

@ -1,3 +1,4 @@
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "config.h" #include "config.h"
#include "gettext.h" #include "gettext.h"

View File

@ -1,3 +1,4 @@
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "config.h" #include "config.h"
#include "delta.h" #include "delta.h"

View File

@ -3,6 +3,7 @@
* *
* Copyright (C) Linus Torvalds, 2005 * Copyright (C) Linus Torvalds, 2005
*/ */
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "abspath.h" #include "abspath.h"
#include "environment.h" #include "environment.h"
@ -11,7 +12,6 @@
#include "parse-options.h" #include "parse-options.h"
#include "path.h" #include "path.h"
#include "refs.h" #include "refs.h"
#include "repository.h"
#include "setup.h" #include "setup.h"
#include "strbuf.h" #include "strbuf.h"



View File

@ -4,7 +4,7 @@
* Copyright (c) 2013, 2014 Christian Couder <chriscool@tuxfamily.org> * Copyright (c) 2013, 2014 Christian Couder <chriscool@tuxfamily.org>
* *
*/ */

#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "gettext.h" #include "gettext.h"
#include "parse-options.h" #include "parse-options.h"

View File

@ -4,6 +4,7 @@
* (C) Copyright 2006 Linus Torvalds * (C) Copyright 2006 Linus Torvalds
* 2006 Junio Hamano * 2006 Junio Hamano
*/ */
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "abspath.h" #include "abspath.h"
#include "config.h" #include "config.h"
@ -37,7 +38,7 @@
#include "mailmap.h" #include "mailmap.h"
#include "progress.h" #include "progress.h"
#include "commit-slab.h" #include "commit-slab.h"
#include "repository.h"
#include "commit-reach.h" #include "commit-reach.h"
#include "range-diff.h" #include "range-diff.h"
#include "tmp-objdir.h" #include "tmp-objdir.h"

View File

@ -5,8 +5,8 @@
* *
* Copyright (C) Linus Torvalds, 2005 * Copyright (C) Linus Torvalds, 2005
*/ */
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "repository.h"
#include "config.h" #include "config.h"
#include "convert.h" #include "convert.h"
#include "quote.h" #include "quote.h"

View File

@ -1,3 +1,4 @@
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "gettext.h" #include "gettext.h"
#include "hex.h" #include "hex.h"

View File

@ -3,7 +3,9 @@
* *
* Copyright (C) Linus Torvalds, 2005 * Copyright (C) Linus Torvalds, 2005
*/ */
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"

#include "config.h" #include "config.h"
#include "gettext.h" #include "gettext.h"
#include "hex.h" #include "hex.h"

View File

@ -2,6 +2,7 @@
* Another stupid program, this one parsing the headers of an * Another stupid program, this one parsing the headers of an
* email to figure out authorship and subject * email to figure out authorship and subject
*/ */
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "abspath.h" #include "abspath.h"
#include "environment.h" #include "environment.h"

View File

@ -4,6 +4,7 @@
* It just splits a mbox into a list of files: "0001" "0002" .. * It just splits a mbox into a list of files: "0001" "0002" ..
* so you can process them further from there. * so you can process them further from there.
*/ */
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "gettext.h" #include "gettext.h"
#include "string-list.h" #include "string-list.h"

View File

@ -1,3 +1,4 @@
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "config.h" #include "config.h"
#include "commit.h" #include "commit.h"
@ -5,7 +6,6 @@
#include "hex.h" #include "hex.h"
#include "object-name.h" #include "object-name.h"
#include "parse-options.h" #include "parse-options.h"
#include "repository.h"
#include "commit-reach.h" #include "commit-reach.h"


static int show_merge_base(struct commit **rev, int rev_nr, int show_all) static int show_merge_base(struct commit **rev, int rev_nr, int show_all)

View File

@ -1,3 +1,4 @@
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "abspath.h" #include "abspath.h"
#include "diff.h" #include "diff.h"

View File

@ -1,7 +1,7 @@
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "hex.h" #include "hex.h"
#include "read-cache-ll.h" #include "read-cache-ll.h"
#include "repository.h"
#include "run-command.h" #include "run-command.h"
#include "sparse-index.h" #include "sparse-index.h"



View File

@ -7,10 +7,11 @@
* *
* Pretend we resolved the heads, but declare our tree trumps everybody else. * Pretend we resolved the heads, but declare our tree trumps everybody else.
*/ */
#define USE_THE_REPOSITORY_VARIABLE
#include "git-compat-util.h" #include "git-compat-util.h"
#include "builtin.h" #include "builtin.h"
#include "diff.h" #include "diff.h"
#include "repository.h"


static const char builtin_merge_ours_usage[] = static const char builtin_merge_ours_usage[] =
"git merge-ours <base>... -- HEAD <remote>..."; "git merge-ours <base>... -- HEAD <remote>...";

View File

@ -1,10 +1,10 @@
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "advice.h" #include "advice.h"
#include "gettext.h" #include "gettext.h"
#include "hash.h" #include "hash.h"
#include "merge-recursive.h" #include "merge-recursive.h"
#include "object-name.h" #include "object-name.h"
#include "repository.h"


static const char builtin_merge_recursive_usage[] = static const char builtin_merge_recursive_usage[] =
"git %s <base>... -- <head> <remote> ..."; "git %s <base>... -- <head> <remote> ...";

View File

@ -1,3 +1,4 @@
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "tree-walk.h" #include "tree-walk.h"
#include "xdiff-interface.h" #include "xdiff-interface.h"
@ -10,7 +11,6 @@
#include "object-name.h" #include "object-name.h"
#include "object-store-ll.h" #include "object-store-ll.h"
#include "parse-options.h" #include "parse-options.h"
#include "repository.h"
#include "blob.h" #include "blob.h"
#include "merge-blobs.h" #include "merge-blobs.h"
#include "quote.h" #include "quote.h"

View File

@ -5,8 +5,9 @@
* *
* Based on git-merge.sh by Junio C Hamano. * Based on git-merge.sh by Junio C Hamano.
*/ */

#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"

#include "abspath.h" #include "abspath.h"
#include "advice.h" #include "advice.h"
#include "config.h" #include "config.h"

View File

@ -1,3 +1,4 @@
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "gettext.h" #include "gettext.h"
#include "hex.h" #include "hex.h"

View File

@ -3,6 +3,7 @@
* *
* Copyright (c) Junio C Hamano, 2006, 2009 * Copyright (c) Junio C Hamano, 2006, 2009
*/ */
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "gettext.h" #include "gettext.h"
#include "hex.h" #include "hex.h"

View File

@ -1,3 +1,4 @@
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "abspath.h" #include "abspath.h"
#include "config.h" #include "config.h"

View File

@ -3,6 +3,7 @@
* *
* Copyright (C) 2006 Johannes Schindelin * Copyright (C) 2006 Johannes Schindelin
*/ */
#define USE_THE_REPOSITORY_VARIABLE


#include "builtin.h" #include "builtin.h"
#include "abspath.h" #include "abspath.h"
@ -18,7 +19,7 @@
#include "string-list.h" #include "string-list.h"
#include "parse-options.h" #include "parse-options.h"
#include "read-cache-ll.h" #include "read-cache-ll.h"
#include "repository.h"
#include "setup.h" #include "setup.h"
#include "strvec.h" #include "strvec.h"
#include "submodule.h" #include "submodule.h"

View File

@ -1,8 +1,8 @@
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "environment.h" #include "environment.h"
#include "gettext.h" #include "gettext.h"
#include "hex.h" #include "hex.h"
#include "repository.h"
#include "config.h" #include "config.h"
#include "commit.h" #include "commit.h"
#include "tag.h" #include "tag.h"

View File

@ -6,7 +6,7 @@
* Based on git-notes.sh by Johannes Schindelin, * Based on git-notes.sh by Johannes Schindelin,
* and builtin/tag.c by Kristian Høgsberg and Carlos Rica. * and builtin/tag.c by Kristian Høgsberg and Carlos Rica.
*/ */

#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "config.h" #include "config.h"
#include "editor.h" #include "editor.h"
@ -17,7 +17,7 @@
#include "object-name.h" #include "object-name.h"
#include "object-store-ll.h" #include "object-store-ll.h"
#include "path.h" #include "path.h"
#include "repository.h"
#include "pretty.h" #include "pretty.h"
#include "refs.h" #include "refs.h"
#include "exec-cmd.h" #include "exec-cmd.h"

View File

@ -1,8 +1,8 @@
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "environment.h" #include "environment.h"
#include "gettext.h" #include "gettext.h"
#include "hex.h" #include "hex.h"
#include "repository.h"
#include "config.h" #include "config.h"
#include "attr.h" #include "attr.h"
#include "object.h" #include "object.h"

View File

@ -5,11 +5,12 @@
* This file is licensed under the GPL v2. * This file is licensed under the GPL v2.
* *
*/ */
#define USE_THE_REPOSITORY_VARIABLE


#include "builtin.h" #include "builtin.h"
#include "gettext.h" #include "gettext.h"
#include "hex.h" #include "hex.h"
#include "repository.h"
#include "packfile.h" #include "packfile.h"
#include "object-store-ll.h" #include "object-store-ll.h"



View File

@ -1,9 +1,9 @@
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "config.h" #include "config.h"
#include "gettext.h" #include "gettext.h"
#include "parse-options.h" #include "parse-options.h"
#include "refs.h" #include "refs.h"
#include "repository.h"
#include "revision.h" #include "revision.h"


static char const * const pack_refs_usage[] = { static char const * const pack_refs_usage[] = {

View File

@ -1,3 +1,4 @@
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "config.h" #include "config.h"
#include "diff.h" #include "diff.h"

View File

@ -1,3 +1,4 @@
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "gettext.h" #include "gettext.h"
#include "parse-options.h" #include "parse-options.h"

View File

@ -1,3 +1,4 @@
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "commit.h" #include "commit.h"
#include "diff.h" #include "diff.h"

View File

@ -6,6 +6,7 @@
* Fetch one or more remote refs and merge it/them into the current HEAD. * Fetch one or more remote refs and merge it/them into the current HEAD.
*/ */


#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "advice.h" #include "advice.h"
#include "config.h" #include "config.h"

View File

@ -1,6 +1,7 @@
/* /*
* "git push" * "git push"
*/ */
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "advice.h" #include "advice.h"
#include "branch.h" #include "branch.h"
@ -13,7 +14,6 @@
#include "transport.h" #include "transport.h"
#include "parse-options.h" #include "parse-options.h"
#include "pkt-line.h" #include "pkt-line.h"
#include "repository.h"
#include "submodule.h" #include "submodule.h"
#include "submodule-config.h" #include "submodule-config.h"
#include "send-pack.h" #include "send-pack.h"

View File

@ -1,10 +1,11 @@
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "gettext.h" #include "gettext.h"
#include "object-name.h" #include "object-name.h"
#include "parse-options.h" #include "parse-options.h"
#include "range-diff.h" #include "range-diff.h"
#include "config.h" #include "config.h"
#include "repository.h"


static const char * const builtin_range_diff_usage[] = { static const char * const builtin_range_diff_usage[] = {
N_("git range-diff [<options>] <old-base>..<old-tip> <new-base>..<new-tip>"), N_("git range-diff [<options>] <old-base>..<old-tip> <new-base>..<new-tip>"),

View File

@ -3,7 +3,7 @@
* *
* Copyright (C) Linus Torvalds, 2005 * Copyright (C) Linus Torvalds, 2005
*/ */

#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "config.h" #include "config.h"
#include "gettext.h" #include "gettext.h"
@ -16,7 +16,6 @@
#include "cache-tree.h" #include "cache-tree.h"
#include "unpack-trees.h" #include "unpack-trees.h"
#include "parse-options.h" #include "parse-options.h"
#include "repository.h"
#include "resolve-undo.h" #include "resolve-undo.h"
#include "setup.h" #include "setup.h"
#include "sparse-index.h" #include "sparse-index.h"

View File

@ -3,8 +3,9 @@
* *
* Copyright (c) 2018 Pratik Karki * Copyright (c) 2018 Pratik Karki
*/ */

#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"

#include "abspath.h" #include "abspath.h"
#include "environment.h" #include "environment.h"
#include "gettext.h" #include "gettext.h"

View File

@ -1,6 +1,7 @@
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "abspath.h" #include "abspath.h"
#include "repository.h"
#include "config.h" #include "config.h"
#include "environment.h" #include "environment.h"
#include "gettext.h" #include "gettext.h"

View File

@ -1,7 +1,7 @@
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "config.h" #include "config.h"
#include "gettext.h" #include "gettext.h"
#include "repository.h"
#include "revision.h" #include "revision.h"
#include "reachable.h" #include "reachable.h"
#include "wildmatch.h" #include "wildmatch.h"

View File

@ -1,9 +1,9 @@
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "config.h" #include "config.h"
#include "fsck.h" #include "fsck.h"
#include "parse-options.h" #include "parse-options.h"
#include "refs.h" #include "refs.h"
#include "repository.h"
#include "strbuf.h" #include "strbuf.h"


#define REFS_MIGRATE_USAGE \ #define REFS_MIGRATE_USAGE \

View File

@ -1,3 +1,4 @@
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "transport.h" #include "transport.h"
#include "run-command.h" #include "run-command.h"

View File

@ -1,3 +1,4 @@
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "transport.h" #include "transport.h"



View File

@ -1,3 +1,4 @@
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "config.h" #include "config.h"
#include "gettext.h" #include "gettext.h"

View File

@ -1,3 +1,4 @@
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "config.h" #include "config.h"
#include "dir.h" #include "dir.h"

View File

@ -7,7 +7,7 @@
* and Carlos Rica <jasampler@gmail.com> that was itself based on * and Carlos Rica <jasampler@gmail.com> that was itself based on
* git-tag.sh and mktag.c by Linus Torvalds. * git-tag.sh and mktag.c by Linus Torvalds.
*/ */

#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "config.h" #include "config.h"
#include "editor.h" #include "editor.h"
@ -22,7 +22,6 @@
#include "object-name.h" #include "object-name.h"
#include "object-store-ll.h" #include "object-store-ll.h"
#include "replace-object.h" #include "replace-object.h"
#include "repository.h"
#include "tag.h" #include "tag.h"
#include "wildmatch.h" #include "wildmatch.h"



View File

@ -4,6 +4,7 @@


#include "git-compat-util.h" #include "git-compat-util.h"


#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "environment.h" #include "environment.h"
#include "hex.h" #include "hex.h"

View File

@ -1,8 +1,9 @@
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "config.h" #include "config.h"
#include "gettext.h" #include "gettext.h"
#include "parse-options.h" #include "parse-options.h"
#include "repository.h"
#include "string-list.h" #include "string-list.h"
#include "rerere.h" #include "rerere.h"
#include "xdiff/xdiff.h" #include "xdiff/xdiff.h"

View File

@ -7,7 +7,7 @@
* *
* Copyright (c) 2005, 2006 Linus Torvalds and Junio C Hamano * Copyright (c) 2005, 2006 Linus Torvalds and Junio C Hamano
*/ */

#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "advice.h" #include "advice.h"
#include "config.h" #include "config.h"

View File

@ -1,3 +1,4 @@
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"
#include "config.h" #include "config.h"
#include "commit.h" #include "commit.h"

View File

@ -3,8 +3,9 @@
* *
* Copyright (C) Linus Torvalds, 2005 * Copyright (C) Linus Torvalds, 2005
*/ */

#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h" #include "builtin.h"

#include "abspath.h" #include "abspath.h"
#include "config.h" #include "config.h"
#include "commit.h" #include "commit.h"

View File

@ -1,9 +1,9 @@
#define USE_THE_REPOSITORY_VARIABLE
#include "git-compat-util.h" #include "git-compat-util.h"
#include "builtin.h" #include "builtin.h"
#include "parse-options.h" #include "parse-options.h"
#include "diff.h" #include "diff.h"
#include "gettext.h" #include "gettext.h"
#include "repository.h"
#include "revision.h" #include "revision.h"
#include "rerere.h" #include "rerere.h"
#include "sequencer.h" #include "sequencer.h"

Some files were not shown because too many files have changed in this diff Show More