From 85023577a8f4b540aa64aa37f6f44578c0c305a3 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Tue, 19 Dec 2006 14:34:12 -0800 Subject: [PATCH] simplify inclusion of system header files. This is a mechanical clean-up of the way *.c files include system header files. (1) sources under compat/, platform sha-1 implementations, and xdelta code are exempt from the following rules; (2) the first #include must be "git-compat-util.h" or one of our own header file that includes it first (e.g. config.h, builtin.h, pkt-line.h); (3) system headers that are included in "git-compat-util.h" need not be included in individual C source files. (4) "git-compat-util.h" does not have to include subsystem specific header files (e.g. expat.h). Signed-off-by: Junio C Hamano --- archive-tar.c | 1 - archive-zip.c | 1 - blob.c | 1 - builtin-add.c | 2 -- builtin-apply.c | 1 - builtin-archive.c | 1 - builtin-blame.c | 4 ---- builtin-branch.c | 2 +- builtin-for-each-ref.c | 1 - builtin-grep.c | 3 --- builtin-log.c | 2 -- builtin-ls-files.c | 2 -- builtin-mailinfo.c | 9 --------- builtin-mailsplit.c | 7 ------- builtin-mv.c | 2 -- builtin-name-rev.c | 1 - builtin-pack-objects.c | 2 -- builtin-repo-config.c | 1 - builtin-runstatus.c | 2 +- builtin-shortlog.c | 1 - builtin-show-branch.c | 2 -- builtin-stripspace.c | 3 --- builtin-tar-tree.c | 1 - builtin-unpack-objects.c | 2 -- builtin-upload-archive.c | 3 --- color.c | 5 +---- compat/mmap.c | 4 ---- compat/setenv.c | 3 +-- compat/strlcpy.c | 2 +- compat/unsetenv.c | 3 +-- config.c | 1 - connect.c | 6 ------ convert-objects.c | 4 ---- daemon.c | 16 +++------------- date.c | 3 --- diff-delta.c | 5 +---- diff.c | 3 --- diffcore-order.c | 1 - diffcore-pickaxe.c | 2 -- dir.c | 3 --- entry.c | 2 -- fetch-pack.c | 1 - fetch.c | 3 +-- fsck-objects.c | 3 --- git-compat-util.h | 25 ++++++++++++++++++++++++- git.c | 14 +------------- grep.c | 1 - help.c | 3 +-- ident.c | 3 --- imap-send.c | 7 ------- index-pack.c | 5 ----- interpolate.c | 2 -- lockfile.c | 1 - merge-base.c | 1 - merge-index.c | 4 ---- merge-recursive.c | 7 ------- path-list.c | 1 - path.c | 1 - receive-pack.c | 1 - refs.c | 4 +--- revision.c | 1 - rsh.c | 6 +----- run-command.c | 1 - ssh-upload.c | 2 -- strbuf.c | 4 +--- test-date.c | 3 --- test-delta.c | 8 +------- tree.c | 1 - unpack-trees.c | 2 -- upload-pack.c | 3 --- var.c | 3 --- wt-status.c | 2 +- 72 files changed, 42 insertions(+), 201 deletions(-) diff --git a/archive-tar.c b/archive-tar.c index ff0f6e292..af47fdc95 100644 --- a/archive-tar.c +++ b/archive-tar.c @@ -1,7 +1,6 @@ /* * Copyright (c) 2005, 2006 Rene Scharfe */ -#include #include "cache.h" #include "commit.h" #include "strbuf.h" diff --git a/archive-zip.c b/archive-zip.c index 36e922a1f..f31b8ed82 100644 --- a/archive-zip.c +++ b/archive-zip.c @@ -1,7 +1,6 @@ /* * Copyright (c) 2006 Rene Scharfe */ -#include #include "cache.h" #include "commit.h" #include "blob.h" diff --git a/blob.c b/blob.c index d1af2e62f..9776beac5 100644 --- a/blob.c +++ b/blob.c @@ -1,6 +1,5 @@ #include "cache.h" #include "blob.h" -#include const char *blob_type = "blob"; diff --git a/builtin-add.c b/builtin-add.c index b3f920676..c8a114fef 100644 --- a/builtin-add.c +++ b/builtin-add.c @@ -3,8 +3,6 @@ * * Copyright (C) 2006 Linus Torvalds */ -#include - #include "cache.h" #include "builtin.h" #include "dir.h" diff --git a/builtin-apply.c b/builtin-apply.c index 436d9e188..1c3583706 100644 --- a/builtin-apply.c +++ b/builtin-apply.c @@ -6,7 +6,6 @@ * This applies patches on top of some (arbitrary) version of the SCM. * */ -#include #include "cache.h" #include "cache-tree.h" #include "quote.h" diff --git a/builtin-archive.c b/builtin-archive.c index a8a1f079b..391cf4391 100644 --- a/builtin-archive.c +++ b/builtin-archive.c @@ -2,7 +2,6 @@ * Copyright (c) 2006 Franck Bui-Huu * Copyright (c) 2006 Rene Scharfe */ -#include #include "cache.h" #include "builtin.h" #include "archive.h" diff --git a/builtin-blame.c b/builtin-blame.c index a25072446..9bf6ec951 100644 --- a/builtin-blame.c +++ b/builtin-blame.c @@ -15,10 +15,6 @@ #include "revision.h" #include "xdiff-interface.h" -#include -#include -#include - static char blame_usage[] = "git-blame [-c] [-l] [-t] [-f] [-n] [-p] [-L n,m] [-S ] [-M] [-C] [-C] [commit] [--] file\n" " -c, --compatibility Use the same output mode as git-annotate (Default: off)\n" diff --git a/builtin-branch.c b/builtin-branch.c index 560309cb1..515330c15 100644 --- a/builtin-branch.c +++ b/builtin-branch.c @@ -5,8 +5,8 @@ * Based on git-branch.sh by Junio C Hamano. */ -#include "color.h" #include "cache.h" +#include "color.h" #include "refs.h" #include "commit.h" #include "builtin.h" diff --git a/builtin-for-each-ref.c b/builtin-for-each-ref.c index 227aa3cd7..af72a12a5 100644 --- a/builtin-for-each-ref.c +++ b/builtin-for-each-ref.c @@ -6,7 +6,6 @@ #include "tree.h" #include "blob.h" #include "quote.h" -#include /* Quoting styles */ #define QUOTE_NONE 0 diff --git a/builtin-grep.c b/builtin-grep.c index 9873e3d1d..3b1b1cbbf 100644 --- a/builtin-grep.c +++ b/builtin-grep.c @@ -10,10 +10,7 @@ #include "tag.h" #include "tree-walk.h" #include "builtin.h" -#include #include "grep.h" -#include -#include /* * git grep pathspecs are somewhat different from diff-tree pathspecs; diff --git a/builtin-log.c b/builtin-log.c index 17014f70a..8df3c1394 100644 --- a/builtin-log.c +++ b/builtin-log.c @@ -11,8 +11,6 @@ #include "log-tree.h" #include "builtin.h" #include "tag.h" -#include -#include static int default_show_root = 1; diff --git a/builtin-ls-files.c b/builtin-ls-files.c index bc79ce40f..21c2a6e2d 100644 --- a/builtin-ls-files.c +++ b/builtin-ls-files.c @@ -5,8 +5,6 @@ * * Copyright (C) Linus Torvalds, 2005 */ -#include - #include "cache.h" #include "quote.h" #include "dir.h" diff --git a/builtin-mailinfo.c b/builtin-mailinfo.c index b8d7dbc0b..e6472293d 100644 --- a/builtin-mailinfo.c +++ b/builtin-mailinfo.c @@ -2,15 +2,6 @@ * Another stupid program, this one parsing the headers of an * email to figure out authorship and subject */ -#define _GNU_SOURCE -#include -#include -#include -#include -#ifndef NO_ICONV -#include -#endif -#include "git-compat-util.h" #include "cache.h" #include "builtin.h" diff --git a/builtin-mailsplit.c b/builtin-mailsplit.c index 91a699d34..3bca855aa 100644 --- a/builtin-mailsplit.c +++ b/builtin-mailsplit.c @@ -4,13 +4,6 @@ * It just splits a mbox into a list of files: "0001" "0002" .. * so you can process them further from there. */ -#include -#include -#include -#include -#include -#include -#include #include "cache.h" #include "builtin.h" diff --git a/builtin-mv.c b/builtin-mv.c index d14a4a7f5..737af350b 100644 --- a/builtin-mv.c +++ b/builtin-mv.c @@ -3,8 +3,6 @@ * * Copyright (C) 2006 Johannes Schindelin */ -#include - #include "cache.h" #include "builtin.h" #include "dir.h" diff --git a/builtin-name-rev.c b/builtin-name-rev.c index 618aa314d..b4f15cc38 100644 --- a/builtin-name-rev.c +++ b/builtin-name-rev.c @@ -1,4 +1,3 @@ -#include #include "builtin.h" #include "cache.h" #include "commit.h" diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c index a2dc7d1d9..807be8c3f 100644 --- a/builtin-pack-objects.c +++ b/builtin-pack-objects.c @@ -12,8 +12,6 @@ #include "diff.h" #include "revision.h" #include "list-objects.h" -#include -#include static const char pack_usage[] = "\ git-pack-objects [{ -q | --progress | --all-progress }] \n\ diff --git a/builtin-repo-config.c b/builtin-repo-config.c index a38099a63..a7ab4cee5 100644 --- a/builtin-repo-config.c +++ b/builtin-repo-config.c @@ -1,6 +1,5 @@ #include "builtin.h" #include "cache.h" -#include static const char git_config_set_usage[] = "git-repo-config [ --global ] [ --bool | --int ] [--get | --get-all | --get-regexp | --replace-all | --add | --unset | --unset-all] name [value [value_regex]] | --rename-section old_name new_name | --list"; diff --git a/builtin-runstatus.c b/builtin-runstatus.c index 0b63037dd..4b489b121 100644 --- a/builtin-runstatus.c +++ b/builtin-runstatus.c @@ -1,5 +1,5 @@ -#include "wt-status.h" #include "cache.h" +#include "wt-status.h" extern int wt_status_use_color; diff --git a/builtin-shortlog.c b/builtin-shortlog.c index 3fc43dd7d..edb40429e 100644 --- a/builtin-shortlog.c +++ b/builtin-shortlog.c @@ -4,7 +4,6 @@ #include "diff.h" #include "path-list.h" #include "revision.h" -#include static const char shortlog_usage[] = "git-shortlog [-n] [-s] [... ]"; diff --git a/builtin-show-branch.c b/builtin-show-branch.c index a38ac34ef..b9d9781d4 100644 --- a/builtin-show-branch.c +++ b/builtin-show-branch.c @@ -1,5 +1,3 @@ -#include -#include #include "cache.h" #include "commit.h" #include "refs.h" diff --git a/builtin-stripspace.c b/builtin-stripspace.c index 09cc9108c..f0d4d9e2d 100644 --- a/builtin-stripspace.c +++ b/builtin-stripspace.c @@ -1,6 +1,3 @@ -#include -#include -#include #include "builtin.h" /* diff --git a/builtin-tar-tree.c b/builtin-tar-tree.c index 4d4cfec87..11e62fc14 100644 --- a/builtin-tar-tree.c +++ b/builtin-tar-tree.c @@ -1,7 +1,6 @@ /* * Copyright (c) 2005, 2006 Rene Scharfe */ -#include #include "cache.h" #include "commit.h" #include "tar.h" diff --git a/builtin-unpack-objects.c b/builtin-unpack-objects.c index e6d757484..d351e0264 100644 --- a/builtin-unpack-objects.c +++ b/builtin-unpack-objects.c @@ -8,8 +8,6 @@ #include "tag.h" #include "tree.h" -#include - static int dry_run, quiet, recover, has_errors; static const char unpack_usage[] = "git-unpack-objects [-n] [-q] [-r] < pack-file"; diff --git a/builtin-upload-archive.c b/builtin-upload-archive.c index 45c92e163..e4156f8f4 100644 --- a/builtin-upload-archive.c +++ b/builtin-upload-archive.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2006 Franck Bui-Huu */ -#include -#include -#include #include "cache.h" #include "builtin.h" #include "archive.h" diff --git a/color.c b/color.c index d8c8399d5..09d82eec3 100644 --- a/color.c +++ b/color.c @@ -1,8 +1,5 @@ -#include "color.h" #include "cache.h" -#include "git-compat-util.h" - -#include +#include "color.h" #define COLOR_RESET "\033[m" diff --git a/compat/mmap.c b/compat/mmap.c index a4d2e507f..0fd46e793 100644 --- a/compat/mmap.c +++ b/compat/mmap.c @@ -1,7 +1,3 @@ -#include -#include -#include -#include #include "../git-compat-util.h" void *gitfakemmap(void *start, size_t length, int prot , int flags, int fd, off_t offset) diff --git a/compat/setenv.c b/compat/setenv.c index b7d767859..3a22ea7b7 100644 --- a/compat/setenv.c +++ b/compat/setenv.c @@ -1,5 +1,4 @@ -#include -#include +#include "../git-compat-util.h" int gitsetenv(const char *name, const char *value, int replace) { diff --git a/compat/strlcpy.c b/compat/strlcpy.c index b66856a3a..4024c3603 100644 --- a/compat/strlcpy.c +++ b/compat/strlcpy.c @@ -1,4 +1,4 @@ -#include +#include "../git-compat-util.h" size_t gitstrlcpy(char *dest, const char *src, size_t size) { diff --git a/compat/unsetenv.c b/compat/unsetenv.c index 3a5e4ec04..eb29f5e08 100644 --- a/compat/unsetenv.c +++ b/compat/unsetenv.c @@ -1,5 +1,4 @@ -#include -#include +#include "../git-compat-util.h" void gitunsetenv (const char *name) { diff --git a/config.c b/config.c index 8cbdd178b..e86b2328a 100644 --- a/config.c +++ b/config.c @@ -6,7 +6,6 @@ * */ #include "cache.h" -#include #define MAXNAME (256) diff --git a/connect.c b/connect.c index f7edba82c..66daa11a5 100644 --- a/connect.c +++ b/connect.c @@ -3,12 +3,6 @@ #include "pkt-line.h" #include "quote.h" #include "refs.h" -#include -#include -#include -#include -#include -#include static char *server_capabilities; diff --git a/convert-objects.c b/convert-objects.c index 881258311..a63013298 100644 --- a/convert-objects.c +++ b/convert-objects.c @@ -1,7 +1,3 @@ -#define _XOPEN_SOURCE 600 /* glibc2 and AIX 5.3L need 500, OpenBSD needs 600 for S_ISLNK() */ -#define _XOPEN_SOURCE_EXTENDED 1 /* AIX 5.3L needs this */ -#define _GNU_SOURCE -#include #include "cache.h" #include "blob.h" #include "commit.h" diff --git a/daemon.c b/daemon.c index e66bb802d..b129b83e4 100644 --- a/daemon.c +++ b/daemon.c @@ -1,20 +1,10 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "pkt-line.h" #include "cache.h" +#include "pkt-line.h" #include "exec_cmd.h" #include "interpolate.h" +#include + #ifndef HOST_NAME_MAX #define HOST_NAME_MAX 256 #endif diff --git a/date.c b/date.c index 182592273..7acb8cbd9 100644 --- a/date.c +++ b/date.c @@ -4,9 +4,6 @@ * Copyright (C) Linus Torvalds, 2005 */ -#include -#include - #include "cache.h" static time_t my_mktime(struct tm *tm) diff --git a/diff-delta.c b/diff-delta.c index fa16d06c8..9f998d0a7 100644 --- a/diff-delta.c +++ b/diff-delta.c @@ -18,11 +18,8 @@ * licensing gets turned into GPLv2 within this project. */ -#include -#include -#include "delta.h" - #include "git-compat-util.h" +#include "delta.h" /* maximum hash entry list for the same hash bucket */ #define HASH_LIMIT 64 diff --git a/diff.c b/diff.c index 6e6f2a765..91f956b23 100644 --- a/diff.c +++ b/diff.c @@ -1,9 +1,6 @@ /* * Copyright (C) 2005 Junio C Hamano */ -#include -#include -#include #include "cache.h" #include "quote.h" #include "diff.h" diff --git a/diffcore-order.c b/diffcore-order.c index aef6da604..7ad094618 100644 --- a/diffcore-order.c +++ b/diffcore-order.c @@ -4,7 +4,6 @@ #include "cache.h" #include "diff.h" #include "diffcore.h" -#include static char **order; static int order_cnt; diff --git a/diffcore-pickaxe.c b/diffcore-pickaxe.c index cfcce315b..de44adabf 100644 --- a/diffcore-pickaxe.c +++ b/diffcore-pickaxe.c @@ -5,8 +5,6 @@ #include "diff.h" #include "diffcore.h" -#include - static unsigned int contains(struct diff_filespec *one, const char *needle, unsigned long len, regex_t *regexp) diff --git a/dir.c b/dir.c index e6a61ee91..16401d801 100644 --- a/dir.c +++ b/dir.c @@ -5,9 +5,6 @@ * Copyright (C) Linus Torvalds, 2005-2006 * Junio Hamano, 2005-2006 */ -#include -#include - #include "cache.h" #include "dir.h" diff --git a/entry.c b/entry.c index b2ea0efa8..88df71394 100644 --- a/entry.c +++ b/entry.c @@ -1,5 +1,3 @@ -#include -#include #include "cache.h" #include "blob.h" diff --git a/fetch-pack.c b/fetch-pack.c index 743eab7ef..92322cf4d 100644 --- a/fetch-pack.c +++ b/fetch-pack.c @@ -5,7 +5,6 @@ #include "tag.h" #include "exec_cmd.h" #include "sideband.h" -#include static int keep_pack; static int quiet; diff --git a/fetch.c b/fetch.c index 663b4b2f4..f69be82f1 100644 --- a/fetch.c +++ b/fetch.c @@ -1,6 +1,5 @@ -#include "fetch.h" - #include "cache.h" +#include "fetch.h" #include "commit.h" #include "tree.h" #include "tree-walk.h" diff --git a/fsck-objects.c b/fsck-objects.c index 46b628cb9..409aea02b 100644 --- a/fsck-objects.c +++ b/fsck-objects.c @@ -1,6 +1,3 @@ -#include -#include - #include "cache.h" #include "commit.h" #include "tree.h" diff --git a/git-compat-util.h b/git-compat-util.h index 0272d043d..bc296b3a4 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -11,6 +11,11 @@ #define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0])) +#define _XOPEN_SOURCE 600 /* glibc2 and AIX 5.3L need 500, OpenBSD needs 600 for S_ISLNK() */ +#define _XOPEN_SOURCE_EXTENDED 1 /* AIX 5.3L needs this */ +#define _GNU_SOURCE +#define _BSD_SOURCE + #include #include #include @@ -22,9 +27,27 @@ #include #include #include -#include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifndef NO_ICONV +#include +#endif /* On most systems would have given us this, but * not on some systems (e.g. GNU/Hurd). diff --git a/git.c b/git.c index 016ee8adb..73cf4d4e0 100644 --- a/git.c +++ b/git.c @@ -1,20 +1,8 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "git-compat-util.h" +#include "builtin.h" #include "exec_cmd.h" #include "cache.h" #include "quote.h" -#include "builtin.h" - const char git_usage_string[] = "git [--version] [--exec-path[=GIT_EXEC_PATH]] [-p|--paginate] [--bare] [--git-dir=GIT_DIR] [--help] COMMAND [ARGS]"; diff --git a/grep.c b/grep.c index 0fc078ec0..fcc676230 100644 --- a/grep.c +++ b/grep.c @@ -1,5 +1,4 @@ #include "cache.h" -#include #include "grep.h" void append_grep_pattern(struct grep_opt *opt, const char *pat, diff --git a/help.c b/help.c index 0824c2522..341b9e370 100644 --- a/help.c +++ b/help.c @@ -3,12 +3,11 @@ * * Builtin help-related commands (help, usage, version) */ -#include #include "cache.h" #include "builtin.h" #include "exec_cmd.h" #include "common-cmds.h" - +#include /* most GUI terminals set COLUMNS (although some don't export it) */ static int term_columns(void) diff --git a/ident.c b/ident.c index d7faba6a7..6ad8fedd6 100644 --- a/ident.c +++ b/ident.c @@ -7,9 +7,6 @@ */ #include "cache.h" -#include -#include - static char git_default_date[50]; static void copy_gecos(struct passwd *w, char *name, int sz) diff --git a/imap-send.c b/imap-send.c index a6a65680e..894cbbdf5 100644 --- a/imap-send.c +++ b/imap-send.c @@ -24,13 +24,6 @@ #include "cache.h" -#include -#include -#include -#include -#include -#include - typedef struct store_conf { char *name; const char *path; /* should this be here? its interpretation is driver-specific */ diff --git a/index-pack.c b/index-pack.c index c05feae16..43e007f82 100644 --- a/index-pack.c +++ b/index-pack.c @@ -1,8 +1,3 @@ -#define _XOPEN_SOURCE 600 -#include -#include -#include - #include "cache.h" #include "delta.h" #include "pack.h" diff --git a/interpolate.c b/interpolate.c index 5d9d1889f..f992ef775 100644 --- a/interpolate.c +++ b/interpolate.c @@ -2,8 +2,6 @@ * Copyright 2006 Jon Loeliger */ -#include - #include "git-compat-util.h" #include "interpolate.h" diff --git a/lockfile.c b/lockfile.c index 2a2fea3cb..261baff04 100644 --- a/lockfile.c +++ b/lockfile.c @@ -1,7 +1,6 @@ /* * Copyright (c) 2005, Junio C Hamano */ -#include #include "cache.h" static struct lock_file *lock_file_list; diff --git a/merge-base.c b/merge-base.c index 009caf804..385f4ba38 100644 --- a/merge-base.c +++ b/merge-base.c @@ -1,4 +1,3 @@ -#include #include "cache.h" #include "commit.h" diff --git a/merge-index.c b/merge-index.c index 646d090c5..a9983dd78 100644 --- a/merge-index.c +++ b/merge-index.c @@ -1,7 +1,3 @@ -#include -#include -#include - #include "cache.h" static const char *pgm; diff --git a/merge-recursive.c b/merge-recursive.c index 6dd6e2e5a..1de273ea1 100644 --- a/merge-recursive.c +++ b/merge-recursive.c @@ -3,13 +3,6 @@ * Fredrik Kuivinen. * The thieves were Alex Riesen and Johannes Schindelin, in June/July 2006 */ -#include -#include -#include -#include -#include -#include -#include #include "cache.h" #include "cache-tree.h" #include "commit.h" diff --git a/path-list.c b/path-list.c index f8800f8e6..caaa5cc57 100644 --- a/path-list.c +++ b/path-list.c @@ -1,4 +1,3 @@ -#include #include "cache.h" #include "path-list.h" diff --git a/path.c b/path.c index d2c076d7c..066f62195 100644 --- a/path.c +++ b/path.c @@ -11,7 +11,6 @@ * which is what it's designed for. */ #include "cache.h" -#include static char bad_path[] = "/bad-path/"; diff --git a/receive-pack.c b/receive-pack.c index 5e5510bc3..59b682c03 100644 --- a/receive-pack.c +++ b/receive-pack.c @@ -6,7 +6,6 @@ #include "exec_cmd.h" #include "commit.h" #include "object.h" -#include static const char receive_pack_usage[] = "git-receive-pack "; diff --git a/refs.c b/refs.c index d911b9e86..a101ff3bf 100644 --- a/refs.c +++ b/refs.c @@ -1,10 +1,8 @@ -#include "refs.h" #include "cache.h" +#include "refs.h" #include "object.h" #include "tag.h" -#include - /* ISSYMREF=01 and ISPACKED=02 are public interfaces */ #define REF_KNOWS_PEELED 04 diff --git a/revision.c b/revision.c index 993bb668a..7b6f91f83 100644 --- a/revision.c +++ b/revision.c @@ -6,7 +6,6 @@ #include "diff.h" #include "refs.h" #include "revision.h" -#include #include "grep.h" static char *path_name(struct name_path *path, const char *name) diff --git a/rsh.c b/rsh.c index f34409e1b..5754a230e 100644 --- a/rsh.c +++ b/rsh.c @@ -1,10 +1,6 @@ -#include -#include -#include - +#include "cache.h" #include "rsh.h" #include "quote.h" -#include "cache.h" #define COMMAND_SIZE 4096 diff --git a/run-command.c b/run-command.c index 61908682b..492ad3e64 100644 --- a/run-command.c +++ b/run-command.c @@ -1,6 +1,5 @@ #include "cache.h" #include "run-command.h" -#include #include "exec_cmd.h" int run_command_v_opt(int argc, const char **argv, int flags) diff --git a/ssh-upload.c b/ssh-upload.c index 20b15eab5..0b52ae15c 100644 --- a/ssh-upload.c +++ b/ssh-upload.c @@ -12,8 +12,6 @@ #include "rsh.h" #include "refs.h" -#include - static unsigned char local_version = 1; static unsigned char remote_version; diff --git a/strbuf.c b/strbuf.c index 9d9d8bed9..7f14b0fb5 100644 --- a/strbuf.c +++ b/strbuf.c @@ -1,7 +1,5 @@ -#include -#include -#include "strbuf.h" #include "cache.h" +#include "strbuf.h" void strbuf_init(struct strbuf *sb) { sb->buf = NULL; diff --git a/test-date.c b/test-date.c index 93e802759..62e8f2387 100644 --- a/test-date.c +++ b/test-date.c @@ -1,6 +1,3 @@ -#include -#include - #include "cache.h" int main(int argc, char **argv) diff --git a/test-delta.c b/test-delta.c index 1be8ee0c7..795aa0837 100644 --- a/test-delta.c +++ b/test-delta.c @@ -8,13 +8,7 @@ * published by the Free Software Foundation. */ -#include -#include -#include -#include -#include -#include -#include +#include "git-compat-util.h" #include "delta.h" static const char usage[] = diff --git a/tree.c b/tree.c index ea386e506..b6f02fecc 100644 --- a/tree.c +++ b/tree.c @@ -4,7 +4,6 @@ #include "commit.h" #include "tag.h" #include "tree-walk.h" -#include const char *tree_type = "tree"; diff --git a/unpack-trees.c b/unpack-trees.c index b8689ebc8..2e2232cbb 100644 --- a/unpack-trees.c +++ b/unpack-trees.c @@ -1,5 +1,3 @@ -#include -#include #include "cache.h" #include "dir.h" #include "tree.h" diff --git a/upload-pack.c b/upload-pack.c index 4572fff07..32b06b2e6 100644 --- a/upload-pack.c +++ b/upload-pack.c @@ -1,6 +1,3 @@ -#include -#include -#include #include "cache.h" #include "refs.h" #include "pkt-line.h" diff --git a/var.c b/var.c index a57a33b81..39977b949 100644 --- a/var.c +++ b/var.c @@ -4,9 +4,6 @@ * Copyright (C) Eric Biederman, 2005 */ #include "cache.h" -#include -#include -#include static const char var_usage[] = "git-var [-l | ]"; diff --git a/wt-status.c b/wt-status.c index cface6ca8..db427384f 100644 --- a/wt-status.c +++ b/wt-status.c @@ -1,6 +1,6 @@ +#include "cache.h" #include "wt-status.h" #include "color.h" -#include "cache.h" #include "object.h" #include "dir.h" #include "commit.h" -- 2.30.2