From: Junio C Hamano Date: Tue, 16 Oct 2018 07:16:00 +0000 (+0900) Subject: Merge branch 'rj/header-check' X-Git-Tag: v2.20.0-rc0~188 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/ff6bbce6e3dd89a5852ddb657554f9209091202e?hp=-c Merge branch 'rj/header-check' Header files clean-up. * rj/header-check: delta-islands.h: add missing forward declarations (hdr-check) midx.h: add missing forward declarations (hdr-check) refs/refs-internal.h: add missing declarations (hdr-check) refs/packed-backend.h: add missing declaration (hdr-check) refs/ref-cache.h: add missing declarations (hdr-check) ewah/ewok_rlw.h: add missing include (hdr-check) json-writer.h: add missing include (hdr-check) Makefile: add a hdr-check target --- ff6bbce6e3dd89a5852ddb657554f9209091202e diff --combined Makefile index 5c8307b7c4,835030e22b..5bf1af369e --- a/Makefile +++ b/Makefile @@@ -709,9 -709,7 +709,9 @@@ TEST_BUILTINS_OBJS += test-date. TEST_BUILTINS_OBJS += test-delta.o TEST_BUILTINS_OBJS += test-drop-caches.o TEST_BUILTINS_OBJS += test-dump-cache-tree.o +TEST_BUILTINS_OBJS += test-dump-fsmonitor.o TEST_BUILTINS_OBJS += test-dump-split-index.o +TEST_BUILTINS_OBJS += test-dump-untracked-cache.o TEST_BUILTINS_OBJS += test-example-decorate.o TEST_BUILTINS_OBJS += test-genrandom.o TEST_BUILTINS_OBJS += test-hashmap.o @@@ -722,9 -720,7 +722,9 @@@ TEST_BUILTINS_OBJS += test-match-trees. TEST_BUILTINS_OBJS += test-mergesort.o TEST_BUILTINS_OBJS += test-mktemp.o TEST_BUILTINS_OBJS += test-online-cpus.o +TEST_BUILTINS_OBJS += test-parse-options.o TEST_BUILTINS_OBJS += test-path-utils.o +TEST_BUILTINS_OBJS += test-pkt-line.o TEST_BUILTINS_OBJS += test-prio-queue.o TEST_BUILTINS_OBJS += test-reach.o TEST_BUILTINS_OBJS += test-read-cache.o @@@ -735,8 -731,8 +735,8 @@@ TEST_BUILTINS_OBJS += test-repository. TEST_BUILTINS_OBJS += test-revision-walking.o TEST_BUILTINS_OBJS += test-run-command.o TEST_BUILTINS_OBJS += test-scrap-cache-tree.o -TEST_BUILTINS_OBJS += test-sha1-array.o TEST_BUILTINS_OBJS += test-sha1.o +TEST_BUILTINS_OBJS += test-sha1-array.o TEST_BUILTINS_OBJS += test-sigchain.o TEST_BUILTINS_OBJS += test-strcmp-offset.o TEST_BUILTINS_OBJS += test-string-list.o @@@ -744,13 -740,14 +744,13 @@@ TEST_BUILTINS_OBJS += test-submodule-co TEST_BUILTINS_OBJS += test-subprocess.o TEST_BUILTINS_OBJS += test-urlmatch-normalization.o TEST_BUILTINS_OBJS += test-wildmatch.o +TEST_BUILTINS_OBJS += test-windows-named-pipe.o TEST_BUILTINS_OBJS += test-write-cache.o -TEST_PROGRAMS_NEED_X += test-dump-fsmonitor -TEST_PROGRAMS_NEED_X += test-dump-untracked-cache +# Do not add more tests here unless they have extra dependencies. Add +# them in TEST_BUILTINS_OBJS above. TEST_PROGRAMS_NEED_X += test-fake-ssh TEST_PROGRAMS_NEED_X += test-line-buffer -TEST_PROGRAMS_NEED_X += test-parse-options -TEST_PROGRAMS_NEED_X += test-pkt-line TEST_PROGRAMS_NEED_X += test-svn-fe TEST_PROGRAMS_NEED_X += test-tool @@@ -1796,6 -1793,7 +1796,7 @@@ ifndef QUIET_MSGFMT = @echo ' ' MSGFMT $@; QUIET_GCOV = @echo ' ' GCOV $@; QUIET_SP = @echo ' ' SP $<; + QUIET_HDR = @echo ' ' HDR $<; QUIET_RC = @echo ' ' RC $@; QUIET_SUBDIR0 = +@subdir= QUIET_SUBDIR1 = ;$(NO_SUBDIR) echo ' ' SUBDIR $$subdir; \ @@@ -2678,6 -2676,17 +2679,17 @@@ $(SP_OBJ): %.sp: %.c GIT-CFLAGS FORC .PHONY: sparse $(SP_OBJ) sparse: $(SP_OBJ) + GEN_HDRS := command-list.h unicode-width.h + EXCEPT_HDRS := $(GEN_HDRS) compat% xdiff% + CHK_HDRS = $(filter-out $(EXCEPT_HDRS),$(patsubst ./%,%,$(LIB_H))) + HCO = $(patsubst %.h,%.hco,$(CHK_HDRS)) + + $(HCO): %.hco: %.h FORCE + $(QUIET_HDR)$(CC) -include git-compat-util.h -I. -o /dev/null -c -xc $< + + .PHONY: hdr-check $(HCO) + hdr-check: $(HCO) + .PHONY: style style: git clang-format --style file --diff --extensions c,h diff --combined midx.h index ce80b91c68,622ddac472..2d7c9c6cd1 --- a/midx.h +++ b/midx.h @@@ -3,6 -3,9 +3,9 @@@ #include "repository.h" + struct object_id; + struct pack_entry; + struct multi_pack_index { struct multi_pack_index *next; @@@ -43,6 -46,5 +46,6 @@@ int prepare_multi_pack_index_one(struc int write_midx_file(const char *object_dir); void clear_midx_file(const char *object_dir); +int verify_midx_file(const char *object_dir); #endif diff --combined refs/refs-internal.h index b425ae40b1,44d53672c7..f2d8c0123a --- a/refs/refs-internal.h +++ b/refs/refs-internal.h @@@ -1,8 -1,12 +1,12 @@@ #ifndef REFS_REFS_INTERNAL_H #define REFS_REFS_INTERNAL_H + #include "cache.h" + #include "refs.h" #include "iterator.h" + struct ref_transaction; + /* * Data structures and functions for the internal use of the refs * module. Code outside of the refs module should use only the public @@@ -282,7 -286,7 +286,7 @@@ int refs_rename_ref_available(struct re * * // Access information about the current reference: * if (!(iter->flags & REF_ISSYMREF)) - * printf("%s is %s\n", iter->refname, oid_to_hex(&iter->oid)); + * printf("%s is %s\n", iter->refname, oid_to_hex(iter->oid)); * * // If you need to peel the reference: * ref_iterator_peel(iter, &oid); @@@ -474,9 -478,8 +478,9 @@@ extern struct ref_iterator *current_ref * adapter between the callback style of reference iteration and the * iterator style. */ -int do_for_each_ref_iterator(struct ref_iterator *iter, - each_ref_fn fn, void *cb_data); +int do_for_each_repo_ref_iterator(struct repository *r, + struct ref_iterator *iter, + each_repo_ref_fn fn, void *cb_data); /* * Only include per-worktree refs in a do_for_each_ref*() iteration.