From 9b1cb5070ffb581798763eaee85cec10da969e90 Mon Sep 17 00:00:00 2001 From: John Cai Date: Fri, 13 Sep 2024 21:16:14 +0000 Subject: builtin: add a repository parameter for builtin functions In order to reduce the usage of the global the_repository, add a parameter to builtin functions that will get passed a repository variable. This commit uses UNUSED on most of the builtin functions, as subsequent commits will modify the actual builtins to pass the repository parameter down. Signed-off-by: John Cai Signed-off-by: Junio C Hamano --- builtin/reset.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'builtin/reset.c') diff --git a/builtin/reset.c b/builtin/reset.c index 5f941fb3a2..7552907260 100644 --- a/builtin/reset.c +++ b/builtin/reset.c @@ -330,7 +330,10 @@ static int git_reset_config(const char *var, const char *value, return git_default_config(var, value, ctx, cb); } -int cmd_reset(int argc, const char **argv, const char *prefix) +int cmd_reset(int argc, + const char **argv, + const char *prefix, + struct repository *repo UNUSED) { int reset_type = NONE, update_ref_status = 0, quiet = 0; int no_refresh = 0; -- cgit v1.2.3 From 03eae9afb447ad4add2f18a1adb3589f050d596f Mon Sep 17 00:00:00 2001 From: John Cai Date: Fri, 13 Sep 2024 21:16:15 +0000 Subject: 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 Signed-off-by: Junio C Hamano --- builtin.h | 8 -------- builtin/add.c | 3 +-- builtin/am.c | 2 +- builtin/annotate.c | 2 ++ builtin/apply.c | 2 +- builtin/archive.c | 2 +- builtin/bisect.c | 1 + builtin/blame.c | 3 +-- builtin/branch.c | 2 +- builtin/bugreport.c | 1 + builtin/bundle.c | 2 +- builtin/cat-file.c | 2 +- builtin/check-attr.c | 2 +- builtin/check-ignore.c | 2 +- builtin/check-mailmap.c | 1 + builtin/check-ref-format.c | 2 +- builtin/checkout--worker.c | 1 + builtin/checkout-index.c | 3 +-- builtin/checkout.c | 1 + builtin/clean.c | 3 +-- builtin/clone.c | 3 ++- builtin/column.c | 1 + builtin/commit-graph.c | 2 +- builtin/commit-tree.c | 3 ++- builtin/commit.c | 2 +- builtin/config.c | 2 +- builtin/count-objects.c | 3 +-- builtin/credential-cache--daemon.c | 1 + builtin/credential-cache.c | 1 + builtin/credential-store.c | 1 + builtin/credential.c | 2 ++ builtin/describe.c | 1 + builtin/diagnose.c | 1 + builtin/diff-files.c | 2 +- builtin/diff-index.c | 2 +- builtin/diff-tree.c | 2 +- builtin/diff.c | 2 +- builtin/difftool.c | 3 ++- builtin/fast-export.c | 1 + builtin/fast-import.c | 2 +- builtin/fetch-pack.c | 1 + builtin/fetch.c | 2 +- builtin/fmt-merge-msg.c | 1 + builtin/for-each-ref.c | 1 + builtin/for-each-repo.c | 2 +- builtin/fsck.c | 2 +- builtin/fsmonitor--daemon.c | 3 ++- builtin/gc.c | 3 +-- builtin/get-tar-commit-id.c | 1 + builtin/grep.c | 2 +- builtin/hash-object.c | 1 + builtin/help.c | 2 ++ builtin/hook.c | 1 + builtin/index-pack.c | 1 + builtin/init-db.c | 2 +- builtin/interpret-trailers.c | 2 +- builtin/log.c | 3 ++- builtin/ls-files.c | 2 +- builtin/ls-remote.c | 1 + builtin/ls-tree.c | 2 ++ builtin/mailinfo.c | 1 + builtin/mailsplit.c | 1 + builtin/merge-base.c | 2 +- builtin/merge-file.c | 1 + builtin/merge-index.c | 2 +- builtin/merge-ours.c | 3 ++- builtin/merge-recursive.c | 2 +- builtin/merge-tree.c | 2 +- builtin/merge.c | 3 ++- builtin/mktag.c | 1 + builtin/mktree.c | 1 + builtin/multi-pack-index.c | 1 + builtin/mv.c | 3 ++- builtin/name-rev.c | 2 +- builtin/notes.c | 4 ++-- builtin/pack-objects.c | 2 +- builtin/pack-redundant.c | 3 ++- builtin/pack-refs.c | 2 +- builtin/patch-id.c | 1 + builtin/prune-packed.c | 1 + builtin/prune.c | 1 + builtin/pull.c | 1 + builtin/push.c | 2 +- builtin/range-diff.c | 3 ++- builtin/read-tree.c | 3 +-- builtin/rebase.c | 3 ++- builtin/receive-pack.c | 3 ++- builtin/reflog.c | 2 +- builtin/refs.c | 2 +- builtin/remote-ext.c | 1 + builtin/remote-fd.c | 1 + builtin/remote.c | 1 + builtin/repack.c | 1 + builtin/replace.c | 3 +-- builtin/replay.c | 1 + builtin/rerere.c | 3 ++- builtin/reset.c | 2 +- builtin/rev-list.c | 1 + builtin/rev-parse.c | 3 ++- builtin/revert.c | 2 +- builtin/rm.c | 4 ++-- builtin/send-pack.c | 1 + builtin/shortlog.c | 2 +- builtin/show-branch.c | 3 ++- builtin/show-index.c | 2 +- builtin/show-ref.c | 1 + builtin/sparse-checkout.c | 2 +- builtin/stash.c | 1 + builtin/stripspace.c | 1 + builtin/submodule--helper.c | 3 ++- builtin/symbolic-ref.c | 1 + builtin/tag.c | 2 +- builtin/unpack-file.c | 1 + builtin/unpack-objects.c | 1 + builtin/update-index.c | 3 +-- builtin/update-ref.c | 2 +- builtin/update-server-info.c | 1 + builtin/upload-archive.c | 2 +- builtin/upload-pack.c | 1 + builtin/var.c | 2 ++ builtin/verify-commit.c | 2 +- builtin/verify-pack.c | 1 + builtin/verify-tag.c | 1 + builtin/worktree.c | 2 +- builtin/write-tree.c | 3 +-- 125 files changed, 147 insertions(+), 92 deletions(-) (limited to 'builtin/reset.c') diff --git a/builtin.h b/builtin.h index fc6fc8ffed..f7b166b334 100644 --- a/builtin.h +++ b/builtin.h @@ -1,14 +1,6 @@ #ifndef 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 "repository.h" diff --git a/builtin/add.c b/builtin/add.c index ba331519ca..c893ff48d2 100644 --- a/builtin/add.c +++ b/builtin/add.c @@ -3,7 +3,7 @@ * * Copyright (C) 2006 Linus Torvalds */ - +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "advice.h" #include "config.h" @@ -18,7 +18,6 @@ #include "preload-index.h" #include "diff.h" #include "read-cache.h" -#include "repository.h" #include "revision.h" #include "bulk-checkin.h" #include "strvec.h" diff --git a/builtin/am.c b/builtin/am.c index 8c610eed3e..7693891fcd 100644 --- a/builtin/am.c +++ b/builtin/am.c @@ -4,6 +4,7 @@ * Based on git-am.sh by Junio C Hamano. */ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "abspath.h" #include "advice.h" @@ -38,7 +39,6 @@ #include "string-list.h" #include "pager.h" #include "path.h" -#include "repository.h" #include "pretty.h" /** diff --git a/builtin/annotate.c b/builtin/annotate.c index 0abf89ef18..a99179fe4d 100644 --- a/builtin/annotate.c +++ b/builtin/annotate.c @@ -3,6 +3,8 @@ * * Copyright (C) 2006 Ryan Anderson */ + +#define USE_THE_REPOSITORY_VARIABLE #include "git-compat-util.h" #include "builtin.h" #include "strvec.h" diff --git a/builtin/apply.c b/builtin/apply.c index ca0bb97df4..84f1863d3a 100644 --- a/builtin/apply.c +++ b/builtin/apply.c @@ -1,6 +1,6 @@ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "gettext.h" -#include "repository.h" #include "hash.h" #include "apply.h" diff --git a/builtin/archive.c b/builtin/archive.c index de59c3ae97..22f7c63529 100644 --- a/builtin/archive.c +++ b/builtin/archive.c @@ -2,13 +2,13 @@ * Copyright (c) 2006 Franck Bui-Huu * Copyright (c) 2006 Rene Scharfe */ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "archive.h" #include "gettext.h" #include "transport.h" #include "parse-options.h" #include "pkt-line.h" -#include "repository.h" static void create_output_file(const char *output_file) { diff --git a/builtin/bisect.c b/builtin/bisect.c index b83056df9f..5e91c59c76 100644 --- a/builtin/bisect.c +++ b/builtin/bisect.c @@ -1,3 +1,4 @@ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "copy.h" #include "environment.h" diff --git a/builtin/blame.c b/builtin/blame.c index 728a62402b..472dd762f4 100644 --- a/builtin/blame.c +++ b/builtin/blame.c @@ -4,7 +4,7 @@ * Copyright (c) 2006, 2014 by its authors * See COPYING for licensing conditions */ - +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "config.h" #include "color.h" @@ -12,7 +12,6 @@ #include "environment.h" #include "gettext.h" #include "hex.h" -#include "repository.h" #include "commit.h" #include "diff.h" #include "revision.h" diff --git a/builtin/branch.c b/builtin/branch.c index 7980d2e83d..7112459ebd 100644 --- a/builtin/branch.c +++ b/builtin/branch.c @@ -4,7 +4,7 @@ * Copyright (c) 2006 Kristian Høgsberg * Based on git-branch.sh by Junio C Hamano. */ - +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "config.h" #include "color.h" diff --git a/builtin/bugreport.c b/builtin/bugreport.c index aeab40c490..7c2df035c9 100644 --- a/builtin/bugreport.c +++ b/builtin/bugreport.c @@ -1,3 +1,4 @@ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "abspath.h" #include "editor.h" diff --git a/builtin/bundle.c b/builtin/bundle.c index 97f7f530d0..cabb20b44b 100644 --- a/builtin/bundle.c +++ b/builtin/bundle.c @@ -1,3 +1,4 @@ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "abspath.h" #include "gettext.h" @@ -5,7 +6,6 @@ #include "strvec.h" #include "parse-options.h" #include "pkt-line.h" -#include "repository.h" #include "bundle.h" /* diff --git a/builtin/cat-file.c b/builtin/cat-file.c index b244b5a1ab..b9b754b354 100644 --- a/builtin/cat-file.c +++ b/builtin/cat-file.c @@ -3,7 +3,7 @@ * * Copyright (C) Linus Torvalds, 2005 */ - +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "config.h" #include "convert.h" diff --git a/builtin/check-attr.c b/builtin/check-attr.c index ffd1067558..7cf275b893 100644 --- a/builtin/check-attr.c +++ b/builtin/check-attr.c @@ -1,3 +1,4 @@ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "config.h" #include "attr.h" @@ -5,7 +6,6 @@ #include "gettext.h" #include "object-name.h" #include "quote.h" -#include "repository.h" #include "setup.h" #include "parse-options.h" #include "write-or-die.h" diff --git a/builtin/check-ignore.c b/builtin/check-ignore.c index 70565b9f89..7b7831d13a 100644 --- a/builtin/check-ignore.c +++ b/builtin/check-ignore.c @@ -1,3 +1,4 @@ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "config.h" #include "dir.h" @@ -5,7 +6,6 @@ #include "quote.h" #include "pathspec.h" #include "parse-options.h" -#include "repository.h" #include "submodule.h" #include "write-or-die.h" diff --git a/builtin/check-mailmap.c b/builtin/check-mailmap.c index 87cc036dd1..c0610469d4 100644 --- a/builtin/check-mailmap.c +++ b/builtin/check-mailmap.c @@ -1,3 +1,4 @@ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "config.h" #include "gettext.h" diff --git a/builtin/check-ref-format.c b/builtin/check-ref-format.c index 6874edb4f4..65945171b3 100644 --- a/builtin/check-ref-format.c +++ b/builtin/check-ref-format.c @@ -1,7 +1,7 @@ /* * GIT - The information manager from hell */ - +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "refs.h" #include "setup.h" diff --git a/builtin/checkout--worker.c b/builtin/checkout--worker.c index f53e108269..ff6cdccc21 100644 --- a/builtin/checkout--worker.c +++ b/builtin/checkout--worker.c @@ -1,3 +1,4 @@ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "config.h" #include "entry.h" diff --git a/builtin/checkout-index.c b/builtin/checkout-index.c index 98247ff823..6dd38eb05d 100644 --- a/builtin/checkout-index.c +++ b/builtin/checkout-index.c @@ -4,13 +4,12 @@ * Copyright (C) 2005 Linus Torvalds * */ - +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "config.h" #include "gettext.h" #include "lockfile.h" #include "quote.h" -#include "repository.h" #include "cache-tree.h" #include "parse-options.h" #include "entry.h" diff --git a/builtin/checkout.c b/builtin/checkout.c index d3bc48684f..d6defc36b2 100644 --- a/builtin/checkout.c +++ b/builtin/checkout.c @@ -1,3 +1,4 @@ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "advice.h" #include "branch.h" diff --git a/builtin/clean.c b/builtin/clean.c index b5887f877e..9c48dd0271 100644 --- a/builtin/clean.c +++ b/builtin/clean.c @@ -5,7 +5,7 @@ * * Based on git-clean.sh by Pavel Roskin */ - +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "abspath.h" #include "config.h" @@ -14,7 +14,6 @@ #include "parse-options.h" #include "path.h" #include "read-cache-ll.h" -#include "repository.h" #include "setup.h" #include "string-list.h" #include "quote.h" diff --git a/builtin/clone.c b/builtin/clone.c index 1b82310ac5..e77339c847 100644 --- a/builtin/clone.c +++ b/builtin/clone.c @@ -7,8 +7,9 @@ * * Clone a repository into a different directory that does not yet exist. */ - +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" + #include "abspath.h" #include "advice.h" #include "config.h" diff --git a/builtin/column.c b/builtin/column.c index 93f84beeee..50314cc255 100644 --- a/builtin/column.c +++ b/builtin/column.c @@ -1,3 +1,4 @@ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "config.h" #include "gettext.h" diff --git a/builtin/commit-graph.c b/builtin/commit-graph.c index 65ce98d467..81e577c14a 100644 --- a/builtin/commit-graph.c +++ b/builtin/commit-graph.c @@ -1,3 +1,4 @@ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "commit.h" #include "config.h" @@ -5,7 +6,6 @@ #include "gettext.h" #include "hex.h" #include "parse-options.h" -#include "repository.h" #include "commit-graph.h" #include "object-store-ll.h" #include "progress.h" diff --git a/builtin/commit-tree.c b/builtin/commit-tree.c index bd8bf3296e..2ca1a57ebb 100644 --- a/builtin/commit-tree.c +++ b/builtin/commit-tree.c @@ -3,13 +3,14 @@ * * Copyright (C) Linus Torvalds, 2005 */ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "config.h" #include "gettext.h" #include "hex.h" #include "object-name.h" #include "object-store-ll.h" -#include "repository.h" + #include "commit.h" #include "parse-options.h" diff --git a/builtin/commit.c b/builtin/commit.c index 768d76ac46..fd1cc42c5a 100644 --- a/builtin/commit.c +++ b/builtin/commit.c @@ -4,7 +4,7 @@ * Copyright (c) 2007 Kristian Høgsberg * Based on git-commit.sh by Junio C Hamano and Linus Torvalds */ - +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "advice.h" #include "config.h" diff --git a/builtin/config.c b/builtin/config.c index 841a5d706f..faa0ee7d65 100644 --- a/builtin/config.c +++ b/builtin/config.c @@ -1,10 +1,10 @@ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "abspath.h" #include "config.h" #include "color.h" #include "editor.h" #include "environment.h" -#include "repository.h" #include "gettext.h" #include "ident.h" #include "parse-options.h" diff --git a/builtin/count-objects.c b/builtin/count-objects.c index 6b905da3c3..3d7b289f59 100644 --- a/builtin/count-objects.c +++ b/builtin/count-objects.c @@ -3,14 +3,13 @@ * * Copyright (c) 2006 Junio C Hamano */ - +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "config.h" #include "dir.h" #include "environment.h" #include "gettext.h" #include "path.h" -#include "repository.h" #include "parse-options.h" #include "quote.h" #include "packfile.h" diff --git a/builtin/credential-cache--daemon.c b/builtin/credential-cache--daemon.c index 4caaf38b84..bc22f5c6d2 100644 --- a/builtin/credential-cache--daemon.c +++ b/builtin/credential-cache--daemon.c @@ -1,3 +1,4 @@ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "abspath.h" #include "gettext.h" diff --git a/builtin/credential-cache.c b/builtin/credential-cache.c index 5de8b9123b..1918c474f0 100644 --- a/builtin/credential-cache.c +++ b/builtin/credential-cache.c @@ -1,3 +1,4 @@ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "credential.h" #include "gettext.h" diff --git a/builtin/credential-store.c b/builtin/credential-store.c index 128704078e..e669e99dbf 100644 --- a/builtin/credential-store.c +++ b/builtin/credential-store.c @@ -1,3 +1,4 @@ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "config.h" #include "gettext.h" diff --git a/builtin/credential.c b/builtin/credential.c index 796422c6fe..14c8c6608b 100644 --- a/builtin/credential.c +++ b/builtin/credential.c @@ -1,3 +1,5 @@ +#define USE_THE_REPOSITORY_VARIABLE + #include "git-compat-util.h" #include "credential.h" #include "builtin.h" diff --git a/builtin/describe.c b/builtin/describe.c index 1c1c250fe0..7929223c8b 100644 --- a/builtin/describe.c +++ b/builtin/describe.c @@ -1,3 +1,4 @@ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "config.h" #include "environment.h" diff --git a/builtin/diagnose.c b/builtin/diagnose.c index 66a22d918e..5ac7872b99 100644 --- a/builtin/diagnose.c +++ b/builtin/diagnose.c @@ -1,3 +1,4 @@ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "abspath.h" #include "gettext.h" diff --git a/builtin/diff-files.c b/builtin/diff-files.c index 7f4f9bcb3e..b8ec420f86 100644 --- a/builtin/diff-files.c +++ b/builtin/diff-files.c @@ -3,13 +3,13 @@ * * Copyright (C) Linus Torvalds, 2005 */ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "config.h" #include "diff.h" #include "diff-merges.h" #include "commit.h" #include "preload-index.h" -#include "repository.h" #include "revision.h" static const char diff_files_usage[] = diff --git a/builtin/diff-index.c b/builtin/diff-index.c index 8abec38592..e87f717d86 100644 --- a/builtin/diff-index.c +++ b/builtin/diff-index.c @@ -1,10 +1,10 @@ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "config.h" #include "diff.h" #include "diff-merges.h" #include "commit.h" #include "preload-index.h" -#include "repository.h" #include "revision.h" #include "setup.h" diff --git a/builtin/diff-tree.c b/builtin/diff-tree.c index 841448b023..715995c46f 100644 --- a/builtin/diff-tree.c +++ b/builtin/diff-tree.c @@ -1,3 +1,4 @@ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "config.h" #include "diff.h" @@ -6,7 +7,6 @@ #include "hex.h" #include "log-tree.h" #include "read-cache-ll.h" -#include "repository.h" #include "revision.h" #include "tmp-objdir.h" #include "tree.h" diff --git a/builtin/diff.c b/builtin/diff.c index 499b7872dd..63e790b229 100644 --- a/builtin/diff.c +++ b/builtin/diff.c @@ -3,7 +3,7 @@ * * Copyright (c) 2006 Junio C Hamano */ - +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "config.h" #include "ewah/ewok.h" diff --git a/builtin/difftool.c b/builtin/difftool.c index c8700d67f4..f7dfa1fd0d 100644 --- a/builtin/difftool.c +++ b/builtin/difftool.c @@ -11,8 +11,9 @@ * * Copyright (C) 2016 Johannes Schindelin */ - +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" + #include "abspath.h" #include "config.h" #include "copy.h" diff --git a/builtin/fast-export.c b/builtin/fast-export.c index 1bd5949dd2..e17f262e8e 100644 --- a/builtin/fast-export.c +++ b/builtin/fast-export.c @@ -3,6 +3,7 @@ * * Copyright (C) 2007 Johannes E. Schindelin */ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "config.h" #include "gettext.h" diff --git a/builtin/fast-import.c b/builtin/fast-import.c index 4b9e341aa4..1e7ab67f6e 100644 --- a/builtin/fast-import.c +++ b/builtin/fast-import.c @@ -1,9 +1,9 @@ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "abspath.h" #include "environment.h" #include "gettext.h" #include "hex.h" -#include "repository.h" #include "config.h" #include "lockfile.h" #include "object.h" diff --git a/builtin/fetch-pack.c b/builtin/fetch-pack.c index fddd8a2c1c..d2c4304d22 100644 --- a/builtin/fetch-pack.c +++ b/builtin/fetch-pack.c @@ -1,3 +1,4 @@ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "gettext.h" #include "hex.h" diff --git a/builtin/fetch.c b/builtin/fetch.c index 46ecfc5bc6..9e68114b86 100644 --- a/builtin/fetch.c +++ b/builtin/fetch.c @@ -1,13 +1,13 @@ /* * "git fetch" */ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "advice.h" #include "config.h" #include "gettext.h" #include "environment.h" #include "hex.h" -#include "repository.h" #include "refs.h" #include "refspec.h" #include "object-name.h" diff --git a/builtin/fmt-merge-msg.c b/builtin/fmt-merge-msg.c index 1fba4cf559..324e904ac9 100644 --- a/builtin/fmt-merge-msg.c +++ b/builtin/fmt-merge-msg.c @@ -1,3 +1,4 @@ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "config.h" #include "fmt-merge-msg.h" diff --git a/builtin/for-each-ref.c b/builtin/for-each-ref.c index b118758713..8085ebd8fe 100644 --- a/builtin/for-each-ref.c +++ b/builtin/for-each-ref.c @@ -1,3 +1,4 @@ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "commit.h" #include "config.h" diff --git a/builtin/for-each-repo.c b/builtin/for-each-repo.c index 93d82b952e..fae7f91cf1 100644 --- a/builtin/for-each-repo.c +++ b/builtin/for-each-repo.c @@ -1,9 +1,9 @@ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "config.h" #include "gettext.h" #include "parse-options.h" #include "path.h" -#include "repository.h" #include "run-command.h" #include "string-list.h" diff --git a/builtin/fsck.c b/builtin/fsck.c index 87068cee09..7f4e2f0414 100644 --- a/builtin/fsck.c +++ b/builtin/fsck.c @@ -1,7 +1,7 @@ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "gettext.h" #include "hex.h" -#include "repository.h" #include "config.h" #include "commit.h" #include "tree.h" diff --git a/builtin/fsmonitor--daemon.c b/builtin/fsmonitor--daemon.c index 73a4b88566..ba8a6eebe5 100644 --- a/builtin/fsmonitor--daemon.c +++ b/builtin/fsmonitor--daemon.c @@ -1,3 +1,4 @@ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "abspath.h" #include "config.h" @@ -11,7 +12,7 @@ #include "compat/fsmonitor/fsm-health.h" #include "compat/fsmonitor/fsm-listen.h" #include "fsmonitor--daemon.h" -#include "repository.h" + #include "simple-ipc.h" #include "khash.h" #include "run-command.h" diff --git a/builtin/gc.c b/builtin/gc.c index 0727de1ae8..6bc8f7e7f8 100644 --- a/builtin/gc.c +++ b/builtin/gc.c @@ -9,13 +9,12 @@ * * Copyright (c) 2006 Shawn O. Pearce */ - +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "abspath.h" #include "date.h" #include "environment.h" #include "hex.h" -#include "repository.h" #include "config.h" #include "tempfile.h" #include "lockfile.h" diff --git a/builtin/get-tar-commit-id.c b/builtin/get-tar-commit-id.c index 6bec0d1854..272384a6b1 100644 --- a/builtin/get-tar-commit-id.c +++ b/builtin/get-tar-commit-id.c @@ -1,6 +1,7 @@ /* * Copyright (c) 2005, 2006 Rene Scharfe */ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "commit.h" #include "tar.h" diff --git a/builtin/grep.c b/builtin/grep.c index da11879c63..bc3439cabd 100644 --- a/builtin/grep.c +++ b/builtin/grep.c @@ -3,11 +3,11 @@ * * Copyright (c) 2006 Junio C Hamano */ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "abspath.h" #include "gettext.h" #include "hex.h" -#include "repository.h" #include "config.h" #include "tag.h" #include "tree-walk.h" diff --git a/builtin/hash-object.c b/builtin/hash-object.c index 090daea5cd..a25f0403f4 100644 --- a/builtin/hash-object.c +++ b/builtin/hash-object.c @@ -4,6 +4,7 @@ * Copyright (C) Linus Torvalds, 2005 * Copyright (C) Junio C Hamano, 2005 */ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "abspath.h" #include "config.h" diff --git a/builtin/help.c b/builtin/help.c index f7723bdf5c..9c4cfe11d9 100644 --- a/builtin/help.c +++ b/builtin/help.c @@ -1,6 +1,8 @@ + /* * Builtin help command */ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "config.h" #include "exec-cmd.h" diff --git a/builtin/hook.c b/builtin/hook.c index f02e2421ac..367ef3e0b8 100644 --- a/builtin/hook.c +++ b/builtin/hook.c @@ -1,3 +1,4 @@ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "config.h" #include "gettext.h" diff --git a/builtin/index-pack.c b/builtin/index-pack.c index 3207130bfe..32641134e9 100644 --- a/builtin/index-pack.c +++ b/builtin/index-pack.c @@ -1,3 +1,4 @@ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "config.h" #include "delta.h" diff --git a/builtin/init-db.c b/builtin/init-db.c index 94bd607509..687cada4d7 100644 --- a/builtin/init-db.c +++ b/builtin/init-db.c @@ -3,6 +3,7 @@ * * Copyright (C) Linus Torvalds, 2005 */ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "abspath.h" #include "environment.h" @@ -11,7 +12,6 @@ #include "parse-options.h" #include "path.h" #include "refs.h" -#include "repository.h" #include "setup.h" #include "strbuf.h" diff --git a/builtin/interpret-trailers.c b/builtin/interpret-trailers.c index fb93e54e5e..44f83625c1 100644 --- a/builtin/interpret-trailers.c +++ b/builtin/interpret-trailers.c @@ -4,7 +4,7 @@ * Copyright (c) 2013, 2014 Christian Couder * */ - +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "gettext.h" #include "parse-options.h" diff --git a/builtin/log.c b/builtin/log.c index 67140575f4..e4533a99fd 100644 --- a/builtin/log.c +++ b/builtin/log.c @@ -4,6 +4,7 @@ * (C) Copyright 2006 Linus Torvalds * 2006 Junio Hamano */ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "abspath.h" #include "config.h" @@ -37,7 +38,7 @@ #include "mailmap.h" #include "progress.h" #include "commit-slab.h" -#include "repository.h" + #include "commit-reach.h" #include "range-diff.h" #include "tmp-objdir.h" diff --git a/builtin/ls-files.c b/builtin/ls-files.c index 7f45cb62cf..6aaba08e30 100644 --- a/builtin/ls-files.c +++ b/builtin/ls-files.c @@ -5,8 +5,8 @@ * * Copyright (C) Linus Torvalds, 2005 */ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" -#include "repository.h" #include "config.h" #include "convert.h" #include "quote.h" diff --git a/builtin/ls-remote.c b/builtin/ls-remote.c index f2c2854d0c..f723b3bf3b 100644 --- a/builtin/ls-remote.c +++ b/builtin/ls-remote.c @@ -1,3 +1,4 @@ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "gettext.h" #include "hex.h" diff --git a/builtin/ls-tree.c b/builtin/ls-tree.c index 363cb948d9..8542b5d53e 100644 --- a/builtin/ls-tree.c +++ b/builtin/ls-tree.c @@ -3,7 +3,9 @@ * * Copyright (C) Linus Torvalds, 2005 */ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" + #include "config.h" #include "gettext.h" #include "hex.h" diff --git a/builtin/mailinfo.c b/builtin/mailinfo.c index 00bfcd1afa..e17dec27b1 100644 --- a/builtin/mailinfo.c +++ b/builtin/mailinfo.c @@ -2,6 +2,7 @@ * Another stupid program, this one parsing the headers of an * email to figure out authorship and subject */ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "abspath.h" #include "environment.h" diff --git a/builtin/mailsplit.c b/builtin/mailsplit.c index b8f7150ce9..2425422141 100644 --- a/builtin/mailsplit.c +++ b/builtin/mailsplit.c @@ -4,6 +4,7 @@ * It just splits a mbox into a list of files: "0001" "0002" .. * so you can process them further from there. */ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "gettext.h" #include "string-list.h" diff --git a/builtin/merge-base.c b/builtin/merge-base.c index afeae8d834..a20c93b11a 100644 --- a/builtin/merge-base.c +++ b/builtin/merge-base.c @@ -1,3 +1,4 @@ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "config.h" #include "commit.h" @@ -5,7 +6,6 @@ #include "hex.h" #include "object-name.h" #include "parse-options.h" -#include "repository.h" #include "commit-reach.h" static int show_merge_base(struct commit **rev, int rev_nr, int show_all) diff --git a/builtin/merge-file.c b/builtin/merge-file.c index f785813dda..cb42865eb5 100644 --- a/builtin/merge-file.c +++ b/builtin/merge-file.c @@ -1,3 +1,4 @@ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "abspath.h" #include "diff.h" diff --git a/builtin/merge-index.c b/builtin/merge-index.c index 1309a8ff47..a5b87ee3c5 100644 --- a/builtin/merge-index.c +++ b/builtin/merge-index.c @@ -1,7 +1,7 @@ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "hex.h" #include "read-cache-ll.h" -#include "repository.h" #include "run-command.h" #include "sparse-index.h" diff --git a/builtin/merge-ours.c b/builtin/merge-ours.c index 62267f12dd..1fcf53f005 100644 --- a/builtin/merge-ours.c +++ b/builtin/merge-ours.c @@ -7,10 +7,11 @@ * * Pretend we resolved the heads, but declare our tree trumps everybody else. */ +#define USE_THE_REPOSITORY_VARIABLE #include "git-compat-util.h" #include "builtin.h" #include "diff.h" -#include "repository.h" + static const char builtin_merge_ours_usage[] = "git merge-ours ... -- HEAD ..."; diff --git a/builtin/merge-recursive.c b/builtin/merge-recursive.c index 2bd3fb0e55..1dd295558b 100644 --- a/builtin/merge-recursive.c +++ b/builtin/merge-recursive.c @@ -1,10 +1,10 @@ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "advice.h" #include "gettext.h" #include "hash.h" #include "merge-recursive.h" #include "object-name.h" -#include "repository.h" static const char builtin_merge_recursive_usage[] = "git %s ... -- ..."; diff --git a/builtin/merge-tree.c b/builtin/merge-tree.c index 8751d86fd0..33f91872f9 100644 --- a/builtin/merge-tree.c +++ b/builtin/merge-tree.c @@ -1,3 +1,4 @@ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "tree-walk.h" #include "xdiff-interface.h" @@ -10,7 +11,6 @@ #include "object-name.h" #include "object-store-ll.h" #include "parse-options.h" -#include "repository.h" #include "blob.h" #include "merge-blobs.h" #include "quote.h" diff --git a/builtin/merge.c b/builtin/merge.c index fd6dc00d6c..c54ac7b67c 100644 --- a/builtin/merge.c +++ b/builtin/merge.c @@ -5,8 +5,9 @@ * * Based on git-merge.sh by Junio C Hamano. */ - +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" + #include "abspath.h" #include "advice.h" #include "config.h" diff --git a/builtin/mktag.c b/builtin/mktag.c index 5cd8a3e6fa..6e188dce50 100644 --- a/builtin/mktag.c +++ b/builtin/mktag.c @@ -1,3 +1,4 @@ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "gettext.h" #include "hex.h" diff --git a/builtin/mktree.c b/builtin/mktree.c index 72a1af1bca..3c16faa40e 100644 --- a/builtin/mktree.c +++ b/builtin/mktree.c @@ -3,6 +3,7 @@ * * Copyright (c) Junio C Hamano, 2006, 2009 */ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "gettext.h" #include "hex.h" diff --git a/builtin/multi-pack-index.c b/builtin/multi-pack-index.c index 154fc77075..e397723fe0 100644 --- a/builtin/multi-pack-index.c +++ b/builtin/multi-pack-index.c @@ -1,3 +1,4 @@ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "abspath.h" #include "config.h" diff --git a/builtin/mv.c b/builtin/mv.c index 6e2eb9cf4b..472a278737 100644 --- a/builtin/mv.c +++ b/builtin/mv.c @@ -3,6 +3,7 @@ * * Copyright (C) 2006 Johannes Schindelin */ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "abspath.h" @@ -18,7 +19,7 @@ #include "string-list.h" #include "parse-options.h" #include "read-cache-ll.h" -#include "repository.h" + #include "setup.h" #include "strvec.h" #include "submodule.h" diff --git a/builtin/name-rev.c b/builtin/name-rev.c index 19d92fb382..7f08c38629 100644 --- a/builtin/name-rev.c +++ b/builtin/name-rev.c @@ -1,8 +1,8 @@ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "environment.h" #include "gettext.h" #include "hex.h" -#include "repository.h" #include "config.h" #include "commit.h" #include "tag.h" diff --git a/builtin/notes.c b/builtin/notes.c index 49d8364af6..55ce2eb919 100644 --- a/builtin/notes.c +++ b/builtin/notes.c @@ -6,7 +6,7 @@ * Based on git-notes.sh by Johannes Schindelin, * and builtin/tag.c by Kristian Høgsberg and Carlos Rica. */ - +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "config.h" #include "editor.h" @@ -17,7 +17,7 @@ #include "object-name.h" #include "object-store-ll.h" #include "path.h" -#include "repository.h" + #include "pretty.h" #include "refs.h" #include "exec-cmd.h" diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c index 127972f3cd..40c64f3377 100644 --- a/builtin/pack-objects.c +++ b/builtin/pack-objects.c @@ -1,8 +1,8 @@ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "environment.h" #include "gettext.h" #include "hex.h" -#include "repository.h" #include "config.h" #include "attr.h" #include "object.h" diff --git a/builtin/pack-redundant.c b/builtin/pack-redundant.c index 84f0d83aff..81f4494d46 100644 --- a/builtin/pack-redundant.c +++ b/builtin/pack-redundant.c @@ -5,11 +5,12 @@ * This file is licensed under the GPL v2. * */ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "gettext.h" #include "hex.h" -#include "repository.h" + #include "packfile.h" #include "object-store-ll.h" diff --git a/builtin/pack-refs.c b/builtin/pack-refs.c index 67dabb3975..2d83c1ed2a 100644 --- a/builtin/pack-refs.c +++ b/builtin/pack-refs.c @@ -1,9 +1,9 @@ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "config.h" #include "gettext.h" #include "parse-options.h" #include "refs.h" -#include "repository.h" #include "revision.h" static char const * const pack_refs_usage[] = { diff --git a/builtin/patch-id.c b/builtin/patch-id.c index fa31a1b7a6..704044c2eb 100644 --- a/builtin/patch-id.c +++ b/builtin/patch-id.c @@ -1,3 +1,4 @@ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "config.h" #include "diff.h" diff --git a/builtin/prune-packed.c b/builtin/prune-packed.c index 4d63f26b0a..0720d825c8 100644 --- a/builtin/prune-packed.c +++ b/builtin/prune-packed.c @@ -1,3 +1,4 @@ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "gettext.h" #include "parse-options.h" diff --git a/builtin/prune.c b/builtin/prune.c index cbd4c38fa0..f439d1b5bb 100644 --- a/builtin/prune.c +++ b/builtin/prune.c @@ -1,3 +1,4 @@ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "commit.h" #include "diff.h" diff --git a/builtin/pull.c b/builtin/pull.c index 1a926f0b0d..149f201320 100644 --- a/builtin/pull.c +++ b/builtin/pull.c @@ -6,6 +6,7 @@ * Fetch one or more remote refs and merge it/them into the current HEAD. */ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "advice.h" #include "config.h" diff --git a/builtin/push.c b/builtin/push.c index 9636ad52f4..238cd5da82 100644 --- a/builtin/push.c +++ b/builtin/push.c @@ -1,6 +1,7 @@ /* * "git push" */ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "advice.h" #include "branch.h" @@ -13,7 +14,6 @@ #include "transport.h" #include "parse-options.h" #include "pkt-line.h" -#include "repository.h" #include "submodule.h" #include "submodule-config.h" #include "send-pack.h" diff --git a/builtin/range-diff.c b/builtin/range-diff.c index 3e67259aec..1b33ab66a7 100644 --- a/builtin/range-diff.c +++ b/builtin/range-diff.c @@ -1,10 +1,11 @@ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "gettext.h" #include "object-name.h" #include "parse-options.h" #include "range-diff.h" #include "config.h" -#include "repository.h" + static const char * const builtin_range_diff_usage[] = { N_("git range-diff [] .. .."), diff --git a/builtin/read-tree.c b/builtin/read-tree.c index 89410db6a7..d2a807a828 100644 --- a/builtin/read-tree.c +++ b/builtin/read-tree.c @@ -3,7 +3,7 @@ * * Copyright (C) Linus Torvalds, 2005 */ - +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "config.h" #include "gettext.h" @@ -16,7 +16,6 @@ #include "cache-tree.h" #include "unpack-trees.h" #include "parse-options.h" -#include "repository.h" #include "resolve-undo.h" #include "setup.h" #include "sparse-index.h" diff --git a/builtin/rebase.c b/builtin/rebase.c index 727d9df847..d2ad7d0863 100644 --- a/builtin/rebase.c +++ b/builtin/rebase.c @@ -3,8 +3,9 @@ * * Copyright (c) 2018 Pratik Karki */ - +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" + #include "abspath.h" #include "environment.h" #include "gettext.h" diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c index 36a6229c2a..c4b766c613 100644 --- a/builtin/receive-pack.c +++ b/builtin/receive-pack.c @@ -1,6 +1,7 @@ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "abspath.h" -#include "repository.h" + #include "config.h" #include "environment.h" #include "gettext.h" diff --git a/builtin/reflog.c b/builtin/reflog.c index 6250f5ad49..22df6834f7 100644 --- a/builtin/reflog.c +++ b/builtin/reflog.c @@ -1,7 +1,7 @@ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "config.h" #include "gettext.h" -#include "repository.h" #include "revision.h" #include "reachable.h" #include "wildmatch.h" diff --git a/builtin/refs.c b/builtin/refs.c index 70bca724d2..24978a7b7b 100644 --- a/builtin/refs.c +++ b/builtin/refs.c @@ -1,9 +1,9 @@ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "config.h" #include "fsck.h" #include "parse-options.h" #include "refs.h" -#include "repository.h" #include "strbuf.h" #define REFS_MIGRATE_USAGE \ diff --git a/builtin/remote-ext.c b/builtin/remote-ext.c index 33c8ae0fc7..119f33895e 100644 --- a/builtin/remote-ext.c +++ b/builtin/remote-ext.c @@ -1,3 +1,4 @@ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "transport.h" #include "run-command.h" diff --git a/builtin/remote-fd.c b/builtin/remote-fd.c index ae896eda57..b27ea81e4f 100644 --- a/builtin/remote-fd.c +++ b/builtin/remote-fd.c @@ -1,3 +1,4 @@ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "transport.h" diff --git a/builtin/remote.c b/builtin/remote.c index 1ac7e5fbce..61a82e515b 100644 --- a/builtin/remote.c +++ b/builtin/remote.c @@ -1,3 +1,4 @@ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "config.h" #include "gettext.h" diff --git a/builtin/repack.c b/builtin/repack.c index a6f2a4de1b..1e2286d93a 100644 --- a/builtin/repack.c +++ b/builtin/repack.c @@ -1,3 +1,4 @@ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "config.h" #include "dir.h" diff --git a/builtin/replace.c b/builtin/replace.c index 293ae6d327..2daed94373 100644 --- a/builtin/replace.c +++ b/builtin/replace.c @@ -7,7 +7,7 @@ * and Carlos Rica that was itself based on * git-tag.sh and mktag.c by Linus Torvalds. */ - +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "config.h" #include "editor.h" @@ -22,7 +22,6 @@ #include "object-name.h" #include "object-store-ll.h" #include "replace-object.h" -#include "repository.h" #include "tag.h" #include "wildmatch.h" diff --git a/builtin/replay.c b/builtin/replay.c index c8e9098fc1..2d12a4e403 100644 --- a/builtin/replay.c +++ b/builtin/replay.c @@ -4,6 +4,7 @@ #include "git-compat-util.h" +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "environment.h" #include "hex.h" diff --git a/builtin/rerere.c b/builtin/rerere.c index ae34515583..f7143c3f5d 100644 --- a/builtin/rerere.c +++ b/builtin/rerere.c @@ -1,8 +1,9 @@ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "config.h" #include "gettext.h" #include "parse-options.h" -#include "repository.h" + #include "string-list.h" #include "rerere.h" #include "xdiff/xdiff.h" diff --git a/builtin/reset.c b/builtin/reset.c index 7552907260..cb054c2cc0 100644 --- a/builtin/reset.c +++ b/builtin/reset.c @@ -7,7 +7,7 @@ * * Copyright (c) 2005, 2006 Linus Torvalds and Junio C Hamano */ - +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "advice.h" #include "config.h" diff --git a/builtin/rev-list.c b/builtin/rev-list.c index a4186d47ce..f62bcbf2b1 100644 --- a/builtin/rev-list.c +++ b/builtin/rev-list.c @@ -1,3 +1,4 @@ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "config.h" #include "commit.h" diff --git a/builtin/rev-parse.c b/builtin/rev-parse.c index 26190aaa3e..f2d90f6995 100644 --- a/builtin/rev-parse.c +++ b/builtin/rev-parse.c @@ -3,8 +3,9 @@ * * Copyright (C) Linus Torvalds, 2005 */ - +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" + #include "abspath.h" #include "config.h" #include "commit.h" diff --git a/builtin/revert.c b/builtin/revert.c index 5f2ec3ade7..55ba1092c5 100644 --- a/builtin/revert.c +++ b/builtin/revert.c @@ -1,9 +1,9 @@ +#define USE_THE_REPOSITORY_VARIABLE #include "git-compat-util.h" #include "builtin.h" #include "parse-options.h" #include "diff.h" #include "gettext.h" -#include "repository.h" #include "revision.h" #include "rerere.h" #include "sequencer.h" diff --git a/builtin/rm.c b/builtin/rm.c index 59077efa4b..eaff027258 100644 --- a/builtin/rm.c +++ b/builtin/rm.c @@ -3,7 +3,7 @@ * * Copyright (C) Linus Torvalds 2006 */ - +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "advice.h" #include "config.h" @@ -15,7 +15,7 @@ #include "object-name.h" #include "parse-options.h" #include "read-cache.h" -#include "repository.h" + #include "string-list.h" #include "setup.h" #include "sparse-index.h" diff --git a/builtin/send-pack.c b/builtin/send-pack.c index a4925ed5fd..4fd3cb8a35 100644 --- a/builtin/send-pack.c +++ b/builtin/send-pack.c @@ -1,3 +1,4 @@ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "config.h" #include "hex.h" diff --git a/builtin/shortlog.c b/builtin/shortlog.c index 70eb789033..3ed5c46078 100644 --- a/builtin/shortlog.c +++ b/builtin/shortlog.c @@ -1,3 +1,4 @@ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "config.h" #include "commit.h" @@ -5,7 +6,6 @@ #include "environment.h" #include "gettext.h" #include "string-list.h" -#include "repository.h" #include "revision.h" #include "utf8.h" #include "mailmap.h" diff --git a/builtin/show-branch.c b/builtin/show-branch.c index 05c10628df..cd6bdf63bc 100644 --- a/builtin/show-branch.c +++ b/builtin/show-branch.c @@ -1,3 +1,4 @@ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "config.h" #include "environment.h" @@ -10,7 +11,7 @@ #include "strvec.h" #include "object-name.h" #include "parse-options.h" -#include "repository.h" + #include "dir.h" #include "commit-slab.h" #include "date.h" diff --git a/builtin/show-index.c b/builtin/show-index.c index 9e1f7ac9ca..f164c01bbe 100644 --- a/builtin/show-index.c +++ b/builtin/show-index.c @@ -1,10 +1,10 @@ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "gettext.h" #include "hash.h" #include "hex.h" #include "pack.h" #include "parse-options.h" -#include "repository.h" static const char *const show_index_usage[] = { "git show-index [--object-format=]", diff --git a/builtin/show-ref.c b/builtin/show-ref.c index 6ee05f09a6..285cd3e433 100644 --- a/builtin/show-ref.c +++ b/builtin/show-ref.c @@ -1,3 +1,4 @@ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "config.h" #include "gettext.h" diff --git a/builtin/sparse-checkout.c b/builtin/sparse-checkout.c index 23f1548fe5..5e930e5d63 100644 --- a/builtin/sparse-checkout.c +++ b/builtin/sparse-checkout.c @@ -1,3 +1,4 @@ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "config.h" #include "dir.h" @@ -7,7 +8,6 @@ #include "object-name.h" #include "parse-options.h" #include "pathspec.h" -#include "repository.h" #include "strbuf.h" #include "string-list.h" #include "lockfile.h" diff --git a/builtin/stash.c b/builtin/stash.c index 518d297b47..461cfaef39 100644 --- a/builtin/stash.c +++ b/builtin/stash.c @@ -1,3 +1,4 @@ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "abspath.h" #include "config.h" diff --git a/builtin/stripspace.c b/builtin/stripspace.c index 674ef93976..e147f3ff92 100644 --- a/builtin/stripspace.c +++ b/builtin/stripspace.c @@ -1,3 +1,4 @@ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "config.h" #include "environment.h" diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c index 947bd9d0f6..b83d44ba6d 100644 --- a/builtin/submodule--helper.c +++ b/builtin/submodule--helper.c @@ -1,9 +1,10 @@ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "abspath.h" #include "environment.h" #include "gettext.h" #include "hex.h" -#include "repository.h" + #include "config.h" #include "parse-options.h" #include "quote.h" diff --git a/builtin/symbolic-ref.c b/builtin/symbolic-ref.c index 9bc7022946..299d23d76a 100644 --- a/builtin/symbolic-ref.c +++ b/builtin/symbolic-ref.c @@ -1,3 +1,4 @@ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "config.h" #include "gettext.h" diff --git a/builtin/tag.c b/builtin/tag.c index a80838eb8e..ca2166e7e2 100644 --- a/builtin/tag.c +++ b/builtin/tag.c @@ -5,7 +5,7 @@ * Carlos Rica * Based on git-tag.sh and mktag.c by Linus Torvalds. */ - +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "advice.h" #include "config.h" diff --git a/builtin/unpack-file.c b/builtin/unpack-file.c index 97886840f8..6da2825753 100644 --- a/builtin/unpack-file.c +++ b/builtin/unpack-file.c @@ -1,3 +1,4 @@ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "config.h" #include "hex.h" diff --git a/builtin/unpack-objects.c b/builtin/unpack-objects.c index 3bcdaaeb5f..02b8d02f63 100644 --- a/builtin/unpack-objects.c +++ b/builtin/unpack-objects.c @@ -1,3 +1,4 @@ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "bulk-checkin.h" #include "config.h" diff --git a/builtin/update-index.c b/builtin/update-index.c index 1d1d87d08e..a1a98aa7bc 100644 --- a/builtin/update-index.c +++ b/builtin/update-index.c @@ -3,7 +3,7 @@ * * Copyright (C) Linus Torvalds, 2005 */ - +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "bulk-checkin.h" #include "config.h" @@ -22,7 +22,6 @@ #include "pathspec.h" #include "dir.h" #include "read-cache.h" -#include "repository.h" #include "setup.h" #include "sparse-index.h" #include "split-index.h" diff --git a/builtin/update-ref.c b/builtin/update-ref.c index 06826a9051..8a98615dc8 100644 --- a/builtin/update-ref.c +++ b/builtin/update-ref.c @@ -1,3 +1,4 @@ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "config.h" #include "gettext.h" @@ -6,7 +7,6 @@ #include "object-name.h" #include "parse-options.h" #include "quote.h" -#include "repository.h" static const char * const git_update_ref_usage[] = { N_("git update-ref [] -d []"), diff --git a/builtin/update-server-info.c b/builtin/update-server-info.c index a5b7d86727..6769611a02 100644 --- a/builtin/update-server-info.c +++ b/builtin/update-server-info.c @@ -1,3 +1,4 @@ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "config.h" #include "gettext.h" diff --git a/builtin/upload-archive.c b/builtin/upload-archive.c index 49d1bb7fb4..6f2ddbd71c 100644 --- a/builtin/upload-archive.c +++ b/builtin/upload-archive.c @@ -1,12 +1,12 @@ /* * Copyright (c) 2006 Franck Bui-Huu */ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "archive.h" #include "path.h" #include "pkt-line.h" #include "sideband.h" -#include "repository.h" #include "run-command.h" #include "strvec.h" diff --git a/builtin/upload-pack.c b/builtin/upload-pack.c index 3b6c83fbce..363091c31e 100644 --- a/builtin/upload-pack.c +++ b/builtin/upload-pack.c @@ -1,3 +1,4 @@ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "exec-cmd.h" #include "gettext.h" diff --git a/builtin/var.c b/builtin/var.c index 4a5c2649d6..2ecaed51b4 100644 --- a/builtin/var.c +++ b/builtin/var.c @@ -3,7 +3,9 @@ * * Copyright (C) Eric Biederman, 2005 */ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" + #include "attr.h" #include "config.h" #include "editor.h" diff --git a/builtin/verify-commit.c b/builtin/verify-commit.c index c5859e5b2b..779b7988ca 100644 --- a/builtin/verify-commit.c +++ b/builtin/verify-commit.c @@ -5,11 +5,11 @@ * * Based on git-verify-tag */ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "config.h" #include "gettext.h" #include "object-name.h" -#include "repository.h" #include "commit.h" #include "parse-options.h" #include "gpg-interface.h" diff --git a/builtin/verify-pack.c b/builtin/verify-pack.c index 7ad456649d..34e4ed715f 100644 --- a/builtin/verify-pack.c +++ b/builtin/verify-pack.c @@ -1,3 +1,4 @@ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "config.h" #include "gettext.h" diff --git a/builtin/verify-tag.c b/builtin/verify-tag.c index a7bef52419..f6b97048a5 100644 --- a/builtin/verify-tag.c +++ b/builtin/verify-tag.c @@ -5,6 +5,7 @@ * * Based on git-verify-tag.sh */ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "config.h" #include "gettext.h" diff --git a/builtin/worktree.c b/builtin/worktree.c index 3b47f9832f..c22b2e95f5 100644 --- a/builtin/worktree.c +++ b/builtin/worktree.c @@ -1,3 +1,4 @@ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "abspath.h" #include "advice.h" @@ -17,7 +18,6 @@ #include "read-cache-ll.h" #include "refs.h" #include "remote.h" -#include "repository.h" #include "run-command.h" #include "hook.h" #include "sigchain.h" diff --git a/builtin/write-tree.c b/builtin/write-tree.c index 1b467d6ed2..de4ebf767d 100644 --- a/builtin/write-tree.c +++ b/builtin/write-tree.c @@ -3,7 +3,7 @@ * * Copyright (C) Linus Torvalds, 2005 */ - +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "config.h" #include "environment.h" @@ -12,7 +12,6 @@ #include "tree.h" #include "cache-tree.h" #include "parse-options.h" -#include "repository.h" static const char * const write_tree_usage[] = { N_("git write-tree [--missing-ok] [--prefix=/]"), -- cgit v1.2.3