Merge branch 'js/find-lib-h-with-ls-files-when-possible'
authorJunio C Hamano <gitster@pobox.com>
Mon, 11 Mar 2019 07:16:25 +0000 (16:16 +0900)
committerJunio C Hamano <gitster@pobox.com>
Mon, 11 Mar 2019 07:16:25 +0000 (16:16 +0900)
The Makefile uses 'find' utility to enumerate all the *.h header
files, which is expensive on platforms with slow filesystems; it
now optionally uses "ls-files" if working within a repository,
which is a trick similar to how all sources are enumerated to run
ETAGS on.

* js/find-lib-h-with-ls-files-when-possible:
Makefile: use `git ls-files` to list header files, if possible

1  2 
Makefile
diff --combined Makefile
index acd6791faadb2b3b775d6706ff6c5dd69a09260c,0c4712cb489f88f06d1afe65368a7a77f19acf0a..537493822b10e704f541f19129aa64e4f2e78da7
+++ b/Makefile
@@@ -773,7 -773,6 +773,7 @@@ TEST_BUILTINS_OBJS += test-string-list.
  TEST_BUILTINS_OBJS += test-submodule-config.o
  TEST_BUILTINS_OBJS += test-submodule-nested-repo-config.o
  TEST_BUILTINS_OBJS += test-subprocess.o
 +TEST_BUILTINS_OBJS += test-trace2.o
  TEST_BUILTINS_OBJS += test-urlmatch-normalization.o
  TEST_BUILTINS_OBJS += test-xml-encode.o
  TEST_BUILTINS_OBJS += test-wildmatch.o
@@@ -842,7 -841,8 +842,8 @@@ VCSSVN_LIB = vcs-svn/lib.
  
  GENERATED_H += command-list.h
  
- LIB_H = $(shell $(FIND) . \
+ LIB_H := $(shell git ls-files '*.h' ':!t/' ':!Documentation/' 2>/dev/null || \
+       $(FIND) . \
        -name .git -prune -o \
        -name t -prune -o \
        -name Documentation -prune -o \
@@@ -1018,16 -1018,6 +1019,16 @@@ LIB_OBJS += tempfile.
  LIB_OBJS += thread-utils.o
  LIB_OBJS += tmp-objdir.o
  LIB_OBJS += trace.o
 +LIB_OBJS += trace2.o
 +LIB_OBJS += trace2/tr2_cfg.o
 +LIB_OBJS += trace2/tr2_cmd_name.o
 +LIB_OBJS += trace2/tr2_dst.o
 +LIB_OBJS += trace2/tr2_sid.o
 +LIB_OBJS += trace2/tr2_tbuf.o
 +LIB_OBJS += trace2/tr2_tgt_event.o
 +LIB_OBJS += trace2/tr2_tgt_normal.o
 +LIB_OBJS += trace2/tr2_tgt_perf.o
 +LIB_OBJS += trace2/tr2_tls.o
  LIB_OBJS += trailer.o
  LIB_OBJS += transport.o
  LIB_OBJS += transport-helper.o
@@@ -1607,9 -1597,7 +1608,9 @@@ ifdef NO_INET_PTO
        LIB_OBJS += compat/inet_pton.o
        BASIC_CFLAGS += -DNO_INET_PTON
  endif
 -ifndef NO_UNIX_SOCKETS
 +ifdef NO_UNIX_SOCKETS
 +      BASIC_CFLAGS += -DNO_UNIX_SOCKETS
 +else
        LIB_OBJS += unix-socket.o
        PROGRAM_OBJS += credential-cache.o
        PROGRAM_OBJS += credential-cache--daemon.o
@@@ -2376,7 -2364,7 +2377,7 @@@ els
  # should _not_ be included here, since they are necessary even when
  # building an object for the first time.
  
- $(OBJECTS): $(LIB_H)
+ $(OBJECTS): $(LIB_H) $(GENERATED_H)
  endif
  
  exec-cmd.sp exec-cmd.s exec-cmd.o: GIT-PREFIX
@@@ -2749,10 -2737,7 +2750,10 @@@ $(SP_OBJ): %.sp: %.c GIT-CFLAGS FORC
  sparse: $(SP_OBJ)
  
  GEN_HDRS := command-list.h unicode-width.h
 -EXCEPT_HDRS := $(GEN_HDRS) compat% xdiff%
 +EXCEPT_HDRS := $(GEN_HDRS) compat/% xdiff/%
 +ifndef GCRYPT_SHA256
 +      EXCEPT_HDRS += sha256/gcrypt.h
 +endif
  CHK_HDRS = $(filter-out $(EXCEPT_HDRS),$(patsubst ./%,%,$(LIB_H)))
  HCO = $(patsubst %.h,%.hco,$(CHK_HDRS))