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>
John Cai committed
Sep 13, 2024 at 21:16 UTC
03eae9afb447ad4add2f18a1adb3589f050d596f
125 files changed
+147
-92
builtin.h
-8
@@ -1,14 +1,6 @@
1
#ifndef BUILTIN_H
2
#define BUILTIN_H
3
4
-/*
5
- * TODO: Almost all of our builtins access `the_repository` by necessity
6
- * because they do not get passed a pointer to it. We should adapt the function
7
- * signature of those main functions to accept a `struct repository *` and then
8
- * remove the macro here.
9
- */
10
-#define USE_THE_REPOSITORY_VARIABLE
11
-
4
#include "git-compat-util.h"
5
#include "repository.h"
6
builtin/add.c
+1
-2
@@ -3,7 +3,7 @@
3
*
4
* Copyright (C) 2006 Linus Torvalds
5
*/
6
-
6
+#define USE_THE_REPOSITORY_VARIABLE
7
#include "builtin.h"
8
#include "advice.h"
9
#include "config.h"
@@ -18,7 +18,6 @@
18
#include "preload-index.h"
19
#include "diff.h"
20
#include "read-cache.h"
21
-#include "repository.h"
21
#include "revision.h"
22
#include "bulk-checkin.h"
23
#include "strvec.h"
builtin/am.c
+1
-1
@@ -4,6 +4,7 @@
4
* Based on git-am.sh by Junio C Hamano.
5
*/
6
7
+#define USE_THE_REPOSITORY_VARIABLE
8
#include "builtin.h"
9
#include "abspath.h"
10
#include "advice.h"
@@ -38,7 +39,6 @@
39
#include "string-list.h"
40
#include "pager.h"
41
#include "path.h"
41
-#include "repository.h"
42
#include "pretty.h"
43
44
/**
builtin/annotate.c
+2
@@ -3,6 +3,8 @@
3
*
4
* Copyright (C) 2006 Ryan Anderson
5
*/
6
+
7
+#define USE_THE_REPOSITORY_VARIABLE
8
#include "git-compat-util.h"
9
#include "builtin.h"
10
#include "strvec.h"
builtin/apply.c
+1
-1
@@ -1,6 +1,6 @@
1
+#define USE_THE_REPOSITORY_VARIABLE
2
#include "builtin.h"
3
#include "gettext.h"
3
-#include "repository.h"
4
#include "hash.h"
5
#include "apply.h"
6
builtin/archive.c
+1
-1
@@ -2,13 +2,13 @@
2
* Copyright (c) 2006 Franck Bui-Huu
3
* Copyright (c) 2006 Rene Scharfe
4
*/
5
+#define USE_THE_REPOSITORY_VARIABLE
6
#include "builtin.h"
7
#include "archive.h"
8
#include "gettext.h"
9
#include "transport.h"
10
#include "parse-options.h"
11
#include "pkt-line.h"
11
-#include "repository.h"
12
13
static void create_output_file(const char *output_file)
14
{
builtin/bisect.c
+1
@@ -1,3 +1,4 @@
1
+#define USE_THE_REPOSITORY_VARIABLE
2
#include "builtin.h"
3
#include "copy.h"
4
#include "environment.h"
builtin/blame.c
+1
-2
@@ -4,7 +4,7 @@
4
* Copyright (c) 2006, 2014 by its authors
5
* See COPYING for licensing conditions
6
*/
7
-
7
+#define USE_THE_REPOSITORY_VARIABLE
8
#include "builtin.h"
9
#include "config.h"
10
#include "color.h"
@@ -12,7 +12,6 @@
12
#include "environment.h"
13
#include "gettext.h"
14
#include "hex.h"
15
-#include "repository.h"
15
#include "commit.h"
16
#include "diff.h"
17
#include "revision.h"
builtin/branch.c
+1
-1
@@ -4,7 +4,7 @@
4
* Copyright (c) 2006 Kristian Høgsberg <krh@redhat.com>
5
* Based on git-branch.sh by Junio C Hamano.
6
*/
7
-
7
+#define USE_THE_REPOSITORY_VARIABLE
8
#include "builtin.h"
9
#include "config.h"
10
#include "color.h"
builtin/bugreport.c
+1
@@ -1,3 +1,4 @@
1
+#define USE_THE_REPOSITORY_VARIABLE
2
#include "builtin.h"
3
#include "abspath.h"
4
#include "editor.h"
builtin/bundle.c
+1
-1
@@ -1,3 +1,4 @@
1
+#define USE_THE_REPOSITORY_VARIABLE
2
#include "builtin.h"
3
#include "abspath.h"
4
#include "gettext.h"
@@ -5,7 +6,6 @@
6
#include "strvec.h"
7
#include "parse-options.h"
8
#include "pkt-line.h"
8
-#include "repository.h"
9
#include "bundle.h"
10
11
/*
builtin/cat-file.c
+1
-1
@@ -3,7 +3,7 @@
3
*
4
* Copyright (C) Linus Torvalds, 2005
5
*/
6
-
6
+#define USE_THE_REPOSITORY_VARIABLE
7
#include "builtin.h"
8
#include "config.h"
9
#include "convert.h"
builtin/check-attr.c
+1
-1
@@ -1,3 +1,4 @@
1
+#define USE_THE_REPOSITORY_VARIABLE
2
#include "builtin.h"
3
#include "config.h"
4
#include "attr.h"
@@ -5,7 +6,6 @@
6
#include "gettext.h"
7
#include "object-name.h"
8
#include "quote.h"
8
-#include "repository.h"
9
#include "setup.h"
10
#include "parse-options.h"
11
#include "write-or-die.h"
builtin/check-ignore.c
+1
-1
@@ -1,3 +1,4 @@
1
+#define USE_THE_REPOSITORY_VARIABLE
2
#include "builtin.h"
3
#include "config.h"
4
#include "dir.h"
@@ -5,7 +6,6 @@
6
#include "quote.h"
7
#include "pathspec.h"
8
#include "parse-options.h"
8
-#include "repository.h"
9
#include "submodule.h"
10
#include "write-or-die.h"
11
builtin/check-mailmap.c
+1
@@ -1,3 +1,4 @@
1
+#define USE_THE_REPOSITORY_VARIABLE
2
#include "builtin.h"
3
#include "config.h"
4
#include "gettext.h"
builtin/check-ref-format.c
+1
-1
@@ -1,7 +1,7 @@
1
/*
2
* GIT - The information manager from hell
3
*/
4
-
4
+#define USE_THE_REPOSITORY_VARIABLE
5
#include "builtin.h"
6
#include "refs.h"
7
#include "setup.h"
builtin/checkout--worker.c
+1
@@ -1,3 +1,4 @@
1
+#define USE_THE_REPOSITORY_VARIABLE
2
#include "builtin.h"
3
#include "config.h"
4
#include "entry.h"
builtin/checkout-index.c
+1
-2
@@ -4,13 +4,12 @@
4
* Copyright (C) 2005 Linus Torvalds
5
*
6
*/
7
-
7
+#define USE_THE_REPOSITORY_VARIABLE
8
#include "builtin.h"
9
#include "config.h"
10
#include "gettext.h"
11
#include "lockfile.h"
12
#include "quote.h"
13
-#include "repository.h"
13
#include "cache-tree.h"
14
#include "parse-options.h"
15
#include "entry.h"
builtin/checkout.c
+1
@@ -1,3 +1,4 @@
1
+#define USE_THE_REPOSITORY_VARIABLE
2
#include "builtin.h"
3
#include "advice.h"
4
#include "branch.h"
builtin/clean.c
+1
-2
@@ -5,7 +5,7 @@
5
*
6
* Based on git-clean.sh by Pavel Roskin
7
*/
8
-
8
+#define USE_THE_REPOSITORY_VARIABLE
9
#include "builtin.h"
10
#include "abspath.h"
11
#include "config.h"
@@ -14,7 +14,6 @@
14
#include "parse-options.h"
15
#include "path.h"
16
#include "read-cache-ll.h"
17
-#include "repository.h"
17
#include "setup.h"
18
#include "string-list.h"
19
#include "quote.h"
builtin/clone.c
+2
-1
@@ -7,8 +7,9 @@
7
*
8
* Clone a repository into a different directory that does not yet exist.
9
*/
10
-
10
+#define USE_THE_REPOSITORY_VARIABLE
11
#include "builtin.h"
12
+
13
#include "abspath.h"
14
#include "advice.h"
15
#include "config.h"
builtin/column.c
+1
@@ -1,3 +1,4 @@
1
+#define USE_THE_REPOSITORY_VARIABLE
2
#include "builtin.h"
3
#include "config.h"
4
#include "gettext.h"
builtin/commit-graph.c
+1
-1
@@ -1,3 +1,4 @@
1
+#define USE_THE_REPOSITORY_VARIABLE
2
#include "builtin.h"
3
#include "commit.h"
4
#include "config.h"
@@ -5,7 +6,6 @@
6
#include "gettext.h"
7
#include "hex.h"
8
#include "parse-options.h"
8
-#include "repository.h"
9
#include "commit-graph.h"
10
#include "object-store-ll.h"
11
#include "progress.h"
builtin/commit-tree.c
+2
-1
@@ -3,13 +3,14 @@
3
*
4
* Copyright (C) Linus Torvalds, 2005
5
*/
6
+#define USE_THE_REPOSITORY_VARIABLE
7
#include "builtin.h"
8
#include "config.h"
9
#include "gettext.h"
10
#include "hex.h"
11
#include "object-name.h"
12
#include "object-store-ll.h"
12
-#include "repository.h"
13
+
14
#include "commit.h"
15
#include "parse-options.h"
16
builtin/commit.c
+1
-1
@@ -4,7 +4,7 @@
4
* Copyright (c) 2007 Kristian Høgsberg <krh@redhat.com>
5
* Based on git-commit.sh by Junio C Hamano and Linus Torvalds
6
*/
7
-
7
+#define USE_THE_REPOSITORY_VARIABLE
8
#include "builtin.h"
9
#include "advice.h"
10
#include "config.h"
builtin/config.c
+1
-1
@@ -1,10 +1,10 @@
1
+#define USE_THE_REPOSITORY_VARIABLE
2
#include "builtin.h"
3
#include "abspath.h"
4
#include "config.h"
5
#include "color.h"
6
#include "editor.h"
7
#include "environment.h"
7
-#include "repository.h"
8
#include "gettext.h"
9
#include "ident.h"
10
#include "parse-options.h"
builtin/count-objects.c
+1
-2
@@ -3,14 +3,13 @@
3
*
4
* Copyright (c) 2006 Junio C Hamano
5
*/
6
-
6
+#define USE_THE_REPOSITORY_VARIABLE
7
#include "builtin.h"
8
#include "config.h"
9
#include "dir.h"
10
#include "environment.h"
11
#include "gettext.h"
12
#include "path.h"
13
-#include "repository.h"
13
#include "parse-options.h"
14
#include "quote.h"
15
#include "packfile.h"
builtin/credential-cache--daemon.c
+1
@@ -1,3 +1,4 @@
1
+#define USE_THE_REPOSITORY_VARIABLE
2
#include "builtin.h"
3
#include "abspath.h"
4
#include "gettext.h"
builtin/credential-cache.c
+1
@@ -1,3 +1,4 @@
1
+#define USE_THE_REPOSITORY_VARIABLE
2
#include "builtin.h"
3
#include "credential.h"
4
#include "gettext.h"
builtin/credential-store.c
+1
@@ -1,3 +1,4 @@
1
+#define USE_THE_REPOSITORY_VARIABLE
2
#include "builtin.h"
3
#include "config.h"
4
#include "gettext.h"
builtin/credential.c
+2
@@ -1,3 +1,5 @@
1
+#define USE_THE_REPOSITORY_VARIABLE
2
+
3
#include "git-compat-util.h"
4
#include "credential.h"
5
#include "builtin.h"
builtin/describe.c
+1
@@ -1,3 +1,4 @@
1
+#define USE_THE_REPOSITORY_VARIABLE
2
#include "builtin.h"
3
#include "config.h"
4
#include "environment.h"
builtin/diagnose.c
+1
@@ -1,3 +1,4 @@
1
+#define USE_THE_REPOSITORY_VARIABLE
2
#include "builtin.h"
3
#include "abspath.h"
4
#include "gettext.h"
builtin/diff-files.c
+1
-1
@@ -3,13 +3,13 @@
3
*
4
* Copyright (C) Linus Torvalds, 2005
5
*/
6
+#define USE_THE_REPOSITORY_VARIABLE
7
#include "builtin.h"
8
#include "config.h"
9
#include "diff.h"
10
#include "diff-merges.h"
11
#include "commit.h"
12
#include "preload-index.h"
12
-#include "repository.h"
13
#include "revision.h"
14
15
static const char diff_files_usage[] =
builtin/diff-index.c
+1
-1
@@ -1,10 +1,10 @@
1
+#define USE_THE_REPOSITORY_VARIABLE
2
#include "builtin.h"
3
#include "config.h"
4
#include "diff.h"
5
#include "diff-merges.h"
6
#include "commit.h"
7
#include "preload-index.h"
7
-#include "repository.h"
8
#include "revision.h"
9
#include "setup.h"
10
builtin/diff-tree.c
+1
-1
@@ -1,3 +1,4 @@
1
+#define USE_THE_REPOSITORY_VARIABLE
2
#include "builtin.h"
3
#include "config.h"
4
#include "diff.h"
@@ -6,7 +7,6 @@
7
#include "hex.h"
8
#include "log-tree.h"
9
#include "read-cache-ll.h"
9
-#include "repository.h"
10
#include "revision.h"
11
#include "tmp-objdir.h"
12
#include "tree.h"
builtin/diff.c
+1
-1
@@ -3,7 +3,7 @@
3
*
4
* Copyright (c) 2006 Junio C Hamano
5
*/
6
-
6
+#define USE_THE_REPOSITORY_VARIABLE
7
#include "builtin.h"
8
#include "config.h"
9
#include "ewah/ewok.h"
builtin/difftool.c
+2
-1
@@ -11,8 +11,9 @@
11
*
12
* Copyright (C) 2016 Johannes Schindelin
13
*/
14
-
14
+#define USE_THE_REPOSITORY_VARIABLE
15
#include "builtin.h"
16
+
17
#include "abspath.h"
18
#include "config.h"
19
#include "copy.h"
builtin/fast-export.c
+1
@@ -3,6 +3,7 @@
3
*
4
* Copyright (C) 2007 Johannes E. Schindelin
5
*/
6
+#define USE_THE_REPOSITORY_VARIABLE
7
#include "builtin.h"
8
#include "config.h"
9
#include "gettext.h"
builtin/fast-import.c
+1
-1
@@ -1,9 +1,9 @@
1
+#define USE_THE_REPOSITORY_VARIABLE
2
#include "builtin.h"
3
#include "abspath.h"
4
#include "environment.h"
5
#include "gettext.h"
6
#include "hex.h"
6
-#include "repository.h"
7
#include "config.h"
8
#include "lockfile.h"
9
#include "object.h"
builtin/fetch-pack.c
+1
@@ -1,3 +1,4 @@
1
+#define USE_THE_REPOSITORY_VARIABLE
2
#include "builtin.h"
3
#include "gettext.h"
4
#include "hex.h"
builtin/fetch.c
+1
-1
@@ -1,13 +1,13 @@
1
/*
2
* "git fetch"
3
*/
4
+#define USE_THE_REPOSITORY_VARIABLE
5
#include "builtin.h"
6
#include "advice.h"
7
#include "config.h"
8
#include "gettext.h"
9
#include "environment.h"
10
#include "hex.h"
10
-#include "repository.h"
11
#include "refs.h"
12
#include "refspec.h"
13
#include "object-name.h"
builtin/fmt-merge-msg.c
+1
@@ -1,3 +1,4 @@
1
+#define USE_THE_REPOSITORY_VARIABLE
2
#include "builtin.h"
3
#include "config.h"
4
#include "fmt-merge-msg.h"
builtin/for-each-ref.c
+1
@@ -1,3 +1,4 @@
1
+#define USE_THE_REPOSITORY_VARIABLE
2
#include "builtin.h"
3
#include "commit.h"
4
#include "config.h"
builtin/for-each-repo.c
+1
-1
@@ -1,9 +1,9 @@
1
+#define USE_THE_REPOSITORY_VARIABLE
2
#include "builtin.h"
3
#include "config.h"
4
#include "gettext.h"
5
#include "parse-options.h"
6
#include "path.h"
6
-#include "repository.h"
7
#include "run-command.h"
8
#include "string-list.h"
9
builtin/fsck.c
+1
-1
@@ -1,7 +1,7 @@
1
+#define USE_THE_REPOSITORY_VARIABLE
2
#include "builtin.h"
3
#include "gettext.h"
4
#include "hex.h"
4
-#include "repository.h"
5
#include "config.h"
6
#include "commit.h"
7
#include "tree.h"
builtin/fsmonitor--daemon.c
+2
-1
@@ -1,3 +1,4 @@
1
+#define USE_THE_REPOSITORY_VARIABLE
2
#include "builtin.h"
3
#include "abspath.h"
4
#include "config.h"
@@ -11,7 +12,7 @@
12
#include "compat/fsmonitor/fsm-health.h"
13
#include "compat/fsmonitor/fsm-listen.h"
14
#include "fsmonitor--daemon.h"
14
-#include "repository.h"
15
+
16
#include "simple-ipc.h"
17
#include "khash.h"
18
#include "run-command.h"
builtin/gc.c
+1
-2
@@ -9,13 +9,12 @@
9
*
10
* Copyright (c) 2006 Shawn O. Pearce
11
*/
12
-
12
+#define USE_THE_REPOSITORY_VARIABLE
13
#include "builtin.h"
14
#include "abspath.h"
15
#include "date.h"
16
#include "environment.h"
17
#include "hex.h"
18
-#include "repository.h"
18
#include "config.h"
19
#include "tempfile.h"
20
#include "lockfile.h"
builtin/get-tar-commit-id.c
+1
@@ -1,6 +1,7 @@
1
/*
2
* Copyright (c) 2005, 2006 Rene Scharfe
3
*/
4
+#define USE_THE_REPOSITORY_VARIABLE
5
#include "builtin.h"
6
#include "commit.h"
7
#include "tar.h"
builtin/grep.c
+1
-1
@@ -3,11 +3,11 @@
3
*
4
* Copyright (c) 2006 Junio C Hamano
5
*/
6
+#define USE_THE_REPOSITORY_VARIABLE
7
#include "builtin.h"
8
#include "abspath.h"
9
#include "gettext.h"
10
#include "hex.h"
10
-#include "repository.h"
11
#include "config.h"
12
#include "tag.h"
13
#include "tree-walk.h"
builtin/hash-object.c
+1
@@ -4,6 +4,7 @@
4
* Copyright (C) Linus Torvalds, 2005
5
* Copyright (C) Junio C Hamano, 2005
6
*/
7
+#define USE_THE_REPOSITORY_VARIABLE
8
#include "builtin.h"
9
#include "abspath.h"
10
#include "config.h"
builtin/help.c
+2
@@ -1,6 +1,8 @@
1
+
2
/*
3
* Builtin help command
4
*/
5
+#define USE_THE_REPOSITORY_VARIABLE
6
#include "builtin.h"
7
#include "config.h"
8
#include "exec-cmd.h"
builtin/hook.c
+1
@@ -1,3 +1,4 @@
1
+#define USE_THE_REPOSITORY_VARIABLE
2
#include "builtin.h"
3
#include "config.h"
4
#include "gettext.h"
builtin/index-pack.c
+1
@@ -1,3 +1,4 @@
1
+#define USE_THE_REPOSITORY_VARIABLE
2
#include "builtin.h"
3
#include "config.h"
4
#include "delta.h"
builtin/init-db.c
+1
-1
@@ -3,6 +3,7 @@
3
*
4
* Copyright (C) Linus Torvalds, 2005
5
*/
6
+#define USE_THE_REPOSITORY_VARIABLE
7
#include "builtin.h"
8
#include "abspath.h"
9
#include "environment.h"
@@ -11,7 +12,6 @@
12
#include "parse-options.h"
13
#include "path.h"
14
#include "refs.h"
14
-#include "repository.h"
15
#include "setup.h"
16
#include "strbuf.h"
17
builtin/interpret-trailers.c
+1
-1
@@ -4,7 +4,7 @@
4
* Copyright (c) 2013, 2014 Christian Couder <chriscool@tuxfamily.org>
5
*
6
*/
7
-
7
+#define USE_THE_REPOSITORY_VARIABLE
8
#include "builtin.h"
9
#include "gettext.h"
10
#include "parse-options.h"
builtin/log.c
+2
-1
@@ -4,6 +4,7 @@
4
* (C) Copyright 2006 Linus Torvalds
5
* 2006 Junio Hamano
6
*/
7
+#define USE_THE_REPOSITORY_VARIABLE
8
#include "builtin.h"
9
#include "abspath.h"
10
#include "config.h"
@@ -37,7 +38,7 @@
38
#include "mailmap.h"
39
#include "progress.h"
40
#include "commit-slab.h"
40
-#include "repository.h"
41
+
42
#include "commit-reach.h"
43
#include "range-diff.h"
44
#include "tmp-objdir.h"
builtin/ls-files.c
+1
-1
@@ -5,8 +5,8 @@
5
*
6
* Copyright (C) Linus Torvalds, 2005
7
*/
8
+#define USE_THE_REPOSITORY_VARIABLE
9
#include "builtin.h"
9
-#include "repository.h"
10
#include "config.h"
11
#include "convert.h"
12
#include "quote.h"
builtin/ls-remote.c
+1
@@ -1,3 +1,4 @@
1
+#define USE_THE_REPOSITORY_VARIABLE
2
#include "builtin.h"
3
#include "gettext.h"
4
#include "hex.h"
builtin/ls-tree.c
+2
@@ -3,7 +3,9 @@
3
*
4
* Copyright (C) Linus Torvalds, 2005
5
*/
6
+#define USE_THE_REPOSITORY_VARIABLE
7
#include "builtin.h"
8
+
9
#include "config.h"
10
#include "gettext.h"
11
#include "hex.h"
builtin/mailinfo.c
+1
@@ -2,6 +2,7 @@
2
* Another stupid program, this one parsing the headers of an
3
* email to figure out authorship and subject
4
*/
5
+#define USE_THE_REPOSITORY_VARIABLE
6
#include "builtin.h"
7
#include "abspath.h"
8
#include "environment.h"
builtin/mailsplit.c
+1
@@ -4,6 +4,7 @@
4
* It just splits a mbox into a list of files: "0001" "0002" ..
5
* so you can process them further from there.
6
*/
7
+#define USE_THE_REPOSITORY_VARIABLE
8
#include "builtin.h"
9
#include "gettext.h"
10
#include "string-list.h"
builtin/merge-base.c
+1
-1
@@ -1,3 +1,4 @@
1
+#define USE_THE_REPOSITORY_VARIABLE
2
#include "builtin.h"
3
#include "config.h"
4
#include "commit.h"
@@ -5,7 +6,6 @@
6
#include "hex.h"
7
#include "object-name.h"
8
#include "parse-options.h"
8
-#include "repository.h"
9
#include "commit-reach.h"
10
11
static int show_merge_base(struct commit **rev, int rev_nr, int show_all)
builtin/merge-file.c
+1
@@ -1,3 +1,4 @@
1
+#define USE_THE_REPOSITORY_VARIABLE
2
#include "builtin.h"
3
#include "abspath.h"
4
#include "diff.h"
builtin/merge-index.c
+1
-1
@@ -1,7 +1,7 @@
1
+#define USE_THE_REPOSITORY_VARIABLE
2
#include "builtin.h"
3
#include "hex.h"
4
#include "read-cache-ll.h"
4
-#include "repository.h"
5
#include "run-command.h"
6
#include "sparse-index.h"
7
builtin/merge-ours.c
+2
-1
@@ -7,10 +7,11 @@
7
*
8
* Pretend we resolved the heads, but declare our tree trumps everybody else.
9
*/
10
+#define USE_THE_REPOSITORY_VARIABLE
11
#include "git-compat-util.h"
12
#include "builtin.h"
13
#include "diff.h"
13
-#include "repository.h"
14
+
15
16
static const char builtin_merge_ours_usage[] =
17
"git merge-ours <base>... -- HEAD <remote>...";
builtin/merge-recursive.c
+1
-1
@@ -1,10 +1,10 @@
1
+#define USE_THE_REPOSITORY_VARIABLE
2
#include "builtin.h"
3
#include "advice.h"
4
#include "gettext.h"
5
#include "hash.h"
6
#include "merge-recursive.h"
7
#include "object-name.h"
7
-#include "repository.h"
8
9
static const char builtin_merge_recursive_usage[] =
10
"git %s <base>... -- <head> <remote> ...";
builtin/merge-tree.c
+1
-1
@@ -1,3 +1,4 @@
1
+#define USE_THE_REPOSITORY_VARIABLE
2
#include "builtin.h"
3
#include "tree-walk.h"
4
#include "xdiff-interface.h"
@@ -10,7 +11,6 @@
11
#include "object-name.h"
12
#include "object-store-ll.h"
13
#include "parse-options.h"
13
-#include "repository.h"
14
#include "blob.h"
15
#include "merge-blobs.h"
16
#include "quote.h"
builtin/merge.c
+2
-1
@@ -5,8 +5,9 @@
5
*
6
* Based on git-merge.sh by Junio C Hamano.
7
*/
8
-
8
+#define USE_THE_REPOSITORY_VARIABLE
9
#include "builtin.h"
10
+
11
#include "abspath.h"
12
#include "advice.h"
13
#include "config.h"
builtin/mktag.c
+1
@@ -1,3 +1,4 @@
1
+#define USE_THE_REPOSITORY_VARIABLE
2
#include "builtin.h"
3
#include "gettext.h"
4
#include "hex.h"
builtin/mktree.c
+1
@@ -3,6 +3,7 @@
3
*
4
* Copyright (c) Junio C Hamano, 2006, 2009
5
*/
6
+#define USE_THE_REPOSITORY_VARIABLE
7
#include "builtin.h"
8
#include "gettext.h"
9
#include "hex.h"
builtin/multi-pack-index.c
+1
@@ -1,3 +1,4 @@
1
+#define USE_THE_REPOSITORY_VARIABLE
2
#include "builtin.h"
3
#include "abspath.h"
4
#include "config.h"
builtin/mv.c
+2
-1
@@ -3,6 +3,7 @@
3
*
4
* Copyright (C) 2006 Johannes Schindelin
5
*/
6
+#define USE_THE_REPOSITORY_VARIABLE
7
8
#include "builtin.h"
9
#include "abspath.h"
@@ -18,7 +19,7 @@
19
#include "string-list.h"
20
#include "parse-options.h"
21
#include "read-cache-ll.h"
21
-#include "repository.h"
22
+
23
#include "setup.h"
24
#include "strvec.h"
25
#include "submodule.h"
builtin/name-rev.c
+1
-1
@@ -1,8 +1,8 @@
1
+#define USE_THE_REPOSITORY_VARIABLE
2
#include "builtin.h"
3
#include "environment.h"
4
#include "gettext.h"
5
#include "hex.h"
5
-#include "repository.h"
6
#include "config.h"
7
#include "commit.h"
8
#include "tag.h"
builtin/notes.c
+2
-2
@@ -6,7 +6,7 @@
6
* Based on git-notes.sh by Johannes Schindelin,
7
* and builtin/tag.c by Kristian Høgsberg and Carlos Rica.
8
*/
9
-
9
+#define USE_THE_REPOSITORY_VARIABLE
10
#include "builtin.h"
11
#include "config.h"
12
#include "editor.h"
@@ -17,7 +17,7 @@
17
#include "object-name.h"
18
#include "object-store-ll.h"
19
#include "path.h"
20
-#include "repository.h"
20
+
21
#include "pretty.h"
22
#include "refs.h"
23
#include "exec-cmd.h"
builtin/pack-objects.c
+1
-1
@@ -1,8 +1,8 @@
1
+#define USE_THE_REPOSITORY_VARIABLE
2
#include "builtin.h"
3
#include "environment.h"
4
#include "gettext.h"
5
#include "hex.h"
5
-#include "repository.h"
6
#include "config.h"
7
#include "attr.h"
8
#include "object.h"
builtin/pack-redundant.c
+2
-1
@@ -5,11 +5,12 @@
5
* This file is licensed under the GPL v2.
6
*
7
*/
8
+#define USE_THE_REPOSITORY_VARIABLE
9
10
#include "builtin.h"
11
#include "gettext.h"
12
#include "hex.h"
12
-#include "repository.h"
13
+
14
#include "packfile.h"
15
#include "object-store-ll.h"
16
builtin/pack-refs.c
+1
-1
@@ -1,9 +1,9 @@
1
+#define USE_THE_REPOSITORY_VARIABLE
2
#include "builtin.h"
3
#include "config.h"
4
#include "gettext.h"
5
#include "parse-options.h"
6
#include "refs.h"
6
-#include "repository.h"
7
#include "revision.h"
8
9
static char const * const pack_refs_usage[] = {
builtin/patch-id.c
+1
@@ -1,3 +1,4 @@
1
+#define USE_THE_REPOSITORY_VARIABLE
2
#include "builtin.h"
3
#include "config.h"
4
#include "diff.h"
builtin/prune-packed.c
+1
@@ -1,3 +1,4 @@
1
+#define USE_THE_REPOSITORY_VARIABLE
2
#include "builtin.h"
3
#include "gettext.h"
4
#include "parse-options.h"
builtin/prune.c
+1
@@ -1,3 +1,4 @@
1
+#define USE_THE_REPOSITORY_VARIABLE
2
#include "builtin.h"
3
#include "commit.h"
4
#include "diff.h"
builtin/pull.c
+1
@@ -6,6 +6,7 @@
6
* Fetch one or more remote refs and merge it/them into the current HEAD.
7
*/
8
9
+#define USE_THE_REPOSITORY_VARIABLE
10
#include "builtin.h"
11
#include "advice.h"
12
#include "config.h"
builtin/push.c
+1
-1
@@ -1,6 +1,7 @@
1
/*
2
* "git push"
3
*/
4
+#define USE_THE_REPOSITORY_VARIABLE
5
#include "builtin.h"
6
#include "advice.h"
7
#include "branch.h"
@@ -13,7 +14,6 @@
14
#include "transport.h"
15
#include "parse-options.h"
16
#include "pkt-line.h"
16
-#include "repository.h"
17
#include "submodule.h"
18
#include "submodule-config.h"
19
#include "send-pack.h"
builtin/range-diff.c
+2
-1
@@ -1,10 +1,11 @@
1
+#define USE_THE_REPOSITORY_VARIABLE
2
#include "builtin.h"
3
#include "gettext.h"
4
#include "object-name.h"
5
#include "parse-options.h"
6
#include "range-diff.h"
7
#include "config.h"
7
-#include "repository.h"
8
+
9
10
static const char * const builtin_range_diff_usage[] = {
11
N_("git range-diff [<options>] <old-base>..<old-tip> <new-base>..<new-tip>"),
builtin/read-tree.c
+1
-2
@@ -3,7 +3,7 @@
3
*
4
* Copyright (C) Linus Torvalds, 2005
5
*/
6
-
6
+#define USE_THE_REPOSITORY_VARIABLE
7
#include "builtin.h"
8
#include "config.h"
9
#include "gettext.h"
@@ -16,7 +16,6 @@
16
#include "cache-tree.h"
17
#include "unpack-trees.h"
18
#include "parse-options.h"
19
-#include "repository.h"
19
#include "resolve-undo.h"
20
#include "setup.h"
21
#include "sparse-index.h"
builtin/rebase.c
+2
-1
@@ -3,8 +3,9 @@
3
*
4
* Copyright (c) 2018 Pratik Karki
5
*/
6
-
6
+#define USE_THE_REPOSITORY_VARIABLE
7
#include "builtin.h"
8
+
9
#include "abspath.h"
10
#include "environment.h"
11
#include "gettext.h"
builtin/receive-pack.c
+2
-1
@@ -1,6 +1,7 @@
1
+#define USE_THE_REPOSITORY_VARIABLE
2
#include "builtin.h"
3
#include "abspath.h"
3
-#include "repository.h"
4
+
5
#include "config.h"
6
#include "environment.h"
7
#include "gettext.h"
builtin/reflog.c
+1
-1
@@ -1,7 +1,7 @@
1
+#define USE_THE_REPOSITORY_VARIABLE
2
#include "builtin.h"
3
#include "config.h"
4
#include "gettext.h"
4
-#include "repository.h"
5
#include "revision.h"
6
#include "reachable.h"
7
#include "wildmatch.h"
builtin/refs.c
+1
-1
@@ -1,9 +1,9 @@
1
+#define USE_THE_REPOSITORY_VARIABLE
2
#include "builtin.h"
3
#include "config.h"
4
#include "fsck.h"
5
#include "parse-options.h"
6
#include "refs.h"
6
-#include "repository.h"
7
#include "strbuf.h"
8
9
#define REFS_MIGRATE_USAGE \
builtin/remote-ext.c
+1
@@ -1,3 +1,4 @@
1
+#define USE_THE_REPOSITORY_VARIABLE
2
#include "builtin.h"
3
#include "transport.h"
4
#include "run-command.h"
builtin/remote-fd.c
+1
@@ -1,3 +1,4 @@
1
+#define USE_THE_REPOSITORY_VARIABLE
2
#include "builtin.h"
3
#include "transport.h"
4
builtin/remote.c
+1
@@ -1,3 +1,4 @@
1
+#define USE_THE_REPOSITORY_VARIABLE
2
#include "builtin.h"
3
#include "config.h"
4
#include "gettext.h"
builtin/repack.c
+1
@@ -1,3 +1,4 @@
1
+#define USE_THE_REPOSITORY_VARIABLE
2
#include "builtin.h"
3
#include "config.h"
4
#include "dir.h"
builtin/replace.c
+1
-2
@@ -7,7 +7,7 @@
7
* and Carlos Rica <jasampler@gmail.com> that was itself based on
8
* git-tag.sh and mktag.c by Linus Torvalds.
9
*/
10
-
10
+#define USE_THE_REPOSITORY_VARIABLE
11
#include "builtin.h"
12
#include "config.h"
13
#include "editor.h"
@@ -22,7 +22,6 @@
22
#include "object-name.h"
23
#include "object-store-ll.h"
24
#include "replace-object.h"
25
-#include "repository.h"
25
#include "tag.h"
26
#include "wildmatch.h"
27
builtin/replay.c
+1
@@ -4,6 +4,7 @@
4
5
#include "git-compat-util.h"
6
7
+#define USE_THE_REPOSITORY_VARIABLE
8
#include "builtin.h"
9
#include "environment.h"
10
#include "hex.h"
builtin/rerere.c
+2
-1
@@ -1,8 +1,9 @@
1
+#define USE_THE_REPOSITORY_VARIABLE
2
#include "builtin.h"
3
#include "config.h"
4
#include "gettext.h"
5
#include "parse-options.h"
5
-#include "repository.h"
6
+
7
#include "string-list.h"
8
#include "rerere.h"
9
#include "xdiff/xdiff.h"
builtin/reset.c
+1
-1
@@ -7,7 +7,7 @@
7
*
8
* Copyright (c) 2005, 2006 Linus Torvalds and Junio C Hamano
9
*/
10
-
10
+#define USE_THE_REPOSITORY_VARIABLE
11
#include "builtin.h"
12
#include "advice.h"
13
#include "config.h"
builtin/rev-list.c
+1
@@ -1,3 +1,4 @@
1
+#define USE_THE_REPOSITORY_VARIABLE
2
#include "builtin.h"
3
#include "config.h"
4
#include "commit.h"
builtin/rev-parse.c
+2
-1
@@ -3,8 +3,9 @@
3
*
4
* Copyright (C) Linus Torvalds, 2005
5
*/
6
-
6
+#define USE_THE_REPOSITORY_VARIABLE
7
#include "builtin.h"
8
+
9
#include "abspath.h"
10
#include "config.h"
11
#include "commit.h"
builtin/revert.c
+1
-1
@@ -1,9 +1,9 @@
1
+#define USE_THE_REPOSITORY_VARIABLE
2
#include "git-compat-util.h"
3
#include "builtin.h"
4
#include "parse-options.h"
5
#include "diff.h"
6
#include "gettext.h"
6
-#include "repository.h"
7
#include "revision.h"
8
#include "rerere.h"
9
#include "sequencer.h"
builtin/rm.c
+2
-2
@@ -3,7 +3,7 @@
3
*
4
* Copyright (C) Linus Torvalds 2006
5
*/
6
-
6
+#define USE_THE_REPOSITORY_VARIABLE
7
#include "builtin.h"
8
#include "advice.h"
9
#include "config.h"
@@ -15,7 +15,7 @@
15
#include "object-name.h"
16
#include "parse-options.h"
17
#include "read-cache.h"
18
-#include "repository.h"
18
+
19
#include "string-list.h"
20
#include "setup.h"
21
#include "sparse-index.h"
builtin/send-pack.c
+1
@@ -1,3 +1,4 @@
1
+#define USE_THE_REPOSITORY_VARIABLE
2
#include "builtin.h"
3
#include "config.h"
4
#include "hex.h"
builtin/shortlog.c
+1
-1
@@ -1,3 +1,4 @@
1
+#define USE_THE_REPOSITORY_VARIABLE
2
#include "builtin.h"
3
#include "config.h"
4
#include "commit.h"
@@ -5,7 +6,6 @@
6
#include "environment.h"
7
#include "gettext.h"
8
#include "string-list.h"
8
-#include "repository.h"
9
#include "revision.h"
10
#include "utf8.h"
11
#include "mailmap.h"
builtin/show-branch.c
+2
-1
@@ -1,3 +1,4 @@
1
+#define USE_THE_REPOSITORY_VARIABLE
2
#include "builtin.h"
3
#include "config.h"
4
#include "environment.h"
@@ -10,7 +11,7 @@
11
#include "strvec.h"
12
#include "object-name.h"
13
#include "parse-options.h"
13
-#include "repository.h"
14
+
15
#include "dir.h"
16
#include "commit-slab.h"
17
#include "date.h"
builtin/show-index.c
+1
-1
@@ -1,10 +1,10 @@
1
+#define USE_THE_REPOSITORY_VARIABLE
2
#include "builtin.h"
3
#include "gettext.h"
4
#include "hash.h"
5
#include "hex.h"
6
#include "pack.h"
7
#include "parse-options.h"
7
-#include "repository.h"
8
9
static const char *const show_index_usage[] = {
10
"git show-index [--object-format=<hash-algorithm>]",
builtin/show-ref.c
+1
@@ -1,3 +1,4 @@
1
+#define USE_THE_REPOSITORY_VARIABLE
2
#include "builtin.h"
3
#include "config.h"
4
#include "gettext.h"
builtin/sparse-checkout.c
+1
-1
@@ -1,3 +1,4 @@
1
+#define USE_THE_REPOSITORY_VARIABLE
2
#include "builtin.h"
3
#include "config.h"
4
#include "dir.h"
@@ -7,7 +8,6 @@
8
#include "object-name.h"
9
#include "parse-options.h"
10
#include "pathspec.h"
10
-#include "repository.h"
11
#include "strbuf.h"
12
#include "string-list.h"
13
#include "lockfile.h"
builtin/stash.c
+1
@@ -1,3 +1,4 @@
1
+#define USE_THE_REPOSITORY_VARIABLE
2
#include "builtin.h"
3
#include "abspath.h"
4
#include "config.h"
builtin/stripspace.c
+1
@@ -1,3 +1,4 @@
1
+#define USE_THE_REPOSITORY_VARIABLE
2
#include "builtin.h"
3
#include "config.h"
4
#include "environment.h"
builtin/submodule--helper.c
+2
-1
@@ -1,9 +1,10 @@
1
+#define USE_THE_REPOSITORY_VARIABLE
2
#include "builtin.h"
3
#include "abspath.h"
4
#include "environment.h"
5
#include "gettext.h"
6
#include "hex.h"
6
-#include "repository.h"
7
+
8
#include "config.h"
9
#include "parse-options.h"
10
#include "quote.h"
builtin/symbolic-ref.c
+1
@@ -1,3 +1,4 @@
1
+#define USE_THE_REPOSITORY_VARIABLE
2
#include "builtin.h"
3
#include "config.h"
4
#include "gettext.h"
builtin/tag.c
+1
-1
@@ -5,7 +5,7 @@
5
* Carlos Rica <jasampler@gmail.com>
6
* Based on git-tag.sh and mktag.c by Linus Torvalds.
7
*/
8
-
8
+#define USE_THE_REPOSITORY_VARIABLE
9
#include "builtin.h"
10
#include "advice.h"
11
#include "config.h"
builtin/unpack-file.c
+1
@@ -1,3 +1,4 @@
1
+#define USE_THE_REPOSITORY_VARIABLE
2
#include "builtin.h"
3
#include "config.h"
4
#include "hex.h"
builtin/unpack-objects.c
+1
@@ -1,3 +1,4 @@
1
+#define USE_THE_REPOSITORY_VARIABLE
2
#include "builtin.h"
3
#include "bulk-checkin.h"
4
#include "config.h"
builtin/update-index.c
+1
-2
@@ -3,7 +3,7 @@
3
*
4
* Copyright (C) Linus Torvalds, 2005
5
*/
6
-
6
+#define USE_THE_REPOSITORY_VARIABLE
7
#include "builtin.h"
8
#include "bulk-checkin.h"
9
#include "config.h"
@@ -22,7 +22,6 @@
22
#include "pathspec.h"
23
#include "dir.h"
24
#include "read-cache.h"
25
-#include "repository.h"
25
#include "setup.h"
26
#include "sparse-index.h"
27
#include "split-index.h"
builtin/update-ref.c
+1
-1
@@ -1,3 +1,4 @@
1
+#define USE_THE_REPOSITORY_VARIABLE
2
#include "builtin.h"
3
#include "config.h"
4
#include "gettext.h"
@@ -6,7 +7,6 @@
7
#include "object-name.h"
8
#include "parse-options.h"
9
#include "quote.h"
9
-#include "repository.h"
10
11
static const char * const git_update_ref_usage[] = {
12
N_("git update-ref [<options>] -d <refname> [<old-oid>]"),
builtin/update-server-info.c
+1
@@ -1,3 +1,4 @@
1
+#define USE_THE_REPOSITORY_VARIABLE
2
#include "builtin.h"
3
#include "config.h"
4
#include "gettext.h"
builtin/upload-archive.c
+1
-1
@@ -1,12 +1,12 @@
1
/*
2
* Copyright (c) 2006 Franck Bui-Huu
3
*/
4
+#define USE_THE_REPOSITORY_VARIABLE
5
#include "builtin.h"
6
#include "archive.h"
7
#include "path.h"
8
#include "pkt-line.h"
9
#include "sideband.h"
9
-#include "repository.h"
10
#include "run-command.h"
11
#include "strvec.h"
12
builtin/upload-pack.c
+1
@@ -1,3 +1,4 @@
1
+#define USE_THE_REPOSITORY_VARIABLE
2
#include "builtin.h"
3
#include "exec-cmd.h"
4
#include "gettext.h"
builtin/var.c
+2
@@ -3,7 +3,9 @@
3
*
4
* Copyright (C) Eric Biederman, 2005
5
*/
6
+#define USE_THE_REPOSITORY_VARIABLE
7
#include "builtin.h"
8
+
9
#include "attr.h"
10
#include "config.h"
11
#include "editor.h"
builtin/verify-commit.c
+1
-1
@@ -5,11 +5,11 @@
5
*
6
* Based on git-verify-tag
7
*/
8
+#define USE_THE_REPOSITORY_VARIABLE
9
#include "builtin.h"
10
#include "config.h"
11
#include "gettext.h"
12
#include "object-name.h"
12
-#include "repository.h"
13
#include "commit.h"
14
#include "parse-options.h"
15
#include "gpg-interface.h"
builtin/verify-pack.c
+1
@@ -1,3 +1,4 @@
1
+#define USE_THE_REPOSITORY_VARIABLE
2
#include "builtin.h"
3
#include "config.h"
4
#include "gettext.h"
builtin/verify-tag.c
+1
@@ -5,6 +5,7 @@
5
*
6
* Based on git-verify-tag.sh
7
*/
8
+#define USE_THE_REPOSITORY_VARIABLE
9
#include "builtin.h"
10
#include "config.h"
11
#include "gettext.h"
builtin/worktree.c
+1
-1
@@ -1,3 +1,4 @@
1
+#define USE_THE_REPOSITORY_VARIABLE
2
#include "builtin.h"
3
#include "abspath.h"
4
#include "advice.h"
@@ -17,7 +18,6 @@
18
#include "read-cache-ll.h"
19
#include "refs.h"
20
#include "remote.h"
20
-#include "repository.h"
21
#include "run-command.h"
22
#include "hook.h"
23
#include "sigchain.h"
builtin/write-tree.c
+1
-2
@@ -3,7 +3,7 @@
3
*
4
* Copyright (C) Linus Torvalds, 2005
5
*/
6
-
6
+#define USE_THE_REPOSITORY_VARIABLE
7
#include "builtin.h"
8
#include "config.h"
9
#include "environment.h"
@@ -12,7 +12,6 @@
12
#include "tree.h"
13
#include "cache-tree.h"
14
#include "parse-options.h"
15
-#include "repository.h"
15
16
static const char * const write_tree_usage[] = {
17
N_("git write-tree [--missing-ok] [--prefix=<prefix>/]"),