Merge branch 'js/visual-studio'
authorJunio C Hamano <gitster@pobox.com>
Fri, 2 Aug 2019 20:12:02 +0000 (13:12 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 2 Aug 2019 20:12:02 +0000 (13:12 -0700)
Support building Git with Visual Studio

The bits about .git/branches/* have been dropped from the series.
We may want to drop the support for it, but until that happens, the
tests should rely on the existence of the support to pass.

* js/visual-studio: (23 commits)
git: avoid calling aliased builtins via their dashed form
bin-wrappers: append `.exe` to target paths if necessary
.gitignore: ignore Visual Studio's temporary/generated files
.gitignore: touch up the entries regarding Visual Studio
vcxproj: also link-or-copy builtins
msvc: add a Makefile target to pre-generate the Visual Studio solution
contrib/buildsystems: add a backend for modern Visual Studio versions
contrib/buildsystems: handle options starting with a slash
contrib/buildsystems: also handle -lexpat
contrib/buildsystems: handle libiconv, too
contrib/buildsystems: handle the curl library option
contrib/buildsystems: error out on unknown option
contrib/buildsystems: optionally capture the dry-run in a file
contrib/buildsystems: redirect errors of the dry run into a log file
contrib/buildsystems: ignore gettext stuff
contrib/buildsystems: handle quoted spaces in filenames
contrib/buildsystems: fix misleading error message
contrib/buildsystems: ignore irrelevant files in Generators/
contrib/buildsystems: ignore invalidcontinue.obj
Vcproj.pm: urlencode '<' and '>' when generating VC projects
...

1  2 
.gitignore
Makefile
git.c
diff --combined .gitignore
index 069c190ba078a7fe4ac3b42db67c6d1221939249,fcfb708b9e62dc846aedbc45a0fee207622ceb64..521d8f4fb421c25e5f733242796fddfa47f39f93
@@@ -58,7 -58,6 +58,7 @@@
  /git-difftool
  /git-difftool--helper
  /git-describe
 +/git-env--helper
  /git-fast-export
  /git-fast-import
  /git-fetch
  *.ipdb
  *.dll
  .vs/
- /Debug/
- /Release/
+ *.manifest
+ Debug/
+ Release/
+ /UpgradeLog*.htm
+ /git.VC.VC.opendb
+ /git.VC.db
  *.dSYM
diff --combined Makefile
index bd246f2989575a72758fd3765659f61a8aa58c8c,3716dadc08c5cc72a904e547a88320053762fba5..f9255344ae5009a192ab83a332be749632d94531
+++ b/Makefile
@@@ -704,7 -704,6 +704,7 @@@ TEST_BUILTINS_OBJS += test-config.
  TEST_BUILTINS_OBJS += test-ctype.o
  TEST_BUILTINS_OBJS += test-date.o
  TEST_BUILTINS_OBJS += test-delta.o
 +TEST_BUILTINS_OBJS += test-dir-iterator.o
  TEST_BUILTINS_OBJS += test-drop-caches.o
  TEST_BUILTINS_OBJS += test-dump-cache-tree.o
  TEST_BUILTINS_OBJS += test-dump-fsmonitor.o
@@@ -722,7 -721,6 +722,7 @@@ TEST_BUILTINS_OBJS += test-lazy-init-na
  TEST_BUILTINS_OBJS += test-match-trees.o
  TEST_BUILTINS_OBJS += test-mergesort.o
  TEST_BUILTINS_OBJS += test-mktemp.o
 +TEST_BUILTINS_OBJS += test-oidmap.o
  TEST_BUILTINS_OBJS += test-online-cpus.o
  TEST_BUILTINS_OBJS += test-parse-options.o
  TEST_BUILTINS_OBJS += test-path-utils.o
@@@ -1063,7 -1061,6 +1063,7 @@@ BUILTIN_OBJS += builtin/diff-index.
  BUILTIN_OBJS += builtin/diff-tree.o
  BUILTIN_OBJS += builtin/diff.o
  BUILTIN_OBJS += builtin/difftool.o
 +BUILTIN_OBJS += builtin/env--helper.o
  BUILTIN_OBJS += builtin/fast-export.o
  BUILTIN_OBJS += builtin/fetch-pack.o
  BUILTIN_OBJS += builtin/fetch.o
@@@ -2720,7 -2717,7 +2720,7 @@@ bin-wrappers/%: wrap-for-bin.s
        @mkdir -p bin-wrappers
        $(QUIET_GEN)sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
             -e 's|@@BUILD_DIR@@|$(shell pwd)|' \
-            -e 's|@@PROG@@|$(patsubst test-%,t/helper/test-%,$(@F))|' < $< > $@ && \
+            -e 's|@@PROG@@|$(patsubst test-%,t/helper/test-%$(X),$(@F))$(patsubst git%,$(X),$(filter $(@F),$(BINDIR_PROGRAMS_NEED_X)))|' < $< > $@ && \
        chmod +x $@
  
  # GNU make supports exporting all variables by "export" without parameters.
diff --combined git.c
index 74ad85535696939db14e77e12da5bffdce77f525,3049dae85bbdb132a531a71286d806c8d963fcfa..c1ee7124edcfb0417539134d50212e997dc71c1f
--- 1/git.c
--- 2/git.c
+++ b/git.c
@@@ -500,7 -500,6 +500,7 @@@ static struct cmd_struct commands[] = 
        { "diff-index", cmd_diff_index, RUN_SETUP | NO_PARSEOPT },
        { "diff-tree", cmd_diff_tree, RUN_SETUP | NO_PARSEOPT },
        { "difftool", cmd_difftool, RUN_SETUP_GENTLY },
 +      { "env--helper", cmd_env__helper },
        { "fast-export", cmd_fast_export, RUN_SETUP },
        { "fetch", cmd_fetch, RUN_SETUP },
        { "fetch-pack", cmd_fetch_pack, RUN_SETUP | NO_PARSEOPT },
        { "push", cmd_push, RUN_SETUP },
        { "range-diff", cmd_range_diff, RUN_SETUP | USE_PAGER },
        { "read-tree", cmd_read_tree, RUN_SETUP | SUPPORT_SUPER_PREFIX},
 -      /*
 -       * NEEDSWORK: Until the rebase is independent and needs no redirection
 -       * to rebase shell script this is kept as is, then should be changed to
 -       * RUN_SETUP | NEED_WORK_TREE
 -       */
 -      { "rebase", cmd_rebase },
 +      { "rebase", cmd_rebase, RUN_SETUP | NEED_WORK_TREE },
        { "rebase--interactive", cmd_rebase__interactive, RUN_SETUP | NEED_WORK_TREE },
        { "receive-pack", cmd_receive_pack },
        { "reflog", cmd_reflog, RUN_SETUP },
@@@ -739,8 -743,6 +739,6 @@@ static int run_argv(int *argcp, const c
                 */
                if (!done_alias)
                        handle_builtin(*argcp, *argv);
- #if 0 // TODO In GFW, need to amend a7924b655e940b06cb547c235d6bed9767929673 to include trace2_ and _tr2 lines.
                else if (get_builtin(**argv)) {
                        struct argv_array args = ARGV_ARRAY_INIT;
                        int i;
                                exit(i);
                        die("could not execute builtin %s", **argv);
                }
- #endif // a7924b655e940b06cb547c235d6bed9767929673
  
                /* .. then try the external ones */
                execv_dashed_external(*argv);