Skip to content

Commit eea0e59

Browse files
newrengitster
authored andcommitted
treewide: remove unnecessary includes in source files
Each of these were checked with gcc -E -I. ${SOURCE_FILE} | grep ${HEADER_FILE} to ensure that removing the direct inclusion of the header actually resulted in that header no longer being included at all (i.e. that no other header pulled it in transitively). ...except for a few cases where we verified that although the header was brought in transitively, nothing from it was directly used in that source file. These cases were: * builtin/credential-cache.c * builtin/pull.c * builtin/send-pack.c Signed-off-by: Elijah Newren <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 147438e commit eea0e59

File tree

158 files changed

+0
-293
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

158 files changed

+0
-293
lines changed

Diff for: add-patch.c

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#include "strvec.h"
1313
#include "pathspec.h"
1414
#include "color.h"
15-
#include "diff.h"
1615
#include "compat/terminal.h"
1716
#include "prompt.h"
1817

Diff for: apply.c

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#include "base85.h"
1313
#include "config.h"
1414
#include "object-store-ll.h"
15-
#include "blob.h"
1615
#include "delta.h"
1716
#include "diff.h"
1817
#include "dir.h"

Diff for: archive.c

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
#include "archive.h"
1818
#include "parse-options.h"
1919
#include "unpack-trees.h"
20-
#include "dir.h"
2120
#include "quote.h"
2221

2322
static char const * const archive_usage[] = {

Diff for: bisect.c

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#include "refs.h"
1010
#include "list-objects.h"
1111
#include "quote.h"
12-
#include "hash-lookup.h"
1312
#include "run-command.h"
1413
#include "log-tree.h"
1514
#include "bisect.h"

Diff for: blob.c

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#include "git-compat-util.h"
22
#include "blob.h"
3-
#include "repository.h"
43
#include "alloc.h"
54

65
const char *blob_type = "blob";

Diff for: bloom.c

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#include "bloom.h"
33
#include "diff.h"
44
#include "diffcore.h"
5-
#include "revision.h"
65
#include "hashmap.h"
76
#include "commit-graph.h"
87
#include "commit.h"

Diff for: builtin/add.c

-3
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,11 @@
1212
#include "dir.h"
1313
#include "gettext.h"
1414
#include "pathspec.h"
15-
#include "exec-cmd.h"
16-
#include "cache-tree.h"
1715
#include "run-command.h"
1816
#include "parse-options.h"
1917
#include "path.h"
2018
#include "preload-index.h"
2119
#include "diff.h"
22-
#include "diffcore.h"
2320
#include "read-cache.h"
2421
#include "repository.h"
2522
#include "revision.h"

Diff for: builtin/am.c

-4
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#include "config.h"
1111
#include "editor.h"
1212
#include "environment.h"
13-
#include "exec-cmd.h"
1413
#include "gettext.h"
1514
#include "hex.h"
1615
#include "parse-options.h"
@@ -24,7 +23,6 @@
2423
#include "refs.h"
2524
#include "commit.h"
2625
#include "diff.h"
27-
#include "diffcore.h"
2826
#include "unpack-trees.h"
2927
#include "branch.h"
3028
#include "object-name.h"
@@ -35,11 +33,9 @@
3533
#include "log-tree.h"
3634
#include "notes-utils.h"
3735
#include "rerere.h"
38-
#include "prompt.h"
3936
#include "mailinfo.h"
4037
#include "apply.h"
4138
#include "string-list.h"
42-
#include "packfile.h"
4339
#include "pager.h"
4440
#include "path.h"
4541
#include "repository.h"

Diff for: builtin/apply.c

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#include "builtin.h"
22
#include "gettext.h"
3-
#include "parse-options.h"
43
#include "repository.h"
54
#include "apply.h"
65

Diff for: builtin/bisect.c

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
#include "parse-options.h"
88
#include "bisect.h"
99
#include "refs.h"
10-
#include "dir.h"
1110
#include "strvec.h"
1211
#include "run-command.h"
1312
#include "oid-array.h"

Diff for: builtin/blame.c

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
#include "userdiff.h"
2626
#include "line-range.h"
2727
#include "line-log.h"
28-
#include "dir.h"
2928
#include "progress.h"
3029
#include "object-name.h"
3130
#include "object-store-ll.h"

Diff for: builtin/branch.c

-3
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,10 @@
1717
#include "remote.h"
1818
#include "parse-options.h"
1919
#include "branch.h"
20-
#include "diff.h"
2120
#include "path.h"
22-
#include "revision.h"
2321
#include "string-list.h"
2422
#include "column.h"
2523
#include "utf8.h"
26-
#include "wt-status.h"
2724
#include "ref-filter.h"
2825
#include "worktree.h"
2926
#include "help.h"

Diff for: builtin/cat-file.c

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#include "parse-options.h"
1616
#include "userdiff.h"
1717
#include "streaming.h"
18-
#include "tree-walk.h"
1918
#include "oid-array.h"
2019
#include "packfile.h"
2120
#include "object-file.h"

Diff for: builtin/checkout-index.c

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
#define USE_THE_INDEX_VARIABLE
88
#include "builtin.h"
99
#include "config.h"
10-
#include "dir.h"
1110
#include "gettext.h"
1211
#include "lockfile.h"
1312
#include "quote.h"

Diff for: builtin/checkout.c

-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#define USE_THE_INDEX_VARIABLE
22
#include "builtin.h"
33
#include "advice.h"
4-
#include "blob.h"
54
#include "branch.h"
65
#include "cache-tree.h"
76
#include "checkout.h"
@@ -27,10 +26,8 @@
2726
#include "remote.h"
2827
#include "resolve-undo.h"
2928
#include "revision.h"
30-
#include "run-command.h"
3129
#include "setup.h"
3230
#include "submodule.h"
33-
#include "submodule-config.h"
3431
#include "symlinks.h"
3532
#include "trace2.h"
3633
#include "tree.h"

Diff for: builtin/clone.c

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#include "hex.h"
2020
#include "lockfile.h"
2121
#include "parse-options.h"
22-
#include "fetch-pack.h"
2322
#include "refs.h"
2423
#include "refspec.h"
2524
#include "object-file.h"

Diff for: builtin/commit-graph.c

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#include "builtin.h"
22
#include "commit.h"
33
#include "config.h"
4-
#include "dir.h"
54
#include "environment.h"
65
#include "gettext.h"
76
#include "hex.h"

Diff for: builtin/commit-tree.c

-3
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@
1111
#include "object-store-ll.h"
1212
#include "repository.h"
1313
#include "commit.h"
14-
#include "tree.h"
15-
#include "utf8.h"
16-
#include "gpg-interface.h"
1714
#include "parse-options.h"
1815

1916
static const char * const commit_tree_usage[] = {

Diff for: builtin/commit.c

-8
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,12 @@
1616
#include "editor.h"
1717
#include "environment.h"
1818
#include "diff.h"
19-
#include "diffcore.h"
2019
#include "commit.h"
2120
#include "gettext.h"
2221
#include "revision.h"
2322
#include "wt-status.h"
2423
#include "run-command.h"
25-
#include "hook.h"
26-
#include "refs.h"
27-
#include "log-tree.h"
2824
#include "strbuf.h"
29-
#include "utf8.h"
3025
#include "object-name.h"
3126
#include "parse-options.h"
3227
#include "path.h"
@@ -35,9 +30,6 @@
3530
#include "string-list.h"
3631
#include "rerere.h"
3732
#include "unpack-trees.h"
38-
#include "quote.h"
39-
#include "submodule.h"
40-
#include "gpg-interface.h"
4133
#include "column.h"
4234
#include "sequencer.h"
4335
#include "sparse-index.h"

Diff for: builtin/credential-cache.c

-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77

88
#ifndef NO_UNIX_SOCKETS
99

10-
#include "credential.h"
11-
#include "string-list.h"
1210
#include "unix-socket.h"
1311
#include "run-command.h"
1412

Diff for: builtin/describe.c

-2
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@
77
#include "lockfile.h"
88
#include "commit.h"
99
#include "tag.h"
10-
#include "blob.h"
1110
#include "refs.h"
12-
#include "exec-cmd.h"
1311
#include "object-name.h"
1412
#include "parse-options.h"
1513
#include "read-cache-ll.h"

Diff for: builtin/diff-files.c

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#include "preload-index.h"
1212
#include "repository.h"
1313
#include "revision.h"
14-
#include "submodule.h"
1514

1615
static const char diff_files_usage[] =
1716
"git diff-files [-q] [-0 | -1 | -2 | -3 | -c | --cc] [<common-diff-options>] [<path>...]"

Diff for: builtin/diff-index.c

-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
#include "repository.h"
88
#include "revision.h"
99
#include "setup.h"
10-
#include "sparse-index.h"
11-
#include "submodule.h"
1210

1311
static const char diff_cache_usage[] =
1412
"git diff-index [-m] [--cached] [--merge-base] "

Diff for: builtin/diff-tree.c

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
#include "gettext.h"
77
#include "hex.h"
88
#include "log-tree.h"
9-
#include "submodule.h"
109
#include "read-cache-ll.h"
1110
#include "repository.h"
1211
#include "revision.h"

Diff for: builtin/diff.c

-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#include "lockfile.h"
1111
#include "color.h"
1212
#include "commit.h"
13-
#include "blob.h"
1413
#include "gettext.h"
1514
#include "tag.h"
1615
#include "diff.h"
@@ -21,7 +20,6 @@
2120
#include "revision.h"
2221
#include "log-tree.h"
2322
#include "setup.h"
24-
#include "submodule.h"
2523
#include "oid-array.h"
2624
#include "tree.h"
2725

Diff for: builtin/difftool.c

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
#include "copy.h"
1919
#include "run-command.h"
2020
#include "environment.h"
21-
#include "exec-cmd.h"
2221
#include "gettext.h"
2322
#include "hex.h"
2423
#include "parse-options.h"

Diff for: builtin/fast-export.c

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
#include "quote.h"
2626
#include "remote.h"
2727
#include "blob.h"
28-
#include "commit-slab.h"
2928

3029
static const char *fast_export_usage[] = {
3130
N_("git fast-export [<rev-list-opts>]"),

Diff for: builtin/fetch.c

-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
#include "connected.h"
2727
#include "strvec.h"
2828
#include "utf8.h"
29-
#include "packfile.h"
3029
#include "pager.h"
3130
#include "path.h"
3231
#include "pkt-line.h"
@@ -38,7 +37,6 @@
3837
#include "shallow.h"
3938
#include "trace.h"
4039
#include "trace2.h"
41-
#include "worktree.h"
4240
#include "bundle-uri.h"
4341

4442
#define FORCED_UPDATES_DELAY_WARNING_IN_MS (10 * 1000)

Diff for: builtin/for-each-ref.c

-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
#include "builtin.h"
22
#include "config.h"
33
#include "gettext.h"
4-
#include "refs.h"
54
#include "object.h"
65
#include "parse-options.h"
76
#include "ref-filter.h"
87
#include "strbuf.h"
98
#include "strvec.h"
10-
#include "commit-reach.h"
119

1210
static char const * const for_each_ref_usage[] = {
1311
N_("git for-each-ref [<options>] [<pattern>]"),

Diff for: builtin/fsck.c

-2
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,8 @@
1313
#include "tree-walk.h"
1414
#include "fsck.h"
1515
#include "parse-options.h"
16-
#include "dir.h"
1716
#include "progress.h"
1817
#include "streaming.h"
19-
#include "decorate.h"
2018
#include "packfile.h"
2119
#include "object-file.h"
2220
#include "object-name.h"

Diff for: builtin/get-tar-commit-id.c

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
#include "builtin.h"
55
#include "commit.h"
66
#include "tar.h"
7-
#include "quote.h"
87

98
static const char builtin_get_tar_commit_id_usage[] =
109
"git get-tar-commit-id";

Diff for: builtin/grep.c

-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@
99
#include "hex.h"
1010
#include "repository.h"
1111
#include "config.h"
12-
#include "blob.h"
13-
#include "tree.h"
14-
#include "commit.h"
1512
#include "tag.h"
1613
#include "tree-walk.h"
1714
#include "parse-options.h"

Diff for: builtin/hash-object.c

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#include "blob.h"
1515
#include "quote.h"
1616
#include "parse-options.h"
17-
#include "exec-cmd.h"
1817
#include "setup.h"
1918
#include "strbuf.h"
2019
#include "write-or-die.h"

Diff for: builtin/hook.c

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
#include "gettext.h"
44
#include "hook.h"
55
#include "parse-options.h"
6-
#include "strbuf.h"
76
#include "strvec.h"
87

98
#define BUILTIN_HOOK_RUN_USAGE \

Diff for: builtin/index-pack.c

-2
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,9 @@
88
#include "csum-file.h"
99
#include "blob.h"
1010
#include "commit.h"
11-
#include "tag.h"
1211
#include "tree.h"
1312
#include "progress.h"
1413
#include "fsck.h"
15-
#include "exec-cmd.h"
1614
#include "strbuf.h"
1715
#include "streaming.h"
1816
#include "thread-utils.h"

Diff for: builtin/init-db.c

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
*/
66
#include "builtin.h"
77
#include "abspath.h"
8-
#include "config.h"
98
#include "environment.h"
109
#include "gettext.h"
1110
#include "object-file.h"

0 commit comments

Comments
 (0)