Skip to content

Commit 8502357

Browse files
author
Junio C Hamano
committed
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 <junkio@cox.net>
1 parent 6d2fa7f commit 8502357

72 files changed

Lines changed: 42 additions & 201 deletions

Some content is hidden

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

archive-tar.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/*
22
* Copyright (c) 2005, 2006 Rene Scharfe
33
*/
4-
#include <time.h>
54
#include "cache.h"
65
#include "commit.h"
76
#include "strbuf.h"

archive-zip.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/*
22
* Copyright (c) 2006 Rene Scharfe
33
*/
4-
#include <time.h>
54
#include "cache.h"
65
#include "commit.h"
76
#include "blob.h"

blob.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#include "cache.h"
22
#include "blob.h"
3-
#include <stdlib.h>
43

54
const char *blob_type = "blob";
65

builtin-add.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
*
44
* Copyright (C) 2006 Linus Torvalds
55
*/
6-
#include <fnmatch.h>
7-
86
#include "cache.h"
97
#include "builtin.h"
108
#include "dir.h"

builtin-apply.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
* This applies patches on top of some (arbitrary) version of the SCM.
77
*
88
*/
9-
#include <fnmatch.h>
109
#include "cache.h"
1110
#include "cache-tree.h"
1211
#include "quote.h"

builtin-archive.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
* Copyright (c) 2006 Franck Bui-Huu
33
* Copyright (c) 2006 Rene Scharfe
44
*/
5-
#include <time.h>
65
#include "cache.h"
76
#include "builtin.h"
87
#include "archive.h"

builtin-blame.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@
1515
#include "revision.h"
1616
#include "xdiff-interface.h"
1717

18-
#include <time.h>
19-
#include <sys/time.h>
20-
#include <regex.h>
21-
2218
static char blame_usage[] =
2319
"git-blame [-c] [-l] [-t] [-f] [-n] [-p] [-L n,m] [-S <revs-file>] [-M] [-C] [-C] [commit] [--] file\n"
2420
" -c, --compatibility Use the same output mode as git-annotate (Default: off)\n"

builtin-branch.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
* Based on git-branch.sh by Junio C Hamano.
66
*/
77

8-
#include "color.h"
98
#include "cache.h"
9+
#include "color.h"
1010
#include "refs.h"
1111
#include "commit.h"
1212
#include "builtin.h"

builtin-for-each-ref.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
#include "tree.h"
77
#include "blob.h"
88
#include "quote.h"
9-
#include <fnmatch.h>
109

1110
/* Quoting styles */
1211
#define QUOTE_NONE 0

builtin-grep.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@
1010
#include "tag.h"
1111
#include "tree-walk.h"
1212
#include "builtin.h"
13-
#include <regex.h>
1413
#include "grep.h"
15-
#include <fnmatch.h>
16-
#include <sys/wait.h>
1714

1815
/*
1916
* git grep pathspecs are somewhat different from diff-tree pathspecs;

0 commit comments

Comments
 (0)