Merge branch 'js/mingw-o-append' into maint
authorJunio C Hamano <gitster@pobox.com>
Wed, 21 Nov 2018 13:57:44 +0000 (22:57 +0900)
committerJunio C Hamano <gitster@pobox.com>
Wed, 21 Nov 2018 13:57:44 +0000 (22:57 +0900)
Further fix for O_APPEND emulation on Windows

* js/mingw-o-append:
mingw: fix mingw_open_append to work with named pipes
t0051: test GIT_TRACE to a windows named pipe

1  2 
Makefile
t/helper/test-tool.c
t/helper/test-tool.h
diff --combined Makefile
index 5a969f5830a4105d3e3e6236eaa51e19880cc873,b1b934d29522497ba9a34595f9fed805a6510c3f..02a452b1f88314c957b9808996052043b3750953
+++ b/Makefile
@@@ -484,11 -484,6 +484,11 @@@ all:
  #        The DEVELOPER mode enables -Wextra with a few exceptions. By
  #        setting this flag the exceptions are removed, and all of
  #        -Wextra is used.
 +#
 +#    pedantic:
 +#
 +#        Enable -pedantic compilation. This also disables
 +#        USE_PARENS_AROUND_GETTEXT_N to produce only relevant warnings.
  
  GIT-VERSION-FILE: FORCE
        @$(SHELL_PATH) ./GIT-VERSION-GEN
@@@ -569,7 -564,7 +569,7 @@@ SPATCH = spatc
  export TCL_PATH TCLTK_PATH
  
  SPARSE_FLAGS =
 -SPATCH_FLAGS = --all-includes
 +SPATCH_FLAGS = --all-includes --patch .
  
  
  
@@@ -625,7 -620,6 +625,7 @@@ SCRIPT_LIB += git-mergetool--li
  SCRIPT_LIB += git-parse-remote
  SCRIPT_LIB += git-rebase--am
  SCRIPT_LIB += git-rebase--interactive
 +SCRIPT_LIB += git-rebase--preserve-merges
  SCRIPT_LIB += git-rebase--merge
  SCRIPT_LIB += git-sh-setup
  SCRIPT_LIB += git-sh-i18n
@@@ -695,6 -689,7 +695,6 @@@ PROGRAM_OBJS += http-backend.
  PROGRAM_OBJS += imap-send.o
  PROGRAM_OBJS += sh-i18n--envsubst.o
  PROGRAM_OBJS += shell.o
 -PROGRAM_OBJS += show-index.o
  PROGRAM_OBJS += remote-testsvn.o
  
  # Binary suffix, set to .exe for Windows builds
@@@ -714,7 -709,6 +714,7 @@@ TEST_BUILTINS_OBJS += test-example-deco
  TEST_BUILTINS_OBJS += test-genrandom.o
  TEST_BUILTINS_OBJS += test-hashmap.o
  TEST_BUILTINS_OBJS += test-index-version.o
 +TEST_BUILTINS_OBJS += test-json-writer.o
  TEST_BUILTINS_OBJS += test-lazy-init-name-hash.o
  TEST_BUILTINS_OBJS += test-match-trees.o
  TEST_BUILTINS_OBJS += test-mergesort.o
@@@ -725,7 -719,6 +725,7 @@@ TEST_BUILTINS_OBJS += test-prio-queue.
  TEST_BUILTINS_OBJS += test-read-cache.o
  TEST_BUILTINS_OBJS += test-ref-store.o
  TEST_BUILTINS_OBJS += test-regex.o
 +TEST_BUILTINS_OBJS += test-repository.o
  TEST_BUILTINS_OBJS += test-revision-walking.o
  TEST_BUILTINS_OBJS += test-run-command.o
  TEST_BUILTINS_OBJS += test-scrap-cache-tree.o
@@@ -738,6 -731,7 +738,7 @@@ 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
@@@ -866,7 -860,6 +867,7 @@@ LIB_OBJS += ewah/ewah_bitmap.
  LIB_OBJS += ewah/ewah_io.o
  LIB_OBJS += ewah/ewah_rlw.o
  LIB_OBJS += exec-cmd.o
 +LIB_OBJS += fetch-negotiator.o
  LIB_OBJS += fetch-object.o
  LIB_OBJS += fetch-pack.o
  LIB_OBJS += fsck.o
@@@ -876,11 -869,9 +877,11 @@@ LIB_OBJS += gpg-interface.
  LIB_OBJS += graph.o
  LIB_OBJS += grep.o
  LIB_OBJS += hashmap.o
 +LIB_OBJS += linear-assignment.o
  LIB_OBJS += help.o
  LIB_OBJS += hex.o
  LIB_OBJS += ident.o
 +LIB_OBJS += json-writer.o
  LIB_OBJS += kwset.o
  LIB_OBJS += levenshtein.o
  LIB_OBJS += line-log.o
@@@ -901,8 -892,6 +902,8 @@@ LIB_OBJS += merge-blobs.
  LIB_OBJS += merge-recursive.o
  LIB_OBJS += mergesort.o
  LIB_OBJS += name-hash.o
 +LIB_OBJS += negotiator/default.o
 +LIB_OBJS += negotiator/skipping.o
  LIB_OBJS += notes.o
  LIB_OBJS += notes-cache.o
  LIB_OBJS += notes-merge.o
@@@ -932,7 -921,6 +933,7 @@@ LIB_OBJS += progress.
  LIB_OBJS += prompt.o
  LIB_OBJS += protocol.o
  LIB_OBJS += quote.o
 +LIB_OBJS += range-diff.o
  LIB_OBJS += reachable.o
  LIB_OBJS += read-cache.o
  LIB_OBJS += reflog-walk.o
@@@ -1071,7 -1059,6 +1072,7 @@@ BUILTIN_OBJS += builtin/prune-packed.
  BUILTIN_OBJS += builtin/prune.o
  BUILTIN_OBJS += builtin/pull.o
  BUILTIN_OBJS += builtin/push.o
 +BUILTIN_OBJS += builtin/range-diff.o
  BUILTIN_OBJS += builtin/read-tree.o
  BUILTIN_OBJS += builtin/rebase--helper.o
  BUILTIN_OBJS += builtin/receive-pack.o
@@@ -1091,7 -1078,6 +1092,7 @@@ BUILTIN_OBJS += builtin/send-pack.
  BUILTIN_OBJS += builtin/serve.o
  BUILTIN_OBJS += builtin/shortlog.o
  BUILTIN_OBJS += builtin/show-branch.o
 +BUILTIN_OBJS += builtin/show-index.o
  BUILTIN_OBJS += builtin/show-ref.o
  BUILTIN_OBJS += builtin/stripspace.o
  BUILTIN_OBJS += builtin/submodule--helper.o
@@@ -2035,9 -2021,8 +2036,9 @@@ version.sp version.s version.o: GIT-VER
  version.sp version.s version.o: EXTRA_CPPFLAGS = \
        '-DGIT_VERSION="$(GIT_VERSION)"' \
        '-DGIT_USER_AGENT=$(GIT_USER_AGENT_CQ_SQ)' \
 -      '-DGIT_BUILT_FROM_COMMIT="$(shell GIT_CEILING_DIRECTORIES=\"$(CURDIR)/..\" \
 -              git rev-parse -q --verify HEAD || :)"'
 +      '-DGIT_BUILT_FROM_COMMIT="$(shell \
 +              GIT_CEILING_DIRECTORIES="$(CURDIR)/.." \
 +              git rev-parse -q --verify HEAD 2>/dev/null)"'
  
  $(BUILT_INS): git$X
        $(QUIET_BUILT_IN)$(RM) $@ && \
  
  command-list.h: generate-cmdlist.sh command-list.txt
  
 -command-list.h: $(wildcard Documentation/git*.txt)
 +command-list.h: $(wildcard Documentation/git*.txt) Documentation/*config.txt
        $(QUIET_GEN)$(SHELL_PATH) ./generate-cmdlist.sh command-list.txt >$@+ && mv $@+ $@
  
  SCRIPT_DEFINES = $(SHELL_PATH_SQ):$(DIFF_SQ):$(GIT_VERSION):\
@@@ -2125,7 -2110,7 +2126,7 @@@ $(SCRIPT_PERL_GEN): % : %.perl GIT-PERL
        $(QUIET_GEN)$(RM) $@ $@+ && \
        sed -e '1{' \
            -e '        s|#!.*perl|#!$(PERL_PATH_SQ)|' \
 -          -e '        rGIT-PERL-HEADER' \
 +          -e '        r GIT-PERL-HEADER' \
            -e '        G' \
            -e '}' \
            -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
@@@ -2413,7 -2398,6 +2414,7 @@@ LOCALIZED_C = $(C_OBJ:o=c) $(LIB_H) $(G
  LOCALIZED_SH = $(SCRIPT_SH)
  LOCALIZED_SH += git-parse-remote.sh
  LOCALIZED_SH += git-rebase--interactive.sh
 +LOCALIZED_SH += git-rebase--preserve-merges.sh
  LOCALIZED_SH += git-sh-setup.sh
  LOCALIZED_PERL = $(SCRIPT_PERL)
  
@@@ -2683,16 -2667,10 +2684,16 @@@ check: command-list.
        fi
  
  C_SOURCES = $(patsubst %.o,%.c,$(C_OBJ))
 -%.cocci.patch: %.cocci $(C_SOURCES)
 +ifdef DC_SHA1_SUBMODULE
 +COCCI_SOURCES = $(filter-out sha1collisiondetection/%,$(C_SOURCES))
 +else
 +COCCI_SOURCES = $(filter-out sha1dc/%,$(C_SOURCES))
 +endif
 +
 +%.cocci.patch: %.cocci $(COCCI_SOURCES)
        @echo '    ' SPATCH $<; \
        ret=0; \
 -      for f in $(C_SOURCES); do \
 +      for f in $(COCCI_SOURCES); do \
                $(SPATCH) --sp-file $< $$f $(SPATCH_FLAGS) || \
                        { ret=$$?; break; }; \
        done >$@+ 2>$@.log; \
        then \
                echo '    ' SPATCH result: $@; \
        fi
 -coccicheck: $(patsubst %.cocci,%.cocci.patch,$(wildcard contrib/coccinelle/*.cocci))
 +coccicheck: $(addsuffix .patch,$(wildcard contrib/coccinelle/*.cocci))
 +
 +.PHONY: coccicheck
  
  ### Installation rules
  
@@@ -2920,10 -2896,7 +2921,10 @@@ profile-clean
        $(RM) $(addsuffix *.gcda,$(addprefix $(PROFILE_DIR)/, $(object_dirs)))
        $(RM) $(addsuffix *.gcno,$(addprefix $(PROFILE_DIR)/, $(object_dirs)))
  
 -clean: profile-clean coverage-clean
 +cocciclean:
 +      $(RM) contrib/coccinelle/*.cocci.patch*
 +
 +clean: profile-clean coverage-clean cocciclean
        $(RM) *.res
        $(RM) $(OBJECTS)
        $(RM) $(LIB_FILE) $(XDIFF_LIB) $(VCSSVN_LIB)
        $(RM) -r $(GIT_TARNAME) .doc-tmp-dir
        $(RM) $(GIT_TARNAME).tar.gz git-core_$(GIT_VERSION)-*.tar.gz
        $(RM) $(htmldocs).tar.gz $(manpages).tar.gz
 -      $(RM) contrib/coccinelle/*.cocci.patch*
        $(MAKE) -C Documentation/ clean
  ifndef NO_PERL
        $(MAKE) -C gitweb clean
@@@ -2950,7 -2924,7 +2951,7 @@@ endi
        $(RM) GIT-USER-AGENT GIT-PREFIX
        $(RM) GIT-SCRIPT-DEFINES GIT-PERL-DEFINES GIT-PERL-HEADER GIT-PYTHON-VARS
  
 -.PHONY: all install profile-clean clean strip
 +.PHONY: all install profile-clean cocciclean clean strip
  .PHONY: shell_compatibility_test please_set_SHELL_PATH_to_a_more_modern_shell
  .PHONY: FORCE cscope
  
diff --combined t/helper/test-tool.c
index 0edafcfd65db7586bc1521d2e1afa99fbde50292,7a9764cd5c8281aed2edaa283632143d4d753dfa..db19131f719607e2beb29b1858822e5af7209189
@@@ -19,7 -19,6 +19,7 @@@ static struct test_cmd cmds[] = 
        { "genrandom", cmd__genrandom },
        { "hashmap", cmd__hashmap },
        { "index-version", cmd__index_version },
 +      { "json-writer", cmd__json_writer },
        { "lazy-init-name-hash", cmd__lazy_init_name_hash },
        { "match-trees", cmd__match_trees },
        { "mergesort", cmd__mergesort },
@@@ -30,7 -29,6 +30,7 @@@
        { "read-cache", cmd__read_cache },
        { "ref-store", cmd__ref_store },
        { "regex", cmd__regex },
 +      { "repository", cmd__repository },
        { "revision-walking", cmd__revision_walking },
        { "run-command", cmd__run_command },
        { "scrap-cache-tree", cmd__scrap_cache_tree },
@@@ -43,6 -41,9 +43,9 @@@
        { "subprocess", cmd__subprocess },
        { "urlmatch-normalization", cmd__urlmatch_normalization },
        { "wildmatch", cmd__wildmatch },
+ #ifdef GIT_WINDOWS_NATIVE
+       { "windows-named-pipe", cmd__windows_named_pipe },
+ #endif
        { "write-cache", cmd__write_cache },
  };
  
diff --combined t/helper/test-tool.h
index e954e8c5222f77e882f577198091adde95cf2532,01c34fe5e76ec92f7baf92aac5e973df04cf3a4a..491400108608d4623704f30db0e4a8b5f3061dfe
@@@ -1,8 -1,6 +1,8 @@@
  #ifndef __TEST_TOOL_H__
  #define __TEST_TOOL_H__
  
 +#include "git-compat-util.h"
 +
  int cmd__chmtime(int argc, const char **argv);
  int cmd__config(int argc, const char **argv);
  int cmd__ctype(int argc, const char **argv);
@@@ -15,7 -13,6 +15,7 @@@ int cmd__example_decorate(int argc, con
  int cmd__genrandom(int argc, const char **argv);
  int cmd__hashmap(int argc, const char **argv);
  int cmd__index_version(int argc, const char **argv);
 +int cmd__json_writer(int argc, const char **argv);
  int cmd__lazy_init_name_hash(int argc, const char **argv);
  int cmd__match_trees(int argc, const char **argv);
  int cmd__mergesort(int argc, const char **argv);
@@@ -26,7 -23,6 +26,7 @@@ int cmd__prio_queue(int argc, const cha
  int cmd__read_cache(int argc, const char **argv);
  int cmd__ref_store(int argc, const char **argv);
  int cmd__regex(int argc, const char **argv);
 +int cmd__repository(int argc, const char **argv);
  int cmd__revision_walking(int argc, const char **argv);
  int cmd__run_command(int argc, const char **argv);
  int cmd__scrap_cache_tree(int argc, const char **argv);
@@@ -39,6 -35,9 +39,9 @@@ int cmd__submodule_config(int argc, con
  int cmd__subprocess(int argc, const char **argv);
  int cmd__urlmatch_normalization(int argc, const char **argv);
  int cmd__wildmatch(int argc, const char **argv);
+ #ifdef GIT_WINDOWS_NATIVE
+ int cmd__windows_named_pipe(int argc, const char **argv);
+ #endif
  int cmd__write_cache(int argc, const char **argv);
  
  #endif