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>
This commit is contained in:
parent
6d2fa7f1b4
commit
85023577a8
@ -1,7 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2005, 2006 Rene Scharfe
|
* Copyright (c) 2005, 2006 Rene Scharfe
|
||||||
*/
|
*/
|
||||||
#include <time.h>
|
|
||||||
#include "cache.h"
|
#include "cache.h"
|
||||||
#include "commit.h"
|
#include "commit.h"
|
||||||
#include "strbuf.h"
|
#include "strbuf.h"
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2006 Rene Scharfe
|
* Copyright (c) 2006 Rene Scharfe
|
||||||
*/
|
*/
|
||||||
#include <time.h>
|
|
||||||
#include "cache.h"
|
#include "cache.h"
|
||||||
#include "commit.h"
|
#include "commit.h"
|
||||||
#include "blob.h"
|
#include "blob.h"
|
||||||
|
1
blob.c
1
blob.c
@ -1,6 +1,5 @@
|
|||||||
#include "cache.h"
|
#include "cache.h"
|
||||||
#include "blob.h"
|
#include "blob.h"
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
const char *blob_type = "blob";
|
const char *blob_type = "blob";
|
||||||
|
|
||||||
|
@ -3,8 +3,6 @@
|
|||||||
*
|
*
|
||||||
* Copyright (C) 2006 Linus Torvalds
|
* Copyright (C) 2006 Linus Torvalds
|
||||||
*/
|
*/
|
||||||
#include <fnmatch.h>
|
|
||||||
|
|
||||||
#include "cache.h"
|
#include "cache.h"
|
||||||
#include "builtin.h"
|
#include "builtin.h"
|
||||||
#include "dir.h"
|
#include "dir.h"
|
||||||
|
@ -6,7 +6,6 @@
|
|||||||
* This applies patches on top of some (arbitrary) version of the SCM.
|
* This applies patches on top of some (arbitrary) version of the SCM.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#include <fnmatch.h>
|
|
||||||
#include "cache.h"
|
#include "cache.h"
|
||||||
#include "cache-tree.h"
|
#include "cache-tree.h"
|
||||||
#include "quote.h"
|
#include "quote.h"
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
* Copyright (c) 2006 Franck Bui-Huu
|
* Copyright (c) 2006 Franck Bui-Huu
|
||||||
* Copyright (c) 2006 Rene Scharfe
|
* Copyright (c) 2006 Rene Scharfe
|
||||||
*/
|
*/
|
||||||
#include <time.h>
|
|
||||||
#include "cache.h"
|
#include "cache.h"
|
||||||
#include "builtin.h"
|
#include "builtin.h"
|
||||||
#include "archive.h"
|
#include "archive.h"
|
||||||
|
@ -15,10 +15,6 @@
|
|||||||
#include "revision.h"
|
#include "revision.h"
|
||||||
#include "xdiff-interface.h"
|
#include "xdiff-interface.h"
|
||||||
|
|
||||||
#include <time.h>
|
|
||||||
#include <sys/time.h>
|
|
||||||
#include <regex.h>
|
|
||||||
|
|
||||||
static char blame_usage[] =
|
static char blame_usage[] =
|
||||||
"git-blame [-c] [-l] [-t] [-f] [-n] [-p] [-L n,m] [-S <revs-file>] [-M] [-C] [-C] [commit] [--] file\n"
|
"git-blame [-c] [-l] [-t] [-f] [-n] [-p] [-L n,m] [-S <revs-file>] [-M] [-C] [-C] [commit] [--] file\n"
|
||||||
" -c, --compatibility Use the same output mode as git-annotate (Default: off)\n"
|
" -c, --compatibility Use the same output mode as git-annotate (Default: off)\n"
|
||||||
|
@ -5,8 +5,8 @@
|
|||||||
* Based on git-branch.sh by Junio C Hamano.
|
* Based on git-branch.sh by Junio C Hamano.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "color.h"
|
|
||||||
#include "cache.h"
|
#include "cache.h"
|
||||||
|
#include "color.h"
|
||||||
#include "refs.h"
|
#include "refs.h"
|
||||||
#include "commit.h"
|
#include "commit.h"
|
||||||
#include "builtin.h"
|
#include "builtin.h"
|
||||||
|
@ -6,7 +6,6 @@
|
|||||||
#include "tree.h"
|
#include "tree.h"
|
||||||
#include "blob.h"
|
#include "blob.h"
|
||||||
#include "quote.h"
|
#include "quote.h"
|
||||||
#include <fnmatch.h>
|
|
||||||
|
|
||||||
/* Quoting styles */
|
/* Quoting styles */
|
||||||
#define QUOTE_NONE 0
|
#define QUOTE_NONE 0
|
||||||
|
@ -10,10 +10,7 @@
|
|||||||
#include "tag.h"
|
#include "tag.h"
|
||||||
#include "tree-walk.h"
|
#include "tree-walk.h"
|
||||||
#include "builtin.h"
|
#include "builtin.h"
|
||||||
#include <regex.h>
|
|
||||||
#include "grep.h"
|
#include "grep.h"
|
||||||
#include <fnmatch.h>
|
|
||||||
#include <sys/wait.h>
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* git grep pathspecs are somewhat different from diff-tree pathspecs;
|
* git grep pathspecs are somewhat different from diff-tree pathspecs;
|
||||||
|
@ -11,8 +11,6 @@
|
|||||||
#include "log-tree.h"
|
#include "log-tree.h"
|
||||||
#include "builtin.h"
|
#include "builtin.h"
|
||||||
#include "tag.h"
|
#include "tag.h"
|
||||||
#include <time.h>
|
|
||||||
#include <sys/time.h>
|
|
||||||
|
|
||||||
static int default_show_root = 1;
|
static int default_show_root = 1;
|
||||||
|
|
||||||
|
@ -5,8 +5,6 @@
|
|||||||
*
|
*
|
||||||
* Copyright (C) Linus Torvalds, 2005
|
* Copyright (C) Linus Torvalds, 2005
|
||||||
*/
|
*/
|
||||||
#include <fnmatch.h>
|
|
||||||
|
|
||||||
#include "cache.h"
|
#include "cache.h"
|
||||||
#include "quote.h"
|
#include "quote.h"
|
||||||
#include "dir.h"
|
#include "dir.h"
|
||||||
|
@ -2,15 +2,6 @@
|
|||||||
* Another stupid program, this one parsing the headers of an
|
* Another stupid program, this one parsing the headers of an
|
||||||
* email to figure out authorship and subject
|
* email to figure out authorship and subject
|
||||||
*/
|
*/
|
||||||
#define _GNU_SOURCE
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <ctype.h>
|
|
||||||
#ifndef NO_ICONV
|
|
||||||
#include <iconv.h>
|
|
||||||
#endif
|
|
||||||
#include "git-compat-util.h"
|
|
||||||
#include "cache.h"
|
#include "cache.h"
|
||||||
#include "builtin.h"
|
#include "builtin.h"
|
||||||
|
|
||||||
|
@ -4,13 +4,6 @@
|
|||||||
* It just splits a mbox into a list of files: "0001" "0002" ..
|
* It just splits a mbox into a list of files: "0001" "0002" ..
|
||||||
* so you can process them further from there.
|
* so you can process them further from there.
|
||||||
*/
|
*/
|
||||||
#include <unistd.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <fcntl.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/stat.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include "cache.h"
|
#include "cache.h"
|
||||||
#include "builtin.h"
|
#include "builtin.h"
|
||||||
|
|
||||||
|
@ -3,8 +3,6 @@
|
|||||||
*
|
*
|
||||||
* Copyright (C) 2006 Johannes Schindelin
|
* Copyright (C) 2006 Johannes Schindelin
|
||||||
*/
|
*/
|
||||||
#include <fnmatch.h>
|
|
||||||
|
|
||||||
#include "cache.h"
|
#include "cache.h"
|
||||||
#include "builtin.h"
|
#include "builtin.h"
|
||||||
#include "dir.h"
|
#include "dir.h"
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
#include <stdlib.h>
|
|
||||||
#include "builtin.h"
|
#include "builtin.h"
|
||||||
#include "cache.h"
|
#include "cache.h"
|
||||||
#include "commit.h"
|
#include "commit.h"
|
||||||
|
@ -12,8 +12,6 @@
|
|||||||
#include "diff.h"
|
#include "diff.h"
|
||||||
#include "revision.h"
|
#include "revision.h"
|
||||||
#include "list-objects.h"
|
#include "list-objects.h"
|
||||||
#include <sys/time.h>
|
|
||||||
#include <signal.h>
|
|
||||||
|
|
||||||
static const char pack_usage[] = "\
|
static const char pack_usage[] = "\
|
||||||
git-pack-objects [{ -q | --progress | --all-progress }] \n\
|
git-pack-objects [{ -q | --progress | --all-progress }] \n\
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
#include "builtin.h"
|
#include "builtin.h"
|
||||||
#include "cache.h"
|
#include "cache.h"
|
||||||
#include <regex.h>
|
|
||||||
|
|
||||||
static const char git_config_set_usage[] =
|
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";
|
"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";
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include "wt-status.h"
|
|
||||||
#include "cache.h"
|
#include "cache.h"
|
||||||
|
#include "wt-status.h"
|
||||||
|
|
||||||
extern int wt_status_use_color;
|
extern int wt_status_use_color;
|
||||||
|
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
#include "diff.h"
|
#include "diff.h"
|
||||||
#include "path-list.h"
|
#include "path-list.h"
|
||||||
#include "revision.h"
|
#include "revision.h"
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
static const char shortlog_usage[] =
|
static const char shortlog_usage[] =
|
||||||
"git-shortlog [-n] [-s] [<commit-id>... ]";
|
"git-shortlog [-n] [-s] [<commit-id>... ]";
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
#include <stdlib.h>
|
|
||||||
#include <fnmatch.h>
|
|
||||||
#include "cache.h"
|
#include "cache.h"
|
||||||
#include "commit.h"
|
#include "commit.h"
|
||||||
#include "refs.h"
|
#include "refs.h"
|
||||||
|
@ -1,6 +1,3 @@
|
|||||||
#include <stdio.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <ctype.h>
|
|
||||||
#include "builtin.h"
|
#include "builtin.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2005, 2006 Rene Scharfe
|
* Copyright (c) 2005, 2006 Rene Scharfe
|
||||||
*/
|
*/
|
||||||
#include <time.h>
|
|
||||||
#include "cache.h"
|
#include "cache.h"
|
||||||
#include "commit.h"
|
#include "commit.h"
|
||||||
#include "tar.h"
|
#include "tar.h"
|
||||||
|
@ -8,8 +8,6 @@
|
|||||||
#include "tag.h"
|
#include "tag.h"
|
||||||
#include "tree.h"
|
#include "tree.h"
|
||||||
|
|
||||||
#include <sys/time.h>
|
|
||||||
|
|
||||||
static int dry_run, quiet, recover, has_errors;
|
static int dry_run, quiet, recover, has_errors;
|
||||||
static const char unpack_usage[] = "git-unpack-objects [-n] [-q] [-r] < pack-file";
|
static const char unpack_usage[] = "git-unpack-objects [-n] [-q] [-r] < pack-file";
|
||||||
|
|
||||||
|
@ -1,9 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2006 Franck Bui-Huu
|
* Copyright (c) 2006 Franck Bui-Huu
|
||||||
*/
|
*/
|
||||||
#include <time.h>
|
|
||||||
#include <sys/wait.h>
|
|
||||||
#include <sys/poll.h>
|
|
||||||
#include "cache.h"
|
#include "cache.h"
|
||||||
#include "builtin.h"
|
#include "builtin.h"
|
||||||
#include "archive.h"
|
#include "archive.h"
|
||||||
|
5
color.c
5
color.c
@ -1,8 +1,5 @@
|
|||||||
#include "color.h"
|
|
||||||
#include "cache.h"
|
#include "cache.h"
|
||||||
#include "git-compat-util.h"
|
#include "color.h"
|
||||||
|
|
||||||
#include <stdarg.h>
|
|
||||||
|
|
||||||
#define COLOR_RESET "\033[m"
|
#define COLOR_RESET "\033[m"
|
||||||
|
|
||||||
|
@ -1,7 +1,3 @@
|
|||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
#include <errno.h>
|
|
||||||
#include "../git-compat-util.h"
|
#include "../git-compat-util.h"
|
||||||
|
|
||||||
void *gitfakemmap(void *start, size_t length, int prot , int flags, int fd, off_t offset)
|
void *gitfakemmap(void *start, size_t length, int prot , int flags, int fd, off_t offset)
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
#include <stdlib.h>
|
#include "../git-compat-util.h"
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
int gitsetenv(const char *name, const char *value, int replace)
|
int gitsetenv(const char *name, const char *value, int replace)
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#include <string.h>
|
#include "../git-compat-util.h"
|
||||||
|
|
||||||
size_t gitstrlcpy(char *dest, const char *src, size_t size)
|
size_t gitstrlcpy(char *dest, const char *src, size_t size)
|
||||||
{
|
{
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
#include <stdlib.h>
|
#include "../git-compat-util.h"
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
void gitunsetenv (const char *name)
|
void gitunsetenv (const char *name)
|
||||||
{
|
{
|
||||||
|
1
config.c
1
config.c
@ -6,7 +6,6 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#include "cache.h"
|
#include "cache.h"
|
||||||
#include <regex.h>
|
|
||||||
|
|
||||||
#define MAXNAME (256)
|
#define MAXNAME (256)
|
||||||
|
|
||||||
|
@ -3,12 +3,6 @@
|
|||||||
#include "pkt-line.h"
|
#include "pkt-line.h"
|
||||||
#include "quote.h"
|
#include "quote.h"
|
||||||
#include "refs.h"
|
#include "refs.h"
|
||||||
#include <sys/wait.h>
|
|
||||||
#include <sys/socket.h>
|
|
||||||
#include <netinet/in.h>
|
|
||||||
#include <arpa/inet.h>
|
|
||||||
#include <netdb.h>
|
|
||||||
#include <signal.h>
|
|
||||||
|
|
||||||
static char *server_capabilities;
|
static char *server_capabilities;
|
||||||
|
|
||||||
|
@ -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 <time.h>
|
|
||||||
#include "cache.h"
|
#include "cache.h"
|
||||||
#include "blob.h"
|
#include "blob.h"
|
||||||
#include "commit.h"
|
#include "commit.h"
|
||||||
|
16
daemon.c
16
daemon.c
@ -1,20 +1,10 @@
|
|||||||
#include <signal.h>
|
|
||||||
#include <sys/wait.h>
|
|
||||||
#include <sys/socket.h>
|
|
||||||
#include <sys/time.h>
|
|
||||||
#include <sys/poll.h>
|
|
||||||
#include <netdb.h>
|
|
||||||
#include <netinet/in.h>
|
|
||||||
#include <arpa/inet.h>
|
|
||||||
#include <syslog.h>
|
|
||||||
#include <pwd.h>
|
|
||||||
#include <grp.h>
|
|
||||||
#include <limits.h>
|
|
||||||
#include "pkt-line.h"
|
|
||||||
#include "cache.h"
|
#include "cache.h"
|
||||||
|
#include "pkt-line.h"
|
||||||
#include "exec_cmd.h"
|
#include "exec_cmd.h"
|
||||||
#include "interpolate.h"
|
#include "interpolate.h"
|
||||||
|
|
||||||
|
#include <syslog.h>
|
||||||
|
|
||||||
#ifndef HOST_NAME_MAX
|
#ifndef HOST_NAME_MAX
|
||||||
#define HOST_NAME_MAX 256
|
#define HOST_NAME_MAX 256
|
||||||
#endif
|
#endif
|
||||||
|
3
date.c
3
date.c
@ -4,9 +4,6 @@
|
|||||||
* Copyright (C) Linus Torvalds, 2005
|
* Copyright (C) Linus Torvalds, 2005
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <time.h>
|
|
||||||
#include <sys/time.h>
|
|
||||||
|
|
||||||
#include "cache.h"
|
#include "cache.h"
|
||||||
|
|
||||||
static time_t my_mktime(struct tm *tm)
|
static time_t my_mktime(struct tm *tm)
|
||||||
|
@ -18,11 +18,8 @@
|
|||||||
* licensing gets turned into GPLv2 within this project.
|
* licensing gets turned into GPLv2 within this project.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include "delta.h"
|
|
||||||
|
|
||||||
#include "git-compat-util.h"
|
#include "git-compat-util.h"
|
||||||
|
#include "delta.h"
|
||||||
|
|
||||||
/* maximum hash entry list for the same hash bucket */
|
/* maximum hash entry list for the same hash bucket */
|
||||||
#define HASH_LIMIT 64
|
#define HASH_LIMIT 64
|
||||||
|
3
diff.c
3
diff.c
@ -1,9 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2005 Junio C Hamano
|
* Copyright (C) 2005 Junio C Hamano
|
||||||
*/
|
*/
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/wait.h>
|
|
||||||
#include <signal.h>
|
|
||||||
#include "cache.h"
|
#include "cache.h"
|
||||||
#include "quote.h"
|
#include "quote.h"
|
||||||
#include "diff.h"
|
#include "diff.h"
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
#include "cache.h"
|
#include "cache.h"
|
||||||
#include "diff.h"
|
#include "diff.h"
|
||||||
#include "diffcore.h"
|
#include "diffcore.h"
|
||||||
#include <fnmatch.h>
|
|
||||||
|
|
||||||
static char **order;
|
static char **order;
|
||||||
static int order_cnt;
|
static int order_cnt;
|
||||||
|
@ -5,8 +5,6 @@
|
|||||||
#include "diff.h"
|
#include "diff.h"
|
||||||
#include "diffcore.h"
|
#include "diffcore.h"
|
||||||
|
|
||||||
#include <regex.h>
|
|
||||||
|
|
||||||
static unsigned int contains(struct diff_filespec *one,
|
static unsigned int contains(struct diff_filespec *one,
|
||||||
const char *needle, unsigned long len,
|
const char *needle, unsigned long len,
|
||||||
regex_t *regexp)
|
regex_t *regexp)
|
||||||
|
3
dir.c
3
dir.c
@ -5,9 +5,6 @@
|
|||||||
* Copyright (C) Linus Torvalds, 2005-2006
|
* Copyright (C) Linus Torvalds, 2005-2006
|
||||||
* Junio Hamano, 2005-2006
|
* Junio Hamano, 2005-2006
|
||||||
*/
|
*/
|
||||||
#include <dirent.h>
|
|
||||||
#include <fnmatch.h>
|
|
||||||
|
|
||||||
#include "cache.h"
|
#include "cache.h"
|
||||||
#include "dir.h"
|
#include "dir.h"
|
||||||
|
|
||||||
|
2
entry.c
2
entry.c
@ -1,5 +1,3 @@
|
|||||||
#include <sys/types.h>
|
|
||||||
#include <dirent.h>
|
|
||||||
#include "cache.h"
|
#include "cache.h"
|
||||||
#include "blob.h"
|
#include "blob.h"
|
||||||
|
|
||||||
|
@ -5,7 +5,6 @@
|
|||||||
#include "tag.h"
|
#include "tag.h"
|
||||||
#include "exec_cmd.h"
|
#include "exec_cmd.h"
|
||||||
#include "sideband.h"
|
#include "sideband.h"
|
||||||
#include <sys/wait.h>
|
|
||||||
|
|
||||||
static int keep_pack;
|
static int keep_pack;
|
||||||
static int quiet;
|
static int quiet;
|
||||||
|
3
fetch.c
3
fetch.c
@ -1,6 +1,5 @@
|
|||||||
#include "fetch.h"
|
|
||||||
|
|
||||||
#include "cache.h"
|
#include "cache.h"
|
||||||
|
#include "fetch.h"
|
||||||
#include "commit.h"
|
#include "commit.h"
|
||||||
#include "tree.h"
|
#include "tree.h"
|
||||||
#include "tree-walk.h"
|
#include "tree-walk.h"
|
||||||
|
@ -1,6 +1,3 @@
|
|||||||
#include <sys/types.h>
|
|
||||||
#include <dirent.h>
|
|
||||||
|
|
||||||
#include "cache.h"
|
#include "cache.h"
|
||||||
#include "commit.h"
|
#include "commit.h"
|
||||||
#include "tree.h"
|
#include "tree.h"
|
||||||
|
@ -11,6 +11,11 @@
|
|||||||
|
|
||||||
#define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0]))
|
#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 <unistd.h>
|
#include <unistd.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
@ -22,9 +27,27 @@
|
|||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <netinet/in.h>
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
|
#include <sys/time.h>
|
||||||
|
#include <time.h>
|
||||||
|
#include <signal.h>
|
||||||
|
#include <sys/wait.h>
|
||||||
|
#include <fnmatch.h>
|
||||||
|
#include <sys/poll.h>
|
||||||
|
#include <sys/socket.h>
|
||||||
|
#include <assert.h>
|
||||||
|
#include <regex.h>
|
||||||
|
#include <netinet/in.h>
|
||||||
|
#include <netinet/tcp.h>
|
||||||
|
#include <arpa/inet.h>
|
||||||
|
#include <netdb.h>
|
||||||
|
#include <pwd.h>
|
||||||
|
#include <grp.h>
|
||||||
|
|
||||||
|
#ifndef NO_ICONV
|
||||||
|
#include <iconv.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
/* On most systems <limits.h> would have given us this, but
|
/* On most systems <limits.h> would have given us this, but
|
||||||
* not on some systems (e.g. GNU/Hurd).
|
* not on some systems (e.g. GNU/Hurd).
|
||||||
|
14
git.c
14
git.c
@ -1,20 +1,8 @@
|
|||||||
#include <stdio.h>
|
#include "builtin.h"
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/stat.h>
|
|
||||||
#include <dirent.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <errno.h>
|
|
||||||
#include <limits.h>
|
|
||||||
#include <stdarg.h>
|
|
||||||
#include "git-compat-util.h"
|
|
||||||
#include "exec_cmd.h"
|
#include "exec_cmd.h"
|
||||||
#include "cache.h"
|
#include "cache.h"
|
||||||
#include "quote.h"
|
#include "quote.h"
|
||||||
|
|
||||||
#include "builtin.h"
|
|
||||||
|
|
||||||
const char git_usage_string[] =
|
const char git_usage_string[] =
|
||||||
"git [--version] [--exec-path[=GIT_EXEC_PATH]] [-p|--paginate] [--bare] [--git-dir=GIT_DIR] [--help] COMMAND [ARGS]";
|
"git [--version] [--exec-path[=GIT_EXEC_PATH]] [-p|--paginate] [--bare] [--git-dir=GIT_DIR] [--help] COMMAND [ARGS]";
|
||||||
|
|
||||||
|
1
grep.c
1
grep.c
@ -1,5 +1,4 @@
|
|||||||
#include "cache.h"
|
#include "cache.h"
|
||||||
#include <regex.h>
|
|
||||||
#include "grep.h"
|
#include "grep.h"
|
||||||
|
|
||||||
void append_grep_pattern(struct grep_opt *opt, const char *pat,
|
void append_grep_pattern(struct grep_opt *opt, const char *pat,
|
||||||
|
3
help.c
3
help.c
@ -3,12 +3,11 @@
|
|||||||
*
|
*
|
||||||
* Builtin help-related commands (help, usage, version)
|
* Builtin help-related commands (help, usage, version)
|
||||||
*/
|
*/
|
||||||
#include <sys/ioctl.h>
|
|
||||||
#include "cache.h"
|
#include "cache.h"
|
||||||
#include "builtin.h"
|
#include "builtin.h"
|
||||||
#include "exec_cmd.h"
|
#include "exec_cmd.h"
|
||||||
#include "common-cmds.h"
|
#include "common-cmds.h"
|
||||||
|
#include <sys/ioctl.h>
|
||||||
|
|
||||||
/* most GUI terminals set COLUMNS (although some don't export it) */
|
/* most GUI terminals set COLUMNS (although some don't export it) */
|
||||||
static int term_columns(void)
|
static int term_columns(void)
|
||||||
|
3
ident.c
3
ident.c
@ -7,9 +7,6 @@
|
|||||||
*/
|
*/
|
||||||
#include "cache.h"
|
#include "cache.h"
|
||||||
|
|
||||||
#include <pwd.h>
|
|
||||||
#include <netdb.h>
|
|
||||||
|
|
||||||
static char git_default_date[50];
|
static char git_default_date[50];
|
||||||
|
|
||||||
static void copy_gecos(struct passwd *w, char *name, int sz)
|
static void copy_gecos(struct passwd *w, char *name, int sz)
|
||||||
|
@ -24,13 +24,6 @@
|
|||||||
|
|
||||||
#include "cache.h"
|
#include "cache.h"
|
||||||
|
|
||||||
#include <assert.h>
|
|
||||||
#include <netinet/in.h>
|
|
||||||
#include <netinet/tcp.h>
|
|
||||||
#include <arpa/inet.h>
|
|
||||||
#include <sys/socket.h>
|
|
||||||
#include <netdb.h>
|
|
||||||
|
|
||||||
typedef struct store_conf {
|
typedef struct store_conf {
|
||||||
char *name;
|
char *name;
|
||||||
const char *path; /* should this be here? its interpretation is driver-specific */
|
const char *path; /* should this be here? its interpretation is driver-specific */
|
||||||
|
@ -1,8 +1,3 @@
|
|||||||
#define _XOPEN_SOURCE 600
|
|
||||||
#include <unistd.h>
|
|
||||||
#include <sys/time.h>
|
|
||||||
#include <signal.h>
|
|
||||||
|
|
||||||
#include "cache.h"
|
#include "cache.h"
|
||||||
#include "delta.h"
|
#include "delta.h"
|
||||||
#include "pack.h"
|
#include "pack.h"
|
||||||
|
@ -2,8 +2,6 @@
|
|||||||
* Copyright 2006 Jon Loeliger
|
* Copyright 2006 Jon Loeliger
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
#include "git-compat-util.h"
|
#include "git-compat-util.h"
|
||||||
#include "interpolate.h"
|
#include "interpolate.h"
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2005, Junio C Hamano
|
* Copyright (c) 2005, Junio C Hamano
|
||||||
*/
|
*/
|
||||||
#include <signal.h>
|
|
||||||
#include "cache.h"
|
#include "cache.h"
|
||||||
|
|
||||||
static struct lock_file *lock_file_list;
|
static struct lock_file *lock_file_list;
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
#include <stdlib.h>
|
|
||||||
#include "cache.h"
|
#include "cache.h"
|
||||||
#include "commit.h"
|
#include "commit.h"
|
||||||
|
|
||||||
|
@ -1,7 +1,3 @@
|
|||||||
#include <sys/types.h>
|
|
||||||
#include <sys/wait.h>
|
|
||||||
#include <signal.h>
|
|
||||||
|
|
||||||
#include "cache.h"
|
#include "cache.h"
|
||||||
|
|
||||||
static const char *pgm;
|
static const char *pgm;
|
||||||
|
@ -3,13 +3,6 @@
|
|||||||
* Fredrik Kuivinen.
|
* Fredrik Kuivinen.
|
||||||
* The thieves were Alex Riesen and Johannes Schindelin, in June/July 2006
|
* The thieves were Alex Riesen and Johannes Schindelin, in June/July 2006
|
||||||
*/
|
*/
|
||||||
#include <stdarg.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <assert.h>
|
|
||||||
#include <sys/wait.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/stat.h>
|
|
||||||
#include <time.h>
|
|
||||||
#include "cache.h"
|
#include "cache.h"
|
||||||
#include "cache-tree.h"
|
#include "cache-tree.h"
|
||||||
#include "commit.h"
|
#include "commit.h"
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
#include <stdio.h>
|
|
||||||
#include "cache.h"
|
#include "cache.h"
|
||||||
#include "path-list.h"
|
#include "path-list.h"
|
||||||
|
|
||||||
|
1
path.c
1
path.c
@ -11,7 +11,6 @@
|
|||||||
* which is what it's designed for.
|
* which is what it's designed for.
|
||||||
*/
|
*/
|
||||||
#include "cache.h"
|
#include "cache.h"
|
||||||
#include <pwd.h>
|
|
||||||
|
|
||||||
static char bad_path[] = "/bad-path/";
|
static char bad_path[] = "/bad-path/";
|
||||||
|
|
||||||
|
@ -6,7 +6,6 @@
|
|||||||
#include "exec_cmd.h"
|
#include "exec_cmd.h"
|
||||||
#include "commit.h"
|
#include "commit.h"
|
||||||
#include "object.h"
|
#include "object.h"
|
||||||
#include <sys/wait.h>
|
|
||||||
|
|
||||||
static const char receive_pack_usage[] = "git-receive-pack <git-dir>";
|
static const char receive_pack_usage[] = "git-receive-pack <git-dir>";
|
||||||
|
|
||||||
|
4
refs.c
4
refs.c
@ -1,10 +1,8 @@
|
|||||||
#include "refs.h"
|
|
||||||
#include "cache.h"
|
#include "cache.h"
|
||||||
|
#include "refs.h"
|
||||||
#include "object.h"
|
#include "object.h"
|
||||||
#include "tag.h"
|
#include "tag.h"
|
||||||
|
|
||||||
#include <errno.h>
|
|
||||||
|
|
||||||
/* ISSYMREF=01 and ISPACKED=02 are public interfaces */
|
/* ISSYMREF=01 and ISPACKED=02 are public interfaces */
|
||||||
#define REF_KNOWS_PEELED 04
|
#define REF_KNOWS_PEELED 04
|
||||||
|
|
||||||
|
@ -6,7 +6,6 @@
|
|||||||
#include "diff.h"
|
#include "diff.h"
|
||||||
#include "refs.h"
|
#include "refs.h"
|
||||||
#include "revision.h"
|
#include "revision.h"
|
||||||
#include <regex.h>
|
|
||||||
#include "grep.h"
|
#include "grep.h"
|
||||||
|
|
||||||
static char *path_name(struct name_path *path, const char *name)
|
static char *path_name(struct name_path *path, const char *name)
|
||||||
|
6
rsh.c
6
rsh.c
@ -1,10 +1,6 @@
|
|||||||
#include <string.h>
|
#include "cache.h"
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/socket.h>
|
|
||||||
|
|
||||||
#include "rsh.h"
|
#include "rsh.h"
|
||||||
#include "quote.h"
|
#include "quote.h"
|
||||||
#include "cache.h"
|
|
||||||
|
|
||||||
#define COMMAND_SIZE 4096
|
#define COMMAND_SIZE 4096
|
||||||
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
#include "cache.h"
|
#include "cache.h"
|
||||||
#include "run-command.h"
|
#include "run-command.h"
|
||||||
#include <sys/wait.h>
|
|
||||||
#include "exec_cmd.h"
|
#include "exec_cmd.h"
|
||||||
|
|
||||||
int run_command_v_opt(int argc, const char **argv, int flags)
|
int run_command_v_opt(int argc, const char **argv, int flags)
|
||||||
|
@ -12,8 +12,6 @@
|
|||||||
#include "rsh.h"
|
#include "rsh.h"
|
||||||
#include "refs.h"
|
#include "refs.h"
|
||||||
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
static unsigned char local_version = 1;
|
static unsigned char local_version = 1;
|
||||||
static unsigned char remote_version;
|
static unsigned char remote_version;
|
||||||
|
|
||||||
|
4
strbuf.c
4
strbuf.c
@ -1,7 +1,5 @@
|
|||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include "strbuf.h"
|
|
||||||
#include "cache.h"
|
#include "cache.h"
|
||||||
|
#include "strbuf.h"
|
||||||
|
|
||||||
void strbuf_init(struct strbuf *sb) {
|
void strbuf_init(struct strbuf *sb) {
|
||||||
sb->buf = NULL;
|
sb->buf = NULL;
|
||||||
|
@ -1,6 +1,3 @@
|
|||||||
#include <stdio.h>
|
|
||||||
#include <time.h>
|
|
||||||
|
|
||||||
#include "cache.h"
|
#include "cache.h"
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
|
@ -8,13 +8,7 @@
|
|||||||
* published by the Free Software Foundation.
|
* published by the Free Software Foundation.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include "git-compat-util.h"
|
||||||
#include <unistd.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <fcntl.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/stat.h>
|
|
||||||
#include <sys/mman.h>
|
|
||||||
#include "delta.h"
|
#include "delta.h"
|
||||||
|
|
||||||
static const char usage[] =
|
static const char usage[] =
|
||||||
|
1
tree.c
1
tree.c
@ -4,7 +4,6 @@
|
|||||||
#include "commit.h"
|
#include "commit.h"
|
||||||
#include "tag.h"
|
#include "tag.h"
|
||||||
#include "tree-walk.h"
|
#include "tree-walk.h"
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
const char *tree_type = "tree";
|
const char *tree_type = "tree";
|
||||||
|
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
#include <signal.h>
|
|
||||||
#include <sys/time.h>
|
|
||||||
#include "cache.h"
|
#include "cache.h"
|
||||||
#include "dir.h"
|
#include "dir.h"
|
||||||
#include "tree.h"
|
#include "tree.h"
|
||||||
|
@ -1,6 +1,3 @@
|
|||||||
#include <signal.h>
|
|
||||||
#include <sys/wait.h>
|
|
||||||
#include <sys/poll.h>
|
|
||||||
#include "cache.h"
|
#include "cache.h"
|
||||||
#include "refs.h"
|
#include "refs.h"
|
||||||
#include "pkt-line.h"
|
#include "pkt-line.h"
|
||||||
|
3
var.c
3
var.c
@ -4,9 +4,6 @@
|
|||||||
* Copyright (C) Eric Biederman, 2005
|
* Copyright (C) Eric Biederman, 2005
|
||||||
*/
|
*/
|
||||||
#include "cache.h"
|
#include "cache.h"
|
||||||
#include <stdio.h>
|
|
||||||
#include <errno.h>
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
static const char var_usage[] = "git-var [-l | <variable>]";
|
static const char var_usage[] = "git-var [-l | <variable>]";
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
|
#include "cache.h"
|
||||||
#include "wt-status.h"
|
#include "wt-status.h"
|
||||||
#include "color.h"
|
#include "color.h"
|
||||||
#include "cache.h"
|
|
||||||
#include "object.h"
|
#include "object.h"
|
||||||
#include "dir.h"
|
#include "dir.h"
|
||||||
#include "commit.h"
|
#include "commit.h"
|
||||||
|
Loading…
Reference in New Issue
Block a user