]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'dl/honor-cflags-in-hdr-check'
authorJunio C Hamano <gitster@pobox.com>
Mon, 7 Oct 2019 02:33:02 +0000 (11:33 +0900)
committerJunio C Hamano <gitster@pobox.com>
Mon, 7 Oct 2019 02:33:02 +0000 (11:33 +0900)
Dev support.

* dl/honor-cflags-in-hdr-check:
  ci: run `hdr-check` as part of the `Static Analysis` job
  Makefile: emulate compile in $(HCO) target better
  pack-bitmap.h: remove magic number
  promisor-remote.h: include missing header
  apply.h: include missing header

1  2 
.gitignore
Makefile
azure-pipelines.yml
ci/install-dependencies.sh
promisor-remote.h

diff --combined .gitignore
index fc445edea9d3497b72c16629b0729c75d1ebae28,34efe125cbd756000a9206a6f4d307303c446736..89b3b79c1a2278f0aff1fefa0a79caeeeb0d0bfc
  /tags
  /TAGS
  /cscope*
+ *.hcc
  *.obj
  *.lib
  *.res
  *.ipdb
  *.dll
  .vs/
 -*.manifest
  Debug/
  Release/
  /UpgradeLog*.htm
diff --combined Makefile
index 8c37e5412d992d8f21d8c7829ae9d051a10ce4ec,581cc617e37e2441e10e33afb88c96c75693cf72..d644527d37d91c70368a39a52fd0d267c5be76c2
+++ b/Makefile
@@@ -598,7 -598,6 +598,7 @@@ SCRIPT_SH 
  SCRIPT_LIB =
  TEST_BUILTINS_OBJS =
  TEST_PROGRAMS_NEED_X =
 +THIRD_PARTY_SOURCES =
  
  # Having this variable in your environment would break pipelines because
  # you cause "cd" to echo its destination to stdout.  It can also take
@@@ -729,7 -728,6 +729,7 @@@ TEST_BUILTINS_OBJS += test-parse-option
  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-progress.o
  TEST_BUILTINS_OBJS += test-reach.o
  TEST_BUILTINS_OBJS += test-read-cache.o
  TEST_BUILTINS_OBJS += test-read-midx.o
@@@ -820,12 -818,12 +820,12 @@@ VCSSVN_LIB = vcs-svn/lib.
  
  GENERATED_H += command-list.h
  
 -LIB_H := $(sort $(shell git ls-files '*.h' ':!t/' ':!Documentation/' 2>/dev/null || \
 +LIB_H := $(sort $(patsubst ./%,%,$(shell git ls-files '*.h' ':!t/' ':!Documentation/' 2>/dev/null || \
        $(FIND) . \
        -name .git -prune -o \
        -name t -prune -o \
        -name Documentation -prune -o \
 -      -name '*.h' -print))
 +      -name '*.h' -print)))
  
  LIB_OBJS += abspath.o
  LIB_OBJS += advice.o
@@@ -1148,20 -1146,6 +1148,20 @@@ BUILTIN_OBJS += builtin/verify-tag.
  BUILTIN_OBJS += builtin/worktree.o
  BUILTIN_OBJS += builtin/write-tree.o
  
 +# THIRD_PARTY_SOURCES is a list of patterns compatible with the
 +# $(filter) and $(filter-out) family of functions. They specify source
 +# files which are taken from some third-party source where we want to be
 +# less strict about issues such as coding style so we don't diverge from
 +# upstream unnecessarily (making merging in future changes easier).
 +THIRD_PARTY_SOURCES += compat/inet_ntop.c
 +THIRD_PARTY_SOURCES += compat/inet_pton.c
 +THIRD_PARTY_SOURCES += compat/nedmalloc/%
 +THIRD_PARTY_SOURCES += compat/obstack.%
 +THIRD_PARTY_SOURCES += compat/poll/%
 +THIRD_PARTY_SOURCES += compat/regex/%
 +THIRD_PARTY_SOURCES += sha1collisiondetection/%
 +THIRD_PARTY_SOURCES += sha1dc/%
 +
  GITLIBS = common-main.o $(LIB_FILE) $(XDIFF_LIB)
  EXTLIBS =
  
@@@ -1888,7 -1872,7 +1888,7 @@@ ifndef 
        QUIET_MSGFMT   = @echo '   ' MSGFMT $@;
        QUIET_GCOV     = @echo '   ' GCOV $@;
        QUIET_SP       = @echo '   ' SP $<;
-       QUIET_HDR      = @echo '   ' HDR $<;
+       QUIET_HDR      = @echo '   ' HDR $(<:hcc=h);
        QUIET_RC       = @echo '   ' RC $@;
        QUIET_SUBDIR0  = +@subdir=
        QUIET_SUBDIR1  = ;$(NO_SUBDIR) echo '   ' SUBDIR $$subdir; \
@@@ -2616,7 -2600,6 +2616,7 @@@ FIND_SOURCE_FILES = ( 
                -o \( -name 'trash*' -type d -prune \) \
                -o \( -name '*.[hcS]' -type f -print \) \
                -o \( -name '*.sh' -type f -print \) \
 +              | sed -e 's|^\./||' \
        )
  
  $(ETAGS_TARGET): FORCE
@@@ -2786,11 -2769,16 +2786,16 @@@ EXCEPT_HDRS := $(GEN_HDRS) compat/% xdi
  ifndef GCRYPT_SHA256
        EXCEPT_HDRS += sha256/gcrypt.h
  endif
 -CHK_HDRS = $(filter-out $(EXCEPT_HDRS),$(patsubst ./%,%,$(LIB_H)))
 +CHK_HDRS = $(filter-out $(EXCEPT_HDRS),$(LIB_H))
  HCO = $(patsubst %.h,%.hco,$(CHK_HDRS))
+ HCC = $(HCO:hco=hcc)
  
- $(HCO): %.hco: %.h FORCE
-       $(QUIET_HDR)$(CC) -include git-compat-util.h -I. -o /dev/null -c -xc $<
+ %.hcc: %.h
+       @echo '#include "git-compat-util.h"' >$@
+       @echo '#include "$<"' >>$@
+ $(HCO): %.hco: %.hcc FORCE
+       $(QUIET_HDR)$(CC) $(ALL_CFLAGS) -o /dev/null -c -xc $<
  
  .PHONY: hdr-check $(HCO)
  hdr-check: $(HCO)
@@@ -2809,8 -2797,12 +2814,8 @@@ check: command-list.
                exit 1; \
        fi
  
 -C_SOURCES = $(patsubst %.o,%.c,$(C_OBJ))
 -ifdef DC_SHA1_SUBMODULE
 -COCCI_SOURCES = $(filter-out sha1collisiondetection/%,$(C_SOURCES))
 -else
 -COCCI_SOURCES = $(filter-out sha1dc/%,$(C_SOURCES))
 -endif
 +FOUND_C_SOURCES = $(filter %.c,$(shell $(FIND_SOURCE_FILES)))
 +COCCI_SOURCES = $(filter-out $(THIRD_PARTY_SOURCES),$(FOUND_C_SOURCES))
  
  %.cocci.patch: %.cocci $(COCCI_SOURCES)
        @echo '    ' SPATCH $<; \
@@@ -3095,6 -3087,7 +3100,7 @@@ clean: profile-clean coverage-clean coc
        $(RM) $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) git$X
        $(RM) $(TEST_PROGRAMS)
        $(RM) $(FUZZ_PROGRAMS)
+       $(RM) $(HCC)
        $(RM) -r bin-wrappers $(dep_dirs)
        $(RM) -r po/build/
        $(RM) *.pyc *.pyo */*.pyc */*.pyo command-list.h $(ETAGS_TARGET) tags cscope*
diff --combined azure-pipelines.yml
index 34031b182aefa06f8b5ed387f7102bb2a1d43b7c,1d4bcbda658aaa83de0582a7ccbf6b70a2df0419..cb9ab1ef800d1da1a683ac3e55d8ac3a91259d62
@@@ -354,7 -354,7 +354,7 @@@ jobs
         test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1
  
         sudo apt-get update &&
-        sudo apt-get install -y coccinelle &&
+        sudo apt-get install -y coccinelle libcurl4-openssl-dev libssl-dev libexpat-dev gettext &&
  
         export jobname=StaticAnalysis &&
  
         test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1
  
         sudo apt-get update &&
 -       sudo apt-get install -y asciidoc xmlto asciidoctor &&
 +       sudo apt-get install -y asciidoc xmlto asciidoctor docbook-xsl-ns &&
  
         export ALREADY_HAVE_ASCIIDOCTOR=yes. &&
         export jobname=Documentation &&
index a76f348484143d9f031f90405bc2dacaab0435a1,8ce9ce276e4dd2b66389a21151bf93b4de6a75d9..85a9d6b15cdc539e4995a05483cfcefa105c36ab
@@@ -49,11 -49,12 +49,12 @@@ osx-clang|osx-gcc
        ;;
  StaticAnalysis)
        sudo apt-get -q update
-       sudo apt-get -q -y install coccinelle
+       sudo apt-get -q -y install coccinelle libcurl4-openssl-dev libssl-dev \
+               libexpat-dev gettext
        ;;
  Documentation)
        sudo apt-get -q update
 -      sudo apt-get -q -y install asciidoc xmlto
 +      sudo apt-get -q -y install asciidoc xmlto docbook-xsl-ns
  
        test -n "$ALREADY_HAVE_ASCIIDOCTOR" ||
        gem install --version 1.5.8 asciidoctor
diff --combined promisor-remote.h
index c60aaa5cce4b01998d9d2e95a3555b55ce7cd555,76e8d86c7cfd5228c20ace2a244d15c682d25619..737bac3a330e22fe11058d5667cdb3f199c0484a
@@@ -1,6 -1,8 +1,8 @@@
  #ifndef PROMISOR_REMOTE_H
  #define PROMISOR_REMOTE_H
  
+ #include "repository.h"
  struct object_id;
  
  /*
@@@ -15,17 -17,17 +17,17 @@@ struct promisor_remote 
        const char name[FLEX_ARRAY];
  };
  
 -extern void promisor_remote_reinit(void);
 -extern struct promisor_remote *promisor_remote_find(const char *remote_name);
 -extern int has_promisor_remote(void);
 -extern int promisor_remote_get_direct(struct repository *repo,
 -                                    const struct object_id *oids,
 -                                    int oid_nr);
 +void promisor_remote_reinit(void);
 +struct promisor_remote *promisor_remote_find(const char *remote_name);
 +int has_promisor_remote(void);
 +int promisor_remote_get_direct(struct repository *repo,
 +                             const struct object_id *oids,
 +                             int oid_nr);
  
  /*
   * This should be used only once from setup.c to set the value we got
   * from the extensions.partialclone config option.
   */
 -extern void set_repository_format_partial_clone(char *partial_clone);
 +void set_repository_format_partial_clone(char *partial_clone);
  
  #endif /* PROMISOR_REMOTE_H */