Merge branch 'sg/help-group' into maint
authorJunio C Hamano <gitster@pobox.com>
Fri, 4 Sep 2015 02:17:51 +0000 (19:17 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 4 Sep 2015 02:17:51 +0000 (19:17 -0700)
We rewrote one of the build scripts in Perl but this reimplements
in Bourne shell.

* sg/help-group:
generate-cmdlist: re-implement as shell script

1  2 
Makefile
diff --combined Makefile
index 8c3c724a7f5e0594ad836065757371f7a144c472,e564c0e39b5d0e4c61e470365ca289e896868f61..ce0cfe2a48e002c786de66ad1bf400553b1765f2
+++ b/Makefile
@@@ -217,11 -217,10 +217,11 @@@ all:
  # as the compiler can crash (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49299)
  #
  # Define USE_NSEC below if you want git to care about sub-second file mtimes
 -# and ctimes. Note that you need recent glibc (at least 2.2.4) for this, and
 -# it will BREAK YOUR LOCAL DIFFS! show-diff and anything using it will likely
 -# randomly break unless your underlying filesystem supports those sub-second
 -# times (my ext3 doesn't).
 +# and ctimes. Note that you need recent glibc (at least 2.2.4) for this. On
 +# Linux, kernel 2.6.11 or newer is required for reliable sub-second file times
 +# on file systems with exactly 1 ns or 1 s resolution. If you intend to use Git
 +# on other file systems (e.g. CEPH, CIFS, NTFS, UDF), don't enable USE_NSEC. See
 +# Documentation/technical/racy-git.txt for details.
  #
  # Define USE_ST_TIMESPEC if your "struct stat" uses "st_ctimespec" instead of
  # "st_ctim"
  # compiler is detected to support it.
  #
  # Define HAVE_BSD_SYSCTL if your platform has a BSD-compatible sysctl function.
 +#
 +# Define HAVE_GETDELIM if your system has the getdelim() function.
  
  GIT-VERSION-FILE: FORCE
        @$(SHELL_PATH) ./GIT-VERSION-GEN
@@@ -575,7 -572,6 +575,7 @@@ TEST_PROGRAMS_NEED_X += test-dat
  TEST_PROGRAMS_NEED_X += test-delta
  TEST_PROGRAMS_NEED_X += test-dump-cache-tree
  TEST_PROGRAMS_NEED_X += test-dump-split-index
 +TEST_PROGRAMS_NEED_X += test-dump-untracked-cache
  TEST_PROGRAMS_NEED_X += test-genrandom
  TEST_PROGRAMS_NEED_X += test-hashmap
  TEST_PROGRAMS_NEED_X += test-index-version
@@@ -910,7 -906,6 +910,7 @@@ BUILTIN_OBJS += builtin/var.
  BUILTIN_OBJS += builtin/verify-commit.o
  BUILTIN_OBJS += builtin/verify-pack.o
  BUILTIN_OBJS += builtin/verify-tag.o
 +BUILTIN_OBJS += builtin/worktree.o
  BUILTIN_OBJS += builtin/write-tree.o
  
  GITLIBS = $(LIB_FILE) $(XDIFF_LIB)
@@@ -1442,10 -1437,6 +1442,10 @@@ ifdef HAVE_BSD_SYSCT
        BASIC_CFLAGS += -DHAVE_BSD_SYSCTL
  endif
  
 +ifdef HAVE_GETDELIM
 +      BASIC_CFLAGS += -DHAVE_GETDELIM
 +endif
 +
  ifeq ($(TCLTK_PATH),)
  NO_TCLTK = NoThanks
  endif
@@@ -1696,10 -1687,10 +1696,10 @@@ $(BUILT_INS): git$
        ln -s $< $@ 2>/dev/null || \
        cp $< $@
  
- common-cmds.h: generate-cmdlist.perl command-list.txt
+ common-cmds.h: generate-cmdlist.sh command-list.txt
  
  common-cmds.h: $(wildcard Documentation/git-*.txt)
-       $(QUIET_GEN)$(PERL_PATH) generate-cmdlist.perl command-list.txt > $@+ && mv $@+ $@
+       $(QUIET_GEN)./generate-cmdlist.sh command-list.txt >$@+ && mv $@+ $@
  
  SCRIPT_DEFINES = $(SHELL_PATH_SQ):$(DIFF_SQ):$(GIT_VERSION):\
        $(localedir_SQ):$(NO_CURL):$(USE_GETTEXT_SCHEME):$(SANE_TOOL_PATH_SQ):\
@@@ -1749,7 -1740,7 +1749,7 @@@ $(SCRIPT_PERL_GEN): perl/perl.ma
  perl/perl.mak: perl/PM.stamp
  
  perl/PM.stamp: FORCE
 -      $(QUIET_GEN)$(FIND) perl -type f -name '*.pm' | sort >$@+ && \
 +      @$(FIND) perl -type f -name '*.pm' | sort >$@+ && \
        { cmp $@+ $@ >/dev/null 2>/dev/null || mv $@+ $@; } && \
        $(RM) $@+
  
@@@ -1786,7 -1777,7 +1786,7 @@@ GIT-PERL-DEFINES: FORC
  gitweb:
        $(QUIET_SUBDIR0)gitweb $(QUIET_SUBDIR1) all
  
 -git-instaweb: git-instaweb.sh gitweb GIT-SCRIPT-DEFINES
 +git-instaweb: git-instaweb.sh GIT-SCRIPT-DEFINES
        $(QUIET_GEN)$(cmd_munge_script) && \
        chmod +x $@+ && \
        mv $@+ $@
@@@ -2105,47 -2096,45 +2105,47 @@@ GIT-LDFLAGS: FORC
  # that runs GIT-BUILD-OPTIONS, and then again to protect it
  # and the first level quoting from the shell that runs "echo".
  GIT-BUILD-OPTIONS: FORCE
 -      @echo SHELL_PATH=\''$(subst ','\'',$(SHELL_PATH_SQ))'\' >$@
 -      @echo PERL_PATH=\''$(subst ','\'',$(PERL_PATH_SQ))'\' >>$@
 -      @echo DIFF=\''$(subst ','\'',$(subst ','\'',$(DIFF)))'\' >>$@
 -      @echo PYTHON_PATH=\''$(subst ','\'',$(PYTHON_PATH_SQ))'\' >>$@
 -      @echo TAR=\''$(subst ','\'',$(subst ','\'',$(TAR)))'\' >>$@
 -      @echo NO_CURL=\''$(subst ','\'',$(subst ','\'',$(NO_CURL)))'\' >>$@
 -      @echo USE_LIBPCRE=\''$(subst ','\'',$(subst ','\'',$(USE_LIBPCRE)))'\' >>$@
 -      @echo NO_PERL=\''$(subst ','\'',$(subst ','\'',$(NO_PERL)))'\' >>$@
 -      @echo NO_PYTHON=\''$(subst ','\'',$(subst ','\'',$(NO_PYTHON)))'\' >>$@
 -      @echo NO_UNIX_SOCKETS=\''$(subst ','\'',$(subst ','\'',$(NO_UNIX_SOCKETS)))'\' >>$@
 +      @echo SHELL_PATH=\''$(subst ','\'',$(SHELL_PATH_SQ))'\' >$@+
 +      @echo PERL_PATH=\''$(subst ','\'',$(PERL_PATH_SQ))'\' >>$@+
 +      @echo DIFF=\''$(subst ','\'',$(subst ','\'',$(DIFF)))'\' >>$@+
 +      @echo PYTHON_PATH=\''$(subst ','\'',$(PYTHON_PATH_SQ))'\' >>$@+
 +      @echo TAR=\''$(subst ','\'',$(subst ','\'',$(TAR)))'\' >>$@+
 +      @echo NO_CURL=\''$(subst ','\'',$(subst ','\'',$(NO_CURL)))'\' >>$@+
 +      @echo NO_EXPAT=\''$(subst ','\'',$(subst ','\'',$(NO_EXPAT)))'\' >>$@+
 +      @echo USE_LIBPCRE=\''$(subst ','\'',$(subst ','\'',$(USE_LIBPCRE)))'\' >>$@+
 +      @echo NO_PERL=\''$(subst ','\'',$(subst ','\'',$(NO_PERL)))'\' >>$@+
 +      @echo NO_PYTHON=\''$(subst ','\'',$(subst ','\'',$(NO_PYTHON)))'\' >>$@+
 +      @echo NO_UNIX_SOCKETS=\''$(subst ','\'',$(subst ','\'',$(NO_UNIX_SOCKETS)))'\' >>$@+
  ifdef TEST_OUTPUT_DIRECTORY
 -      @echo TEST_OUTPUT_DIRECTORY=\''$(subst ','\'',$(subst ','\'',$(TEST_OUTPUT_DIRECTORY)))'\' >>$@
 +      @echo TEST_OUTPUT_DIRECTORY=\''$(subst ','\'',$(subst ','\'',$(TEST_OUTPUT_DIRECTORY)))'\' >>$@+
  endif
  ifdef GIT_TEST_OPTS
 -      @echo GIT_TEST_OPTS=\''$(subst ','\'',$(subst ','\'',$(GIT_TEST_OPTS)))'\' >>$@
 +      @echo GIT_TEST_OPTS=\''$(subst ','\'',$(subst ','\'',$(GIT_TEST_OPTS)))'\' >>$@+
  endif
  ifdef GIT_TEST_CMP
 -      @echo GIT_TEST_CMP=\''$(subst ','\'',$(subst ','\'',$(GIT_TEST_CMP)))'\' >>$@
 +      @echo GIT_TEST_CMP=\''$(subst ','\'',$(subst ','\'',$(GIT_TEST_CMP)))'\' >>$@+
  endif
  ifdef GIT_TEST_CMP_USE_COPIED_CONTEXT
 -      @echo GIT_TEST_CMP_USE_COPIED_CONTEXT=YesPlease >>$@
 +      @echo GIT_TEST_CMP_USE_COPIED_CONTEXT=YesPlease >>$@+
  endif
 -      @echo NO_GETTEXT=\''$(subst ','\'',$(subst ','\'',$(NO_GETTEXT)))'\' >>$@
 -      @echo GETTEXT_POISON=\''$(subst ','\'',$(subst ','\'',$(GETTEXT_POISON)))'\' >>$@
 +      @echo NO_GETTEXT=\''$(subst ','\'',$(subst ','\'',$(NO_GETTEXT)))'\' >>$@+
 +      @echo GETTEXT_POISON=\''$(subst ','\'',$(subst ','\'',$(GETTEXT_POISON)))'\' >>$@+
  ifdef GIT_PERF_REPEAT_COUNT
 -      @echo GIT_PERF_REPEAT_COUNT=\''$(subst ','\'',$(subst ','\'',$(GIT_PERF_REPEAT_COUNT)))'\' >>$@
 +      @echo GIT_PERF_REPEAT_COUNT=\''$(subst ','\'',$(subst ','\'',$(GIT_PERF_REPEAT_COUNT)))'\' >>$@+
  endif
  ifdef GIT_PERF_REPO
 -      @echo GIT_PERF_REPO=\''$(subst ','\'',$(subst ','\'',$(GIT_PERF_REPO)))'\' >>$@
 +      @echo GIT_PERF_REPO=\''$(subst ','\'',$(subst ','\'',$(GIT_PERF_REPO)))'\' >>$@+
  endif
  ifdef GIT_PERF_LARGE_REPO
 -      @echo GIT_PERF_LARGE_REPO=\''$(subst ','\'',$(subst ','\'',$(GIT_PERF_LARGE_REPO)))'\' >>$@
 +      @echo GIT_PERF_LARGE_REPO=\''$(subst ','\'',$(subst ','\'',$(GIT_PERF_LARGE_REPO)))'\' >>$@+
  endif
  ifdef GIT_PERF_MAKE_OPTS
 -      @echo GIT_PERF_MAKE_OPTS=\''$(subst ','\'',$(subst ','\'',$(GIT_PERF_MAKE_OPTS)))'\' >>$@
 +      @echo GIT_PERF_MAKE_OPTS=\''$(subst ','\'',$(subst ','\'',$(GIT_PERF_MAKE_OPTS)))'\' >>$@+
  endif
  ifdef TEST_GIT_INDEX_VERSION
 -      @echo TEST_GIT_INDEX_VERSION=\''$(subst ','\'',$(subst ','\'',$(TEST_GIT_INDEX_VERSION)))'\' >>$@
 +      @echo TEST_GIT_INDEX_VERSION=\''$(subst ','\'',$(subst ','\'',$(TEST_GIT_INDEX_VERSION)))'\' >>$@+
  endif
 +      @if cmp $@+ $@ >/dev/null 2>&1; then $(RM) $@+; else mv $@+ $@; fi
  
  ### Detect Python interpreter path changes
  ifndef NO_PYTHON