From: Junio C Hamano Date: Thu, 6 Apr 2023 20:38:31 +0000 (-0700) Subject: Merge branch 'en/header-split-cleanup' X-Git-Tag: v2.41.0-rc0~96 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6047b28eb7e1a0b0061c5310034f7b5683ea401a;p=thirdparty%2Fgit.git Merge branch 'en/header-split-cleanup' Split key function and data structure definitions out of cache.h to new header files and adjust the users. * en/header-split-cleanup: csum-file.h: remove unnecessary inclusion of cache.h write-or-die.h: move declarations for write-or-die.c functions from cache.h treewide: remove cache.h inclusion due to setup.h changes setup.h: move declarations for setup.c functions from cache.h treewide: remove cache.h inclusion due to environment.h changes environment.h: move declarations for environment.c functions from cache.h treewide: remove unnecessary includes of cache.h wrapper.h: move declarations for wrapper.c functions from cache.h path.h: move function declarations for path.c functions from cache.h cache.h: remove expand_user_path() abspath.h: move absolute path functions from cache.h environment: move comment_line_char from cache.h treewide: remove unnecessary cache.h inclusion from several sources treewide: remove unnecessary inclusion of gettext.h treewide: be explicit about dependence on gettext.h treewide: remove unnecessary cache.h inclusion from a few headers --- 6047b28eb7e1a0b0061c5310034f7b5683ea401a diff --cc builtin/pack-objects.c index bfaef00556,9829b952c2..77d88f85b0 --- a/builtin/pack-objects.c +++ b/builtin/pack-objects.c @@@ -39,7 -41,7 +41,8 @@@ #include "shallow.h" #include "promisor-remote.h" #include "pack-mtimes.h" +#include "parse-options.h" + #include "wrapper.h" /* * Objects we are going to pack are collected in the `to_pack` structure. diff --cc builtin/receive-pack.c index 5123c56f9d,3745c0b95c..9109552533 --- a/builtin/receive-pack.c +++ b/builtin/receive-pack.c @@@ -31,7 -34,7 +34,8 @@@ #include "commit-reach.h" #include "worktree.h" #include "shallow.h" +#include "parse-options.h" + #include "wrapper.h" static const char * const receive_pack_usage[] = { N_("git receive-pack "), diff --cc builtin/send-pack.c index 640125fe95,2b360fee42..4784143004 --- a/builtin/send-pack.c +++ b/builtin/send-pack.c @@@ -16,7 -16,7 +16,8 @@@ #include "gpg-interface.h" #include "gettext.h" #include "protocol.h" +#include "parse-options.h" + #include "write-or-die.h" static const char * const send_pack_usage[] = { N_("git send-pack [--mirror] [--dry-run] [--force]\n" diff --cc cache.h index 0ede885656,c43051d792..82d7b112b4 --- a/cache.h +++ b/cache.h @@@ -1103,30 -710,10 +710,8 @@@ extern int quote_path_fully * reentrant, as it calls into other non-reentrant git code. */ const char *repo_find_unique_abbrev(struct repository *r, const struct object_id *oid, int len); -#define find_unique_abbrev(oid, len) repo_find_unique_abbrev(the_repository, oid, len) int repo_find_unique_abbrev_r(struct repository *r, char *hex, const struct object_id *oid, int len); -#define find_unique_abbrev_r(hex, oid, len) repo_find_unique_abbrev_r(the_repository, hex, oid, len) - /* set default permissions by passing mode arguments to open(2) */ - int git_mkstemps_mode(char *pattern, int suffix_len, int mode); - int git_mkstemp_mode(char *pattern, int mode); - - /* - * NOTE NOTE NOTE!! - * - * PERM_UMASK, OLD_PERM_GROUP and OLD_PERM_EVERYBODY enumerations must - * not be changed. Old repositories have core.sharedrepository written in - * numeric format, and therefore these values are preserved for compatibility - * reasons. - */ - enum sharedrepo { - PERM_UMASK = 0, - OLD_PERM_GROUP = 1, - OLD_PERM_EVERYBODY = 2, - PERM_GROUP = 0660, - PERM_EVERYBODY = 0664 - }; - int git_config_perm(const char *var, const char *value); - int adjust_shared_perm(const char *path); - /* * Create the directory containing the named path, using care to be * somewhat safe against races. Return one of the scld_error values to @@@ -1377,9 -911,9 +900,7 @@@ int repo_interpret_branch_name(struct r const char *str, int len, struct strbuf *buf, const struct interpret_branch_name_options *options); -#define interpret_branch_name(str, len, buf, options) \ - repo_interpret_branch_name(the_repository, str, len, buf, options) - int validate_headref(const char *ref); - int base_name_compare(const char *name1, size_t len1, int mode1, const char *name2, size_t len2, int mode2); int df_name_compare(const char *name1, size_t len1, int mode1, diff --cc diagnose.c index 998f517c48,f9a2496c7f..f1aebf0b50 --- a/diagnose.c +++ b/diagnose.c @@@ -8,7 -9,7 +9,8 @@@ #include "strvec.h" #include "object-store.h" #include "packfile.h" +#include "parse-options.h" + #include "write-or-die.h" struct archive_dir { const char *path; diff --cc list-objects-filter-options.h index 727c986122,65c6119e9d..f620612586 --- a/list-objects-filter-options.h +++ b/list-objects-filter-options.h @@@ -1,7 -1,9 +1,8 @@@ #ifndef LIST_OBJECTS_FILTER_OPTIONS_H #define LIST_OBJECTS_FILTER_OPTIONS_H + #include "gettext.h" #include "object.h" -#include "parse-options.h" #include "string-list.h" #include "strbuf.h" diff --cc mailmap.c index a302335129,c24a16eaf4..74fd9db448 --- a/mailmap.c +++ b/mailmap.c @@@ -2,7 -3,18 +3,8 @@@ #include "string-list.h" #include "mailmap.h" #include "object-store.h" + #include "setup.h" -#define DEBUG_MAILMAP 0 -#if DEBUG_MAILMAP -#define debug_mm(...) fprintf(stderr, __VA_ARGS__) -#define debug_str(X) ((X) ? (X) : "(none)") -#else -__attribute__((format (printf, 1, 2))) -static inline void debug_mm(const char *format, ...) {} -static inline const char *debug_str(const char *s) { return s; } -#endif - const char *git_mailmap_file; const char *git_mailmap_blob; diff --cc send-pack.c index a3c10898db,11f41a8d81..f81bbb28d7 --- a/send-pack.c +++ b/send-pack.c @@@ -15,9 -16,9 +16,10 @@@ #include "version.h" #include "oid-array.h" #include "gpg-interface.h" - #include "cache.h" #include "shallow.h" +#include "parse-options.h" + #include "trace2.h" + #include "write-or-die.h" int option_parse_push_signed(const struct option *opt, const char *arg, int unset) diff --cc t/helper/test-dump-fsmonitor.c index 3d2fb92ade,7e9de296db..7c6f50158b --- a/t/helper/test-dump-fsmonitor.c +++ b/t/helper/test-dump-fsmonitor.c @@@ -1,7 -1,8 +1,8 @@@ #include "test-tool.h" #include "cache.h" + #include "setup.h" -int cmd__dump_fsmonitor(int ac, const char **av) +int cmd__dump_fsmonitor(int ac UNUSED, const char **av UNUSED) { struct index_state *istate = the_repository->index; int i; diff --cc t/helper/test-fsmonitor-client.c index 0a1e492e5b,a37236cd0a..14522b4c47 --- a/t/helper/test-fsmonitor-client.c +++ b/t/helper/test-fsmonitor-client.c @@@ -7,11 -7,13 +7,13 @@@ #include "cache.h" #include "parse-options.h" #include "fsmonitor-ipc.h" + #include "setup.h" #include "thread-utils.h" #include "trace2.h" + #include "wrapper.h" #ifndef HAVE_FSMONITOR_DAEMON_BACKEND -int cmd__fsmonitor_client(int argc, const char **argv) +int cmd__fsmonitor_client(int argc UNUSED, const char **argv UNUSED) { die("fsmonitor--daemon not available on this platform"); } diff --cc t/helper/test-match-trees.c index 42b20d0cec,64705734df..508eb7066a --- a/t/helper/test-match-trees.c +++ b/t/helper/test-match-trees.c @@@ -1,9 -1,10 +1,10 @@@ #include "test-tool.h" #include "cache.h" #include "hex.h" + #include "setup.h" #include "tree.h" -int cmd__match_trees(int ac, const char **av) +int cmd__match_trees(int ac UNUSED, const char **av) { struct object_id hash1, hash2, shifted; struct tree *one, *two; diff --cc t/helper/test-oidtree.c index 6a18e1bce8,edcb7e9f44..5b98f2f70a --- a/t/helper/test-oidtree.c +++ b/t/helper/test-oidtree.c @@@ -2,8 -2,9 +2,9 @@@ #include "cache.h" #include "hex.h" #include "oidtree.h" + #include "setup.h" -static enum cb_next print_oid(const struct object_id *oid, void *data) +static enum cb_next print_oid(const struct object_id *oid, void *data UNUSED) { puts(oid_to_hex(oid)); return CB_CONTINUE; diff --cc t/helper/test-read-graph.c index f92aea9d1f,78965a6ebd..3ac496e27e --- a/t/helper/test-read-graph.c +++ b/t/helper/test-read-graph.c @@@ -4,8 -3,9 +3,9 @@@ #include "repository.h" #include "object-store.h" #include "bloom.h" + #include "setup.h" -int cmd__read_graph(int argc, const char **argv) +int cmd__read_graph(int argc UNUSED, const char **argv UNUSED) { struct commit_graph *graph = NULL; struct object_directory *odb;