{"thread":{"id":"51494","subject":"[PATCH 00/24] Reinstate support for Visual Studio","startedAt":"2019-07-18T13:19:04Z","lastAt":"2019-08-28T11:34:39Z","messageCount":63,"participants":["Johannes Schindelin via GitGitGadget","Philip Oakley via GitGitGadget","Junio C Hamano","Johannes Schindelin","SZEDER Gábor","Philip Oakley"],"isPatch":true,"patchVersion":1,"patchTotal":24},"messages":[{"id":"379036","messageId":"pull.287.git.gitgitgadget@gmail.com","threadId":"51494","inReplyTo":null,"subject":"[PATCH 00/24] Reinstate support for Visual Studio","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-07-18T13:19:00Z","receivedAt":"2019-07-18T13:19:04Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"A long time ago, we added support to build .sln and .vcproj files for use\nwithin Visual Studio, so that Git could be built in that popular IDE.\n\nThis support languished for years and was finally brought back into Git for\nWindows partially through the jh/msvc branch that was just merged into \nmaster. With the tremendous help by Philip Oakley and Jeff Hostetler, this\nre-adds support for Visual Studio, focusing on VS 2015 and later (older\nversions are currently unsupported, even if we worked a bit on that front,\ntoo; If there are volunteers to add support for older versions, I would be\ndelighted to review PRs to that end on \nhttps://github.com/git-for-windows/git).\n\nNote: the currently preferred way to contribute using Visual Studio is by\nusing Git for Windows' vs/master branch (which is automatically generated\nusing the make vcxproj build target that this patch series adds, updated\nevery time Git for Windows' master advances). My plan is to provide a\nsimilar branch in GitGitGadget, based on top of git.git's master, once this\npatch series is integrated.\n\nJohannes Schindelin (15):\n  Vcproj.pm: auto-generate GUIDs\n  Vcproj.pm: do not configure VCWebServiceProxyGeneratorTool\n  Vcproj.pm: urlencode '<' and '>' when generating VC projects\n  contrib/buildsystems: ignore irrelevant files in Generators/\n  contrib/buildsystems: error out on unknown option\n  contrib/buildsystems: handle libiconv, too\n  contrib/buildsystems: also handle -lexpat\n  contrib/buildsystems: handle options starting with a slash\n  contrib/buildsystems: add a backend for modern Visual Studio versions\n  msvc: add a Makefile target to pre-generate the Visual Studio solution\n  vcxproj: also link-or-copy builtins\n  .gitignore: ignore Visual Studio's temporary/generated files\n  bin-wrappers: append `.exe` to target paths if necessary\n  t5505,t5516: create .git/branches/ when needed\n  git: avoid calling aliased builtins via their dashed form\n\nPhilip Oakley (9):\n  Vcproj.pm: list git.exe first to be startup project\n  contrib/buildsystems: ignore invalidcontinue.obj\n  contrib/buildsystems: fix misleading error message\n  contrib/buildsystems: handle quoted spaces in filenames\n  contrib/buildsystems: ignore gettext stuff\n  contrib/buildsystems: redirect errors of the dry run into a log file\n  contrib/buildsystems: optionally capture the dry-run in a file\n  contrib/buildsystems: handle the curl library option\n  .gitignore: touch up the entries regarding Visual Studio\n\n .gitignore                                 |   8 +-\n Makefile                                   |   2 +-\n compat/vcbuild/README                      |  23 ++\n config.mak.uname                           |  76 ++++\n contrib/buildsystems/Generators.pm         |   2 +-\n contrib/buildsystems/Generators/Vcproj.pm  | 119 ++-----\n contrib/buildsystems/Generators/Vcxproj.pm | 387 +++++++++++++++++++++\n contrib/buildsystems/engine.pl             |  55 ++-\n git.c                                      |   3 -\n t/t5505-remote.sh                          |   2 +\n t/t5516-fetch-push.sh                      |   4 +\n 11 files changed, 581 insertions(+), 100 deletions(-)\n create mode 100644 contrib/buildsystems/Generators/Vcxproj.pm\n\n\nbase-commit: 9d418600f4d10dcbbfb0b5fdbc71d509e03ba719\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-287%2Fdscho%2Fvisual-studio-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-287/dscho/visual-studio-v1\nPull-Request: https://github.com/gitgitgadget/git/pull/287\n-- \ngitgitgadget\n"},{"id":"379037","messageId":"240ff4251774fbede9cce21a5140af655e05d7ba.1563455939.git.gitgitgadget@gmail.com","threadId":"51494","inReplyTo":"pull.287.git.gitgitgadget@gmail.com","subject":"[PATCH 01/24] Vcproj.pm: auto-generate GUIDs","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-07-18T13:19:01Z","receivedAt":"2019-07-18T13:19:06Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nWe ran out GUIDs. Again. But there is no need to: we can generate them\nsemi-randomly from the target file name of the project.\n\nNote: the Vcproj generator is probably only interesting for historical\nreasons; nevertheless, the upcoming Vcxproj generator (to support modern\nVisual Studio versions) is based on the Vcproj generator and it is\nbetter to fix this here first.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n contrib/buildsystems/Generators/Vcproj.pm | 66 ++++-------------------\n 1 file changed, 9 insertions(+), 57 deletions(-)\n\ndiff --git a/contrib/buildsystems/Generators/Vcproj.pm b/contrib/buildsystems/Generators/Vcproj.pm\nindex cfa74adcc2..c79b706bc8 100644\n--- a/contrib/buildsystems/Generators/Vcproj.pm\n+++ b/contrib/buildsystems/Generators/Vcproj.pm\n@@ -3,6 +3,7 @@ package Generators::Vcproj;\n \n use strict;\n use vars qw($VERSION);\n+use Digest::SHA qw(sha256_hex);\n \n our $VERSION = '1.00';\n our(@ISA, @EXPORT, @EXPORT_OK, @AVAILABLE);\n@@ -12,59 +13,12 @@ BEGIN\n     push @EXPORT_OK, qw(generate);\n }\n \n-my $guid_index = 0;\n-my @GUIDS = (\n-    \"{E07B9989-2BF7-4F21-8918-BE22BA467AC3}\",\n-    \"{278FFB51-0296-4A44-A81A-22B87B7C3592}\",\n-    \"{7346A2C4-F0FD-444F-9EBE-1AF23B2B5650}\",\n-    \"{67F421AC-EB34-4D49-820B-3196807B423F}\",\n-    \"{385DCFE1-CC8C-4211-A451-80FCFC31CA51}\",\n-    \"{97CC46C5-D2CC-4D26-B634-E75792B79916}\",\n-    \"{C7CE21FE-6EF8-4012-A5C7-A22BCEDFBA11}\",\n-    \"{51575134-3FDF-42D1-BABD-3FB12669C6C9}\",\n-    \"{0AE195E4-9823-4B87-8E6F-20C5614AF2FF}\",\n-    \"{4B918255-67CA-43BB-A46C-26704B666E6B}\",\n-    \"{18CCFEEF-C8EE-4CC1-A265-26F95C9F4649}\",\n-    \"{5D5D90FA-01B7-4973-AFE5-CA88C53AC197}\",\n-    \"{1F054320-036D-49E1-B384-FB5DF0BC8AC0}\",\n-    \"{7CED65EE-F2D9-4171-825B-C7D561FE5786}\",\n-    \"{8D341679-0F07-4664-9A56-3BA0DE88B9BC}\",\n-    \"{C189FEDC-2957-4BD7-9FA4-7622241EA145}\",\n-    \"{66844203-1B9F-4C53-9274-164FFF95B847}\",\n-    \"{E4FEA145-DECC-440D-AEEA-598CF381FD43}\",\n-    \"{73300A8E-C8AC-41B0-B555-4F596B681BA7}\",\n-    \"{873FDEB1-D01D-40BF-A1BF-8BBC58EC0F51}\",\n-    \"{7922C8BE-76C5-4AC6-8BF7-885C0F93B782}\",\n-    \"{E245D370-308B-4A49-BFC1-1E527827975F}\",\n-    \"{F6FA957B-66FC-4ED7-B260-E59BBE4FE813}\",\n-    \"{E6055070-0198-431A-BC49-8DB6CEE770AE}\",\n-    \"{54159234-C3EB-43DA-906B-CE5DA5C74654}\",\n-    \"{594CFC35-0B60-46F6-B8EF-9983ACC1187D}\",\n-    \"{D93FCAB7-1F01-48D2-B832-F761B83231A5}\",\n-    \"{DBA5E6AC-E7BE-42D3-8703-4E787141526E}\",\n-    \"{6171953F-DD26-44C7-A3BE-CC45F86FC11F}\",\n-    \"{9E19DDBE-F5E4-4A26-A2FE-0616E04879B8}\",\n-    \"{AE81A615-99E3-4885-9CE0-D9CAA193E867}\",\n-    \"{FBF4067E-1855-4F6C-8BCD-4D62E801A04D}\",\n-    \"{17007948-6593-4AEB-8106-F7884B4F2C19}\",\n-    \"{199D4C8D-8639-4DA6-82EF-08668C35DEE0}\",\n-    \"{E085E50E-C140-4CF3-BE4B-094B14F0DDD6}\",\n-    \"{00785268-A9CC-4E40-AC29-BAC0019159CE}\",\n-    \"{4C06F56A-DCDB-46A6-B67C-02339935CF12}\",\n-    \"{3A62D3FD-519E-4EC9-8171-D2C1BFEA022F}\",\n-    \"{3A62D3FD-519E-4EC9-8171-D2C1BFEA022F}\",\n-    \"{9392EB58-D7BA-410B-B1F0-B2FAA6BC89A7}\",\n-    \"{2ACAB2D5-E0CE-4027-BCA0-D78B2D7A6C66}\",\n-    \"{86E216C3-43CE-481A-BCB2-BE5E62850635}\",\n-    \"{FB631291-7923-4B91-9A57-7B18FDBB7A42}\",\n-    \"{0A176EC9-E934-45B8-B87F-16C7F4C80039}\",\n-    \"{DF55CA80-46E8-4C53-B65B-4990A23DD444}\",\n-    \"{3A0F9895-55D2-4710-BE5E-AD7498B5BF44}\",\n-    \"{294BDC5A-F448-48B6-8110-DD0A81820F8C}\",\n-    \"{4B9F66E9-FAC9-47AB-B1EF-C16756FBFD06}\",\n-    \"{72EA49C6-2806-48BD-B81B-D4905102E19C}\",\n-    \"{5728EB7E-8929-486C-8CD5-3238D060E768}\"\n-);\n+sub generate_guid ($) {\n+    my $hex = sha256_hex($_[0]);\n+    $hex =~ s/^(.{8})(.{4})(.{4})(.{4})(.{12}).*/{$1-$2-$3-$4-$5}/;\n+    $hex =~ tr/a-z/A-Z/;\n+    return $hex;\n+}\n \n sub generate {\n     my ($git_dir, $out_dir, $rel_dir, %build_structure) = @_;\n@@ -92,9 +46,8 @@ sub createLibProject {\n     $target =~ s/\\//_/g;\n     $target =~ s/\\.a//;\n \n-    my $uuid = $GUIDS[$guid_index];\n+    my $uuid = generate_guid($libname);\n     $$build_structure{\"LIBS_${target}_GUID\"} = $uuid;\n-    $guid_index += 1;\n \n     my @srcs = sort(map(\"$rel_dir\\\\$_\", @{$$build_structure{\"LIBS_${libname}_SOURCES\"}}));\n     my @sources;\n@@ -311,9 +264,8 @@ sub createAppProject {\n     $target =~ s/\\//_/g;\n     $target =~ s/\\.exe//;\n \n-    my $uuid = $GUIDS[$guid_index];\n+    my $uuid = generate_guid($appname);\n     $$build_structure{\"APPS_${target}_GUID\"} = $uuid;\n-    $guid_index += 1;\n \n     my @srcs = sort(map(\"$rel_dir\\\\$_\", @{$$build_structure{\"APPS_${appname}_SOURCES\"}}));\n     my @sources;\n-- \ngitgitgadget\n\n"},{"id":"379038","messageId":"d42fd0fe2e8433b14b8efe4e788cc55e53c5c06d.1563455939.git.gitgitgadget@gmail.com","threadId":"51494","inReplyTo":"pull.287.git.gitgitgadget@gmail.com","subject":"[PATCH 03/24] Vcproj.pm: do not configure VCWebServiceProxyGeneratorTool","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-07-18T13:19:02Z","receivedAt":"2019-07-18T13:19:06Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nIt is not necessary, and Visual Studio 2015 no longer supports it, anyway.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n contrib/buildsystems/Generators/Vcproj.pm | 12 ------------\n 1 file changed, 12 deletions(-)\n\ndiff --git a/contrib/buildsystems/Generators/Vcproj.pm b/contrib/buildsystems/Generators/Vcproj.pm\nindex d862cae503..b17800184c 100644\n--- a/contrib/buildsystems/Generators/Vcproj.pm\n+++ b/contrib/buildsystems/Generators/Vcproj.pm\n@@ -115,9 +115,6 @@ sub createLibProject {\n \t\t\t<Tool\n \t\t\t\tName=\"VCXMLDataGeneratorTool\"\n \t\t\t/>\n-\t\t\t<Tool\n-\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n-\t\t\t/>\n \t\t\t<Tool\n \t\t\t\tName=\"VCMIDLTool\"\n \t\t\t/>\n@@ -181,9 +178,6 @@ sub createLibProject {\n \t\t\t<Tool\n \t\t\t\tName=\"VCXMLDataGeneratorTool\"\n \t\t\t/>\n-\t\t\t<Tool\n-\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n-\t\t\t/>\n \t\t\t<Tool\n \t\t\t\tName=\"VCMIDLTool\"\n \t\t\t/>\n@@ -339,9 +333,6 @@ sub createAppProject {\n \t\t\t<Tool\n \t\t\t\tName=\"VCXMLDataGeneratorTool\"\n \t\t\t/>\n-\t\t\t<Tool\n-\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n-\t\t\t/>\n \t\t\t<Tool\n \t\t\t\tName=\"VCMIDLTool\"\n \t\t\t/>\n@@ -410,9 +401,6 @@ sub createAppProject {\n \t\t\t<Tool\n \t\t\t\tName=\"VCXMLDataGeneratorTool\"\n \t\t\t/>\n-\t\t\t<Tool\n-\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n-\t\t\t/>\n \t\t\t<Tool\n \t\t\t\tName=\"VCMIDLTool\"\n \t\t\t/>\n-- \ngitgitgadget\n\n"},{"id":"379039","messageId":"a7898b002590adcfb103e6851d84267715ee05b0.1563455939.git.gitgitgadget@gmail.com","threadId":"51494","inReplyTo":"pull.287.git.gitgitgadget@gmail.com","subject":"[PATCH 02/24] Vcproj.pm: list git.exe first to be startup project","fromName":"Philip Oakley via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-07-18T13:19:02Z","receivedAt":"2019-07-18T13:19:08Z","isPatch":true,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"From: Philip Oakley <philipoakley@iee.org>\n\nVisual Studio takes the first listed application/library as the default\nstartup project [1].\n\nDetect the 'git' project and place it at the head of the project list,\nrather than at the tail.\n\nExport the apps list before libs list for both the projects and global\nstructures of the .sln file.\n\n[1] http://stackoverflow.com/questions/1238553/\nvs2008-where-is-the-startup-project-setting-stored-for-a-solution\n    \"In the solution file, there are a list of pseudo-XML \"Project\"\n    entries. It turns out that whatever is the first one ends up as\n    the Startup Project, unless it’s overridden in the suo file. Argh.\n    I just rearranged the order in the file and it’s good.\"\n\n    \"just moving the pseudo-xml isn't enough. You also have to move the\n    group of entries in the \"GlobalSection(ProjectConfigurationPlatforms)\n    = postSolution\" group that has the GUID of the project you moved to\n    the top. So there are two places to move lines.\"\n\nSigned-off-by: Philip Oakley <philipoakley@iee.org>\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n contrib/buildsystems/Generators/Vcproj.pm | 33 +++++++++++++----------\n 1 file changed, 19 insertions(+), 14 deletions(-)\n\ndiff --git a/contrib/buildsystems/Generators/Vcproj.pm b/contrib/buildsystems/Generators/Vcproj.pm\nindex c79b706bc8..d862cae503 100644\n--- a/contrib/buildsystems/Generators/Vcproj.pm\n+++ b/contrib/buildsystems/Generators/Vcproj.pm\n@@ -513,20 +513,18 @@ sub createGlueProject {\n     foreach (@apps) {\n         $_ =~ s/\\//_/g;\n         $_ =~ s/\\.exe//;\n-        push(@tmp, $_);\n+        if ($_ eq \"git\" ) {\n+            unshift(@tmp, $_);\n+        } else {\n+            push(@tmp, $_);\n+        }\n     }\n     @apps = @tmp;\n \n     open F, \">git.sln\" || die \"Could not open git.sln for writing!\\n\";\n     binmode F, \":crlf\";\n     print F \"$SLN_HEAD\";\n-    foreach (@libs) {\n-        my $libname = $_;\n-        my $uuid = $build_structure{\"LIBS_${libname}_GUID\"};\n-        print F \"$SLN_PRE\";\n-        print F \"\\\"${libname}\\\", \\\"${libname}\\\\${libname}.vcproj\\\", \\\"${uuid}\\\"\";\n-        print F \"$SLN_POST\";\n-    }\n+\n     my $uuid_libgit = $build_structure{\"LIBS_libgit_GUID\"};\n     my $uuid_xdiff_lib = $build_structure{\"LIBS_xdiff_lib_GUID\"};\n     foreach (@apps) {\n@@ -540,6 +538,13 @@ sub createGlueProject {\n         print F \"\tEndProjectSection\";\n         print F \"$SLN_POST\";\n     }\n+    foreach (@libs) {\n+        my $libname = $_;\n+        my $uuid = $build_structure{\"LIBS_${libname}_GUID\"};\n+        print F \"$SLN_PRE\";\n+        print F \"\\\"${libname}\\\", \\\"${libname}\\\\${libname}.vcproj\\\", \\\"${uuid}\\\"\";\n+        print F \"$SLN_POST\";\n+    }\n \n     print F << \"EOM\";\n Global\n@@ -551,17 +556,17 @@ sub createGlueProject {\n     print F << \"EOM\";\n \tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n EOM\n-    foreach (@libs) {\n-        my $libname = $_;\n-        my $uuid = $build_structure{\"LIBS_${libname}_GUID\"};\n+    foreach (@apps) {\n+        my $appname = $_;\n+        my $uuid = $build_structure{\"APPS_${appname}_GUID\"};\n         print F \"\\t\\t${uuid}.Debug|Win32.ActiveCfg = Debug|Win32\\n\";\n         print F \"\\t\\t${uuid}.Debug|Win32.Build.0 = Debug|Win32\\n\";\n         print F \"\\t\\t${uuid}.Release|Win32.ActiveCfg = Release|Win32\\n\";\n         print F \"\\t\\t${uuid}.Release|Win32.Build.0 = Release|Win32\\n\";\n     }\n-    foreach (@apps) {\n-        my $appname = $_;\n-        my $uuid = $build_structure{\"APPS_${appname}_GUID\"};\n+    foreach (@libs) {\n+        my $libname = $_;\n+        my $uuid = $build_structure{\"LIBS_${libname}_GUID\"};\n         print F \"\\t\\t${uuid}.Debug|Win32.ActiveCfg = Debug|Win32\\n\";\n         print F \"\\t\\t${uuid}.Debug|Win32.Build.0 = Debug|Win32\\n\";\n         print F \"\\t\\t${uuid}.Release|Win32.ActiveCfg = Release|Win32\\n\";\n-- \ngitgitgadget\n\n"},{"id":"379041","messageId":"e908d01f076e5954d4c2af4fb3e297c5762aaf48.1563455939.git.gitgitgadget@gmail.com","threadId":"51494","inReplyTo":"pull.287.git.gitgitgadget@gmail.com","subject":"[PATCH 09/24] contrib/buildsystems: ignore gettext stuff","fromName":"Philip Oakley via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-07-18T13:19:06Z","receivedAt":"2019-07-18T13:19:10Z","isPatch":true,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"From: Philip Oakley <philipoakley@iee.org>\n\nGit's build contains steps to handle internationalization. This caused\nhiccups in the parser used to generate QMake/Visual Studio project files.\n\nAs those steps are irrelevant in this context, let's just ignore them.\n\nSigned-off-by: Philip Oakley <philipoakley@iee.org>\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n contrib/buildsystems/engine.pl | 6 ++++++\n 1 file changed, 6 insertions(+)\n\ndiff --git a/contrib/buildsystems/engine.pl b/contrib/buildsystems/engine.pl\nindex ad6a82c30c..9db3d43a1e 100755\n--- a/contrib/buildsystems/engine.pl\n+++ b/contrib/buildsystems/engine.pl\n@@ -141,6 +141,12 @@ sub parseMakeOutput\n             next;\n         }\n \n+        if ($text =~ /^(mkdir|msgfmt) /) {\n+            # options to the Portable Object translations\n+            # the line \"mkdir ... && msgfmt ...\" contains no linker options\n+            next;\n+        }\n+\n         if($text =~ / -c /) {\n             # compilation\n             handleCompileLine($text, $line);\n-- \ngitgitgadget\n\n"},{"id":"379040","messageId":"60a45f26948989f928ca439a2860433c0f08f412.1563455939.git.gitgitgadget@gmail.com","threadId":"51494","inReplyTo":"pull.287.git.gitgitgadget@gmail.com","subject":"[PATCH 06/24] contrib/buildsystems: ignore irrelevant files in Generators/","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-07-18T13:19:04Z","receivedAt":"2019-07-18T13:19:11Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nThe Generators/ directory can contain spurious files such as editors'\nbackup files. Even worse, there could be .swp files which are not even\nvalid Perl scripts.\n\nLet's just ignore anything but .pm files in said directory.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n contrib/buildsystems/Generators.pm | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/contrib/buildsystems/Generators.pm b/contrib/buildsystems/Generators.pm\nindex 408ef714b8..aa4cbaa2ad 100644\n--- a/contrib/buildsystems/Generators.pm\n+++ b/contrib/buildsystems/Generators.pm\n@@ -17,7 +17,7 @@ BEGIN\n     $me = dirname($me);\n     if (opendir(D,\"$me/Generators\")) {\n         foreach my $gen (readdir(D)) {\n-            next if ($gen  =~ /^\\.\\.?$/);\n+            next unless ($gen  =~ /\\.pm$/);\n             require \"${me}/Generators/$gen\";\n             $gen =~ s,\\.pm,,;\n             push(@AVAILABLE, $gen);\n-- \ngitgitgadget\n\n"},{"id":"379042","messageId":"b8eb868316990ae180323d04efe08ed7d48c61ef.1563455939.git.gitgitgadget@gmail.com","threadId":"51494","inReplyTo":"pull.287.git.gitgitgadget@gmail.com","subject":"[PATCH 07/24] contrib/buildsystems: fix misleading error message","fromName":"Philip Oakley via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-07-18T13:19:05Z","receivedAt":"2019-07-18T13:19:12Z","isPatch":true,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"From: Philip Oakley <philipoakley@iee.org>\n\nThe error message talked about a \"lib option\", but it clearly referred\nto a link option.\n\nSigned-off-by: Philip Oakley <philipoakley@iee.org>\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n contrib/buildsystems/engine.pl | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/contrib/buildsystems/engine.pl b/contrib/buildsystems/engine.pl\nindex 53e65d4db7..11f0e16dda 100755\n--- a/contrib/buildsystems/engine.pl\n+++ b/contrib/buildsystems/engine.pl\n@@ -333,7 +333,7 @@ sub handleLinkLine\n         } elsif ($part =~ /\\.obj$/) {\n             # do nothing, 'make' should not be producing .obj, only .o files\n         } else {\n-            die \"Unhandled lib option @ line $lineno: $part\";\n+            die \"Unhandled link option @ line $lineno: $part\";\n         }\n     }\n #    print \"AppOut: '$appout'\\nLFlags: @lflags\\nLibs  : @libs\\nOfiles: @objfiles\\n\";\n-- \ngitgitgadget\n\n"},{"id":"379043","messageId":"82e820017b6ab7ce8612742a85679ea837d3596b.1563455939.git.gitgitgadget@gmail.com","threadId":"51494","inReplyTo":"pull.287.git.gitgitgadget@gmail.com","subject":"[PATCH 05/24] contrib/buildsystems: ignore invalidcontinue.obj","fromName":"Philip Oakley via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-07-18T13:19:04Z","receivedAt":"2019-07-18T13:19:13Z","isPatch":true,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"From: Philip Oakley <philipoakley@iee.org>\n\nSince 4b623d8 (MSVC: link in invalidcontinue.obj for better POSIX\ncompatibility, 2014-03-29), invalidcontinue.obj is linked in the MSVC\nbuild, but it was not parsed correctly by the buildsystem. Ignore it, as\nit is known to Visual Studio and will be handled elsewhere.\n\nAlso only substitute filenames ending with .o when generating the\nsource .c filename, otherwise we would start to expect .cbj files to\ngenerate .obj files (which are not generated by our build)...\n\nIn the future there may be source files that produce .obj files\nso keep the two issues (.obj files with & without source files)\nseparate.\n\nSigned-off-by: Philip Oakley <philipoakley@iee.org>\nSigned-off-by: Duncan Smart <duncan.smart@gmail.com>\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n contrib/buildsystems/engine.pl | 10 +++++++---\n 1 file changed, 7 insertions(+), 3 deletions(-)\n\ndiff --git a/contrib/buildsystems/engine.pl b/contrib/buildsystems/engine.pl\nindex 23da787dc5..53e65d4db7 100755\n--- a/contrib/buildsystems/engine.pl\n+++ b/contrib/buildsystems/engine.pl\n@@ -282,7 +282,7 @@ sub handleLibLine\n #    exit(1);\n     foreach (@objfiles) {\n         my $sourcefile = $_;\n-        $sourcefile =~ s/\\.o/.c/;\n+        $sourcefile =~ s/\\.o$/.c/;\n         push(@sources, $sourcefile);\n         push(@cflags, @{$compile_options{\"${sourcefile}_CFLAGS\"}});\n         push(@defines, @{$compile_options{\"${sourcefile}_DEFINES\"}});\n@@ -326,8 +326,12 @@ sub handleLinkLine\n         } elsif ($part =~ /\\.(a|lib)$/) {\n             $part =~ s/\\.a$/.lib/;\n             push(@libs, $part);\n-        } elsif ($part =~ /\\.(o|obj)$/) {\n+        } elsif ($part eq 'invalidcontinue.obj') {\n+            # ignore - known to MSVC\n+        } elsif ($part =~ /\\.o$/) {\n             push(@objfiles, $part);\n+        } elsif ($part =~ /\\.obj$/) {\n+            # do nothing, 'make' should not be producing .obj, only .o files\n         } else {\n             die \"Unhandled lib option @ line $lineno: $part\";\n         }\n@@ -336,7 +340,7 @@ sub handleLinkLine\n #    exit(1);\n     foreach (@objfiles) {\n         my $sourcefile = $_;\n-        $sourcefile =~ s/\\.o/.c/;\n+        $sourcefile =~ s/\\.o$/.c/;\n         push(@sources, $sourcefile);\n         push(@cflags, @{$compile_options{\"${sourcefile}_CFLAGS\"}});\n         push(@defines, @{$compile_options{\"${sourcefile}_DEFINES\"}});\n-- \ngitgitgadget\n\n"},{"id":"379044","messageId":"3cfbb7843ac3a27c79da4554cc550608b19f2d55.1563455939.git.gitgitgadget@gmail.com","threadId":"51494","inReplyTo":"pull.287.git.gitgitgadget@gmail.com","subject":"[PATCH 10/24] contrib/buildsystems: redirect errors of the dry run into a log file","fromName":"Philip Oakley via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-07-18T13:19:07Z","receivedAt":"2019-07-18T13:19:14Z","isPatch":true,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"From: Philip Oakley <philipoakley@iee.org>\n\nRather than swallowing the errors, it is better to have them in a file.\n\nTo make it obvious what this is about, use the file name\n'msvc-build-makedryerrors.txt'.\n\nFurther, if the output is empty, simply delete that file. As we target\nGit for Windows' SDK (which, unlike its predecessor msysGit, offers Perl\nversions newer than 5.8), we can use the quite readable syntax `if -f -z\n$ErrsFile` (available in Perl >=5.10).\n\nNote that the file will contain the new values of the GIT_VERSION and\nGITGUI_VERSION if they were generated by the make file. They are omitted\nif the release is tagged and indentically defined in their respective\nGIT_VERSION_GEN file DEF_VER variables.\n\nSigned-off-by: Philip Oakley <philipoakley@iee.org>\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n contrib/buildsystems/engine.pl | 7 ++++++-\n 1 file changed, 6 insertions(+), 1 deletion(-)\n\ndiff --git a/contrib/buildsystems/engine.pl b/contrib/buildsystems/engine.pl\nindex 9db3d43a1e..de5c0b6b25 100755\n--- a/contrib/buildsystems/engine.pl\n+++ b/contrib/buildsystems/engine.pl\n@@ -73,7 +73,12 @@ sub showUsage\n EOM\n \n # Pipe a make --dry-run into a variable, if not already loaded from file\n-@makedry = `cd $git_dir && make -n MSVC=1 V=1 2>/dev/null` if !@makedry;\n+# Capture the make dry stderr to file for review (will be empty for a release build).\n+\n+my $ErrsFile = \"msvc-build-makedryerrors.txt\";\n+@makedry = `make -C $git_dir -n MSVC=1 V=1 2>$ErrsFile` if !@makedry;\n+# test for an empty Errors file and remove it\n+unlink $ErrsFile if -f -z $ErrsFile;\n \n # Parse the make output into usable info\n parseMakeOutput();\n-- \ngitgitgadget\n\n"},{"id":"379045","messageId":"eaf1dd449d541d7b8272c6f95af056a548b577ef.1563455939.git.gitgitgadget@gmail.com","threadId":"51494","inReplyTo":"pull.287.git.gitgitgadget@gmail.com","subject":"[PATCH 11/24] contrib/buildsystems: optionally capture the dry-run in a file","fromName":"Philip Oakley via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-07-18T13:19:08Z","receivedAt":"2019-07-18T13:19:15Z","isPatch":true,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"From: Philip Oakley <philipoakley@iee.org>\n\nAdd an option for capturing the output of the make dry-run used in\ndetermining the msvc-build structure for easy debugging.\n\nYou can use the output of `--make-out <path>` in subsequent runs via the\n`--in <path>` option.\n\nSigned-off-by: Philip Oakley <philipoakley@iee.org>\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n contrib/buildsystems/engine.pl | 10 ++++++++++\n 1 file changed, 10 insertions(+)\n\ndiff --git a/contrib/buildsystems/engine.pl b/contrib/buildsystems/engine.pl\nindex de5c0b6b25..732239d817 100755\n--- a/contrib/buildsystems/engine.pl\n+++ b/contrib/buildsystems/engine.pl\n@@ -32,6 +32,7 @@ sub showUsage\n   -g <GENERATOR>  --gen <GENERATOR> Specify the buildsystem generator    (default: $gen)\n                                     Available: $genlist\n   -o <PATH>       --out <PATH>      Specify output directory generation  (default: .)\n+                  --make-out <PATH> Write the output of GNU Make into a file\n   -i <FILE>       --in <FILE>       Specify input file, instead of running GNU Make\n   -h,-?           --help            This help\n EOM\n@@ -39,6 +40,7 @@ sub showUsage\n }\n \n # Parse command-line options\n+my $make_out;\n while (@ARGV) {\n     my $arg = shift @ARGV;\n     if (\"$arg\" eq \"-h\" || \"$arg\" eq \"--help\" || \"$arg\" eq \"-?\") {\n@@ -46,6 +48,8 @@ sub showUsage\n \texit(0);\n     } elsif(\"$arg\" eq \"--out\" || \"$arg\" eq \"-o\") {\n \t$out_dir = shift @ARGV;\n+    } elsif(\"$arg\" eq \"--make-out\") {\n+\t$make_out = shift @ARGV;\n     } elsif(\"$arg\" eq \"--gen\" || \"$arg\" eq \"-g\") {\n \t$gen = shift @ARGV;\n     } elsif(\"$arg\" eq \"--in\" || \"$arg\" eq \"-i\") {\n@@ -80,6 +84,12 @@ sub showUsage\n # test for an empty Errors file and remove it\n unlink $ErrsFile if -f -z $ErrsFile;\n \n+if (defined $make_out) {\n+    open OUT, \">\" . $make_out;\n+    print OUT @makedry;\n+    close OUT;\n+}\n+\n # Parse the make output into usable info\n parseMakeOutput();\n \n-- \ngitgitgadget\n\n"},{"id":"379046","messageId":"5c9702ea50fa2eac880e5a3d02b4e6734593d445.1563455939.git.gitgitgadget@gmail.com","threadId":"51494","inReplyTo":"pull.287.git.gitgitgadget@gmail.com","subject":"[PATCH 15/24] contrib/buildsystems: also handle -lexpat","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-07-18T13:19:10Z","receivedAt":"2019-07-18T13:19:16Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nThis is a dependency required for the non-smart HTTP backend.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n contrib/buildsystems/engine.pl | 2 ++\n 1 file changed, 2 insertions(+)\n\ndiff --git a/contrib/buildsystems/engine.pl b/contrib/buildsystems/engine.pl\nindex c35844a0c7..9bde7ae15b 100755\n--- a/contrib/buildsystems/engine.pl\n+++ b/contrib/buildsystems/engine.pl\n@@ -347,6 +347,8 @@ sub handleLinkLine\n             push(@libs, \"ssleay32.lib\");\n         } elsif (\"$part\" eq \"-lcurl\") {\n             push(@libs, \"libcurl.lib\");\n+        } elsif (\"$part\" eq \"-lexpat\") {\n+            push(@libs, \"expat.lib\");\n         } elsif (\"$part\" eq \"-liconv\") {\n             push(@libs, \"libiconv.lib\");\n         } elsif ($part =~ /^-/) {\n-- \ngitgitgadget\n\n"},{"id":"379047","messageId":"b07e83440d10da5116ed8507efdef87c02eba32e.1563455939.git.gitgitgadget@gmail.com","threadId":"51494","inReplyTo":"pull.287.git.gitgitgadget@gmail.com","subject":"[PATCH 13/24] contrib/buildsystems: handle the curl library option","fromName":"Philip Oakley via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-07-18T13:19:09Z","receivedAt":"2019-07-18T13:19:18Z","isPatch":true,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"From: Philip Oakley <philipoakley@iee.org>\n\nUpon seeing the '-lcurl' option, point to the libcurl.lib.\n\nWhile there, fix the elsif indentation.\n\nSigned-off-by: Philip Oakley <philipoakley@iee.org>\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n contrib/buildsystems/engine.pl | 4 +++-\n 1 file changed, 3 insertions(+), 1 deletion(-)\n\ndiff --git a/contrib/buildsystems/engine.pl b/contrib/buildsystems/engine.pl\nindex 1a12f4d556..d613277595 100755\n--- a/contrib/buildsystems/engine.pl\n+++ b/contrib/buildsystems/engine.pl\n@@ -341,10 +341,12 @@ sub handleLinkLine\n             $appout = shift @parts;\n         } elsif (\"$part\" eq \"-lz\") {\n             push(@libs, \"zlib.lib\");\n-\t} elsif (\"$part\" eq \"-lcrypto\") {\n+        } elsif (\"$part\" eq \"-lcrypto\") {\n             push(@libs, \"libeay32.lib\");\n         } elsif (\"$part\" eq \"-lssl\") {\n             push(@libs, \"ssleay32.lib\");\n+        } elsif (\"$part\" eq \"-lcurl\") {\n+            push(@libs, \"libcurl.lib\");\n         } elsif ($part =~ /^-/) {\n             push(@lflags, $part);\n         } elsif ($part =~ /\\.(a|lib)$/) {\n-- \ngitgitgadget\n\n"},{"id":"379048","messageId":"c696152c7f3e424d2d3ba9f57a2668cc4f1c0629.1563455939.git.gitgitgadget@gmail.com","threadId":"51494","inReplyTo":"pull.287.git.gitgitgadget@gmail.com","subject":"[PATCH 12/24] contrib/buildsystems: error out on unknown option","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-07-18T13:19:08Z","receivedAt":"2019-07-18T13:19:18Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nOne time too many did this developer call the `generate` script passing\na `--make-out=<PATH>` option that was happily ignored (because there\nshould be a space, not an equal sign, between `--make-out` and the\npath).\n\nAnd one time too many, this script not only ignored it but did not even\ncomplain. Let's fix that.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n contrib/buildsystems/engine.pl | 2 ++\n 1 file changed, 2 insertions(+)\n\ndiff --git a/contrib/buildsystems/engine.pl b/contrib/buildsystems/engine.pl\nindex 732239d817..1a12f4d556 100755\n--- a/contrib/buildsystems/engine.pl\n+++ b/contrib/buildsystems/engine.pl\n@@ -57,6 +57,8 @@ sub showUsage\n         open(F, \"<$infile\") || die \"Couldn't open file $infile\";\n         @makedry = <F>;\n         close(F);\n+    } else {\n+        die \"Unknown option: \" . $arg;\n     }\n }\n \n-- \ngitgitgadget\n\n"},{"id":"379049","messageId":"23615bc8cfd6e3d12d769f99051916ca5b2641e8.1563455939.git.gitgitgadget@gmail.com","threadId":"51494","inReplyTo":"pull.287.git.gitgitgadget@gmail.com","subject":"[PATCH 18/24] msvc: add a Makefile target to pre-generate the Visual Studio solution","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-07-18T13:19:12Z","receivedAt":"2019-07-18T13:19:19Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nThe entire idea of generating the VS solution makes only sense if we\ngenerate it via Continuous Integration; otherwise potential users would\nstill have to download the entire Git for Windows SDK.\n\nIf we pre-generate the Visual Studio solution, Git can be built entirely\nwithin Visual Studio, and the test scripts can be run in a regular Git\nfor Windows (e.g. the Portable Git flavor, which does not include a full\nGCC toolchain and therefore weighs only about a tenth of Git for\nWindows' SDK).\n\nSo let's just add a target in the Makefile that can be used to generate\nsaid solution; The generated files will then be committed so that they\ncan be pushed to a branch ready to check out by Visual Studio users.\n\nTo make things even more useful, we also generate and commit other files\nthat are required to run the test suite, such as templates and\nbin-wrappers: with this, developers can run the test suite in a regular\nGit Bash after building the solution in Visual Studio.\n\nNote: for this build target, we do not actually need to initialize the\n`vcpkg` system, so we don't.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n compat/vcbuild/README          | 23 +++++++++++++\n config.mak.uname               | 61 ++++++++++++++++++++++++++++++++++\n contrib/buildsystems/engine.pl |  3 +-\n 3 files changed, 86 insertions(+), 1 deletion(-)\n\ndiff --git a/compat/vcbuild/README b/compat/vcbuild/README\nindex b633e7db98..1b6dabf5a2 100644\n--- a/compat/vcbuild/README\n+++ b/compat/vcbuild/README\n@@ -37,6 +37,29 @@ The Steps to Build Git with VS2015 or VS2017 from the command line.\n \n ================================================================\n \n+Alternatively, run `make vcxproj` and then load the generated `git.sln` in\n+Visual Studio. The initial build will install the vcpkg system and build the\n+dependencies automatically. This will take a while.\n+\n+Instead of generating the `git.sln` file yourself (which requires a full Git\n+for Windows SDK), you may want to consider fetching the `vs/master` branch of\n+https://github.com/git-for-windows/git instead (which is updated automatically\n+via CI running `make vcxproj`). The `vs/master` branch does not require a Git\n+for Windows to build, but you can run the test scripts in a regular Git Bash.\n+\n+Note that `make vcxproj` will automatically add and commit the generated `.sln`\n+and `.vcxproj` files to the repo. This is necessary to allow building a\n+fully-testable Git in Visual Studio, where a regular Git Bash can be used to\n+run the test scripts (as opposed to a full Git for Windows SDK): a number of\n+build targets, such as Git commands implemented as Unix shell scripts (where\n+`@@SHELL_PATH@@` and other placeholders are interpolated) require a full-blown\n+Git for Windows SDK (which is about 10x the size of a regular Git for Windows\n+installation).\n+\n+If your plan is to open a Pull Request with Git for Windows, it is a good idea\n+to drop this commit before submitting.\n+\n+================================================================\n The Steps of Build Git with VS2008\n \n 1. You need the build environment, which contains the Git dependencies\ndiff --git a/config.mak.uname b/config.mak.uname\nindex 48a6723222..6d0ed923b8 100644\n--- a/config.mak.uname\n+++ b/config.mak.uname\n@@ -25,10 +25,12 @@ include compat/vcbuild/MSVC-DEFS-GEN\n \t# See if vcpkg and the vcpkg-build versions of the third-party\n \t# libraries that we use are installed.  We include the result\n \t# to get $(vcpkg_*) variables defined for the Makefile.\n+ifeq (,$(SKIP_VCPKG))\n compat/vcbuild/VCPKG-DEFS: compat/vcbuild/vcpkg_install.bat\n \t@\"$<\"\n include compat/vcbuild/VCPKG-DEFS\n endif\n+endif\n \n # We choose to avoid \"if .. else if .. else .. endif endif\"\n # because maintaining the nesting to match is a pain.  If\n@@ -689,3 +691,62 @@ ifeq ($(uname_S),QNX)\n \tNO_STRCASESTR = YesPlease\n \tNO_STRLCPY = YesPlease\n endif\n+\n+vcxproj:\n+\t# Require clean work tree\n+\tgit update-index -q --refresh && \\\n+\tgit diff-files --quiet && \\\n+\tgit diff-index --cached --quiet HEAD --\n+\n+\t# Make .vcxproj files and add them\n+\tunset QUIET_GEN QUIET_BUILT_IN; \\\n+\tperl contrib/buildsystems/generate -g Vcxproj\n+\tgit add -f git.sln {*,*/lib,t/helper/*}/*.vcxproj\n+\n+\t# Add command-list.h\n+\t$(MAKE) MSVC=1 SKIP_VCPKG=1 prefix=/mingw64 command-list.h\n+\tgit add -f command-list.h\n+\n+\t# Add scripts\n+\trm -f perl/perl.mak\n+\t$(MAKE) MSVC=1 SKIP_VCPKG=1 prefix=/mingw64 \\\n+\t\t$(SCRIPT_LIB) $(SCRIPT_SH_GEN) $(SCRIPT_PERL_GEN)\n+\t# Strip out the sane tool path, needed only for building\n+\tsed -i '/^git_broken_path_fix \".*/d' git-sh-setup\n+\tgit add -f $(SCRIPT_LIB) $(SCRIPT_SH_GEN) $(SCRIPT_PERL_GEN)\n+\n+\t# Add Perl module\n+\t$(MAKE) $(LIB_PERL_GEN)\n+\tgit add -f perl/build\n+\n+\t# Add bin-wrappers, for testing\n+\trm -rf bin-wrappers/\n+\t$(MAKE) MSVC=1 SKIP_VCPKG=1 prefix=/mingw64 $(test_bindir_programs)\n+\t# Ensure that the GIT_EXEC_PATH is a Unix-y one, and that the absolute\n+\t# path of the repository is not hard-coded (GIT_EXEC_PATH will be set\n+\t# by test-lib.sh according to the current setup)\n+\tsed -i -e 's/^\\(GIT_EXEC_PATH\\)=.*/test -n \"$${\\1##*:*}\" ||\\\n+\t\t\t\\1=\"$$(cygpath -u \"$$\\1\")\"/' \\\n+\t\t-e \"s|'$$(pwd)|\\\"\\$$GIT_EXEC_PATH\\\"'|g\" bin-wrappers/*\n+\t# Ensure that test-* helpers find the .dll files copied to top-level\n+\tsed -i 's|^PATH=.*|&:\"$$GIT_EXEC_PATH\"|' bin-wrappers/test-*\n+\t# We do not want to force hard-linking builtins\n+\tsed -i 's|\\(git\\)-\\([-a-z]*\\)\\.exe\"|\\1.exe\" \\2|g' \\\n+\t\tbin-wrappers/git-{receive-pack,upload-archive}\n+\tgit add -f $(test_bindir_programs)\n+\t# remote-ext is a builtin, but invoked as if it were external\n+\tsed 's|receive-pack|remote-ext|g' \\\n+\t\t<bin-wrappers/git-receive-pack >bin-wrappers/git-remote-ext\n+\tgit add -f bin-wrappers/git-remote-ext\n+\n+\t# Add templates\n+\t$(MAKE) -C templates\n+\tgit add -f templates/boilerplates.made templates/blt/\n+\n+\t# Add build options\n+\t$(MAKE) MSVC=1 SKIP_VCPKG=1 prefix=/mingw64 GIT-BUILD-OPTIONS\n+\tgit add -f GIT-BUILD-OPTIONS\n+\n+\t# Commit the whole shebang\n+\tgit commit -m \"Generate Visual Studio solution\" \\\n+\t\t-m \"Auto-generated by \\`$(MAKE)$(MAKEFLAGS) $@\\`\"\ndiff --git a/contrib/buildsystems/engine.pl b/contrib/buildsystems/engine.pl\nindex 8bb07e8e25..fba8a3f056 100755\n--- a/contrib/buildsystems/engine.pl\n+++ b/contrib/buildsystems/engine.pl\n@@ -82,7 +82,8 @@ sub showUsage\n # Capture the make dry stderr to file for review (will be empty for a release build).\n \n my $ErrsFile = \"msvc-build-makedryerrors.txt\";\n-@makedry = `make -C $git_dir -n MSVC=1 V=1 2>$ErrsFile` if !@makedry;\n+@makedry = `make -C $git_dir -n MSVC=1 SKIP_VCPKG=1 V=1 2>$ErrsFile`\n+if !@makedry;\n # test for an empty Errors file and remove it\n unlink $ErrsFile if -f -z $ErrsFile;\n \n-- \ngitgitgadget\n\n"},{"id":"379050","messageId":"44f0f3235e3cf801a19e2be30384a9e48a0aa3d6.1563455939.git.gitgitgadget@gmail.com","threadId":"51494","inReplyTo":"pull.287.git.gitgitgadget@gmail.com","subject":"[PATCH 20/24] .gitignore: touch up the entries regarding Visual Studio","fromName":"Philip Oakley via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-07-18T13:19:14Z","receivedAt":"2019-07-18T13:19:21Z","isPatch":true,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"From: Philip Oakley <philipoakley@iee.org>\n\nAdd the Microsoft .manifest pattern, and do not anchor the 'Debug'\nand 'Release' entries at the top-level directory, to allow for\nmultiple projects (one per target).\n\nSigned-off-by: Philip Oakley <philipoakley@iee.org>\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n .gitignore | 5 +++--\n 1 file changed, 3 insertions(+), 2 deletions(-)\n\ndiff --git a/.gitignore b/.gitignore\nindex e096e0a51c..e7bb15d301 100644\n--- a/.gitignore\n+++ b/.gitignore\n@@ -230,6 +230,7 @@\n *.ipdb\n *.dll\n .vs/\n-/Debug/\n-/Release/\n+*.manifest\n+Debug/\n+Release/\n *.dSYM\n-- \ngitgitgadget\n\n"},{"id":"379051","messageId":"59c50989eabc9da12246e58ddc3d87b34e6b46e4.1563455939.git.gitgitgadget@gmail.com","threadId":"51494","inReplyTo":"pull.287.git.gitgitgadget@gmail.com","subject":"[PATCH 17/24] contrib/buildsystems: add a backend for modern Visual Studio versions","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-07-18T13:19:12Z","receivedAt":"2019-07-18T13:19:22Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nBased on the previous patches in this patch series that fixed the\ngenerator for `.vcproj` files (which were used by Visual Studio prior to\n2015 to define projects), this patch offers to generate project\ndefinitions for neweer versions of Visual Studio (which use `.vcxproj`\nfiles).\n\nTo that end, this patch copy-edits the generator of the `.vcproj`.\n\nIn addition, we now use the `vcpkg` system which allows us to build\nGit's dependencies (e.g. curl, libexpat) conveniently. The support\nscripts were introduced in the `jh/msvc` patch series, and with this\npatch we initialize the `vcpkg` conditionally, in the `libgit` project's\n`PreBuildEvent`. To allow for parallel building of the projects, we\ntherefore put `libgit` at the bottom of the project hierarchy.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n contrib/buildsystems/Generators/Vcxproj.pm | 384 +++++++++++++++++++++\n 1 file changed, 384 insertions(+)\n create mode 100644 contrib/buildsystems/Generators/Vcxproj.pm\n\ndiff --git a/contrib/buildsystems/Generators/Vcxproj.pm b/contrib/buildsystems/Generators/Vcxproj.pm\nnew file mode 100644\nindex 0000000000..9e7ed24912\n--- /dev/null\n+++ b/contrib/buildsystems/Generators/Vcxproj.pm\n@@ -0,0 +1,384 @@\n+package Generators::Vcxproj;\n+require Exporter;\n+\n+use strict;\n+use vars qw($VERSION);\n+use Digest::SHA qw(sha256_hex);\n+\n+our $VERSION = '1.00';\n+our(@ISA, @EXPORT, @EXPORT_OK, @AVAILABLE);\n+@ISA = qw(Exporter);\n+\n+BEGIN {\n+    push @EXPORT_OK, qw(generate);\n+}\n+\n+sub generate_guid ($) {\n+\tmy $hex = sha256_hex($_[0]);\n+\t$hex =~ s/^(.{8})(.{4})(.{4})(.{4})(.{12}).*/{$1-$2-$3-$4-$5}/;\n+\t$hex =~ tr/a-z/A-Z/;\n+\treturn $hex;\n+}\n+\n+sub generate {\n+    my ($git_dir, $out_dir, $rel_dir, %build_structure) = @_;\n+    my @libs = @{$build_structure{\"LIBS\"}};\n+    foreach (@libs) {\n+        createProject($_, $git_dir, $out_dir, $rel_dir, \\%build_structure, 1);\n+    }\n+\n+    my @apps = @{$build_structure{\"APPS\"}};\n+    foreach (@apps) {\n+        createProject($_, $git_dir, $out_dir, $rel_dir, \\%build_structure, 0);\n+    }\n+\n+    createGlueProject($git_dir, $out_dir, $rel_dir, %build_structure);\n+    return 0;\n+}\n+\n+sub createProject {\n+    my ($name, $git_dir, $out_dir, $rel_dir, $build_structure, $static_library) = @_;\n+    my $label = $static_library ? \"lib\" : \"app\";\n+    my $prefix = $static_library ? \"LIBS_\" : \"APPS_\";\n+    my $config_type = $static_library ? \"StaticLibrary\" : \"Application\";\n+    print \"Generate $name vcxproj $label project\\n\";\n+    my $cdup = $name;\n+    $cdup =~ s/[^\\/]+/../g;\n+    $cdup =~ s/\\//\\\\/g;\n+    $rel_dir = $rel_dir eq \".\" ? $cdup : \"$cdup\\\\$rel_dir\";\n+    $rel_dir =~ s/\\//\\\\/g;\n+\n+    my $target = $name;\n+    if ($static_library) {\n+      $target =~ s/\\.a//;\n+    } else {\n+      $target =~ s/\\.exe//;\n+    }\n+\n+    my $uuid = generate_guid($name);\n+    $$build_structure{\"$prefix${target}_GUID\"} = $uuid;\n+    my $vcxproj = $target;\n+    $vcxproj =~ s/(.*\\/)?(.*)/$&\\/$2.vcxproj/;\n+    $vcxproj =~ s/([^\\/]*)(\\/lib)\\/(lib.vcxproj)/$1$2\\/$1_$3/;\n+    $$build_structure{\"$prefix${target}_VCXPROJ\"} = $vcxproj;\n+\n+    my @srcs = sort(map(\"$rel_dir\\\\$_\", @{$$build_structure{\"$prefix${name}_SOURCES\"}}));\n+    my @sources;\n+    foreach (@srcs) {\n+        $_ =~ s/\\//\\\\/g;\n+        push(@sources, $_);\n+    }\n+    my $defines = join(\";\", sort(@{$$build_structure{\"$prefix${name}_DEFINES\"}}));\n+    my $includes= join(\";\", sort(map { s/^-I//; s/\\//\\\\/g; File::Spec->file_name_is_absolute($_) ? $_ : \"$rel_dir\\\\$_\" } @{$$build_structure{\"$prefix${name}_INCLUDES\"}}));\n+    my $cflags = join(\" \", sort(map { s/^-[GLMOWZ].*//; s/.* .*/\"$&\"/; $_; } @{$$build_structure{\"$prefix${name}_CFLAGS\"}}));\n+    $cflags =~ s/</&lt;/g;\n+    $cflags =~ s/>/&gt;/g;\n+\n+    my $libs_release = \"\\n    \";\n+    my $libs_debug = \"\\n    \";\n+    if (!$static_library) {\n+      $libs_release = join(\";\", sort(grep /^(?!libgit\\.lib|xdiff\\/lib\\.lib|vcs-svn\\/lib\\.lib)/, @{$$build_structure{\"$prefix${name}_LIBS\"}}));\n+      $libs_debug = $libs_release;\n+      $libs_debug =~ s/zlib\\.lib/zlibd\\.lib/;\n+    }\n+\n+    $defines =~ s/-D//g;\n+    $defines =~ s/</&lt;/g;\n+    $defines =~ s/>/&gt;/g;\n+    $defines =~ s/\\'//g;\n+\n+    die \"Could not create the directory $target for $label project!\\n\" unless (-d \"$target\" || mkdir \"$target\");\n+\n+    open F, \">$vcxproj\" or die \"Could not open $vcxproj for writing!\\n\";\n+    binmode F, \":crlf :utf8\";\n+    print F chr(0xFEFF);\n+    print F << \"EOM\";\n+<?xml version=\"1.0\" encoding=\"utf-8\"?>\n+<Project DefaultTargets=\"Build\" ToolsVersion=\"14.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n+  <ItemGroup Label=\"ProjectConfigurations\">\n+    <ProjectConfiguration Include=\"Debug|Win32\">\n+      <Configuration>Debug</Configuration>\n+      <Platform>Win32</Platform>\n+    </ProjectConfiguration>\n+    <ProjectConfiguration Include=\"Release|Win32\">\n+      <Configuration>Release</Configuration>\n+      <Platform>Win32</Platform>\n+    </ProjectConfiguration>\n+    <ProjectConfiguration Include=\"Debug|x64\">\n+      <Configuration>Debug</Configuration>\n+      <Platform>x64</Platform>\n+    </ProjectConfiguration>\n+    <ProjectConfiguration Include=\"Release|x64\">\n+      <Configuration>Release</Configuration>\n+      <Platform>x64</Platform>\n+    </ProjectConfiguration>\n+  </ItemGroup>\n+  <PropertyGroup Label=\"Globals\">\n+    <ProjectGuid>$uuid</ProjectGuid>\n+    <Keyword>Win32Proj</Keyword>\n+    <VCPKGArch Condition=\"'\\$(Platform)'=='Win32'\">x86-windows</VCPKGArch>\n+    <VCPKGArch Condition=\"'\\$(Platform)'!='Win32'\">x64-windows</VCPKGArch>\n+    <VCPKGArchDirectory>$cdup\\\\compat\\\\vcbuild\\\\vcpkg\\\\installed\\\\\\$(VCPKGArch)</VCPKGArchDirectory>\n+    <VCPKGBinDirectory Condition=\"'\\(Configuration)'=='Debug'\">\\$(VCPKGArchDirectory)\\\\debug\\\\bin</VCPKGBinDirectory>\n+    <VCPKGLibDirectory Condition=\"'\\(Configuration)'=='Debug'\">\\$(VCPKGArchDirectory)\\\\debug\\\\lib</VCPKGLibDirectory>\n+    <VCPKGBinDirectory Condition=\"'\\(Configuration)'!='Debug'\">\\$(VCPKGArchDirectory)\\\\bin</VCPKGBinDirectory>\n+    <VCPKGLibDirectory Condition=\"'\\(Configuration)'!='Debug'\">\\$(VCPKGArchDirectory)\\\\lib</VCPKGLibDirectory>\n+    <VCPKGIncludeDirectory>\\$(VCPKGArchDirectory)\\\\include</VCPKGIncludeDirectory>\n+    <VCPKGLibs Condition=\"'\\(Configuration)'=='Debug'\">$libs_debug</VCPKGLibs>\n+    <VCPKGLibs Condition=\"'\\(Configuration)'!='Debug'\">$libs_release</VCPKGLibs>\n+  </PropertyGroup>\n+  <Import Project=\"\\$(VCTargetsPath)\\\\Microsoft.Cpp.Default.props\" />\n+  <PropertyGroup Condition=\"'\\$(Configuration)'=='Debug'\" Label=\"Configuration\">\n+    <UseDebugLibraries>true</UseDebugLibraries>\n+    <LinkIncremental>true</LinkIncremental>\n+  </PropertyGroup>\n+  <PropertyGroup Condition=\"'\\$(Configuration)'=='Release'\" Label=\"Configuration\">\n+    <UseDebugLibraries>false</UseDebugLibraries>\n+    <WholeProgramOptimization>true</WholeProgramOptimization>\n+  </PropertyGroup>\n+  <PropertyGroup>\n+    <ConfigurationType>$config_type</ConfigurationType>\n+    <PlatformToolset>v140</PlatformToolset>\n+    <!-- <CharacterSet>UTF-8</CharacterSet> -->\n+    <OutDir>..\\\\</OutDir>\n+    <!-- <IntDir>\\$(ProjectDir)\\$(Configuration)\\\\</IntDir> -->\n+  </PropertyGroup>\n+  <Import Project=\"\\$(VCTargetsPath)\\\\Microsoft.Cpp.props\" />\n+  <ImportGroup Label=\"ExtensionSettings\">\n+  </ImportGroup>\n+  <ImportGroup Label=\"Shared\">\n+  </ImportGroup>\n+  <ImportGroup Label=\"PropertySheets\">\n+    <Import Project=\"\\$(UserRootDir)\\\\Microsoft.Cpp.\\$(Platform).user.props\" Condition=\"exists('\\$(UserRootDir)\\\\Microsoft.Cpp.\\$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n+  </ImportGroup>\n+  <PropertyGroup Label=\"UserMacros\" />\n+  <PropertyGroup>\n+    <GenerateManifest>false</GenerateManifest>\n+    <EnableManagedIncrementalBuild>true</EnableManagedIncrementalBuild>\n+  </PropertyGroup>\n+  <ItemDefinitionGroup>\n+    <ClCompile>\n+      <AdditionalOptions>$cflags %(AdditionalOptions)</AdditionalOptions>\n+      <AdditionalIncludeDirectories>$cdup;$cdup\\\\compat;$cdup\\\\compat\\\\regex;$cdup\\\\compat\\\\win32;$cdup\\\\compat\\\\poll;$cdup\\\\compat\\\\vcbuild\\\\include;\\$(VCPKGIncludeDirectory);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n+      <EnableParallelCodeGeneration />\n+      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>\n+      <PrecompiledHeader />\n+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\n+    </ClCompile>\n+    <Lib>\n+      <SuppressStartupBanner>true</SuppressStartupBanner>\n+    </Lib>\n+    <Link>\n+      <AdditionalLibraryDirectories>\\$(VCPKGLibDirectory);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n+      <AdditionalDependencies>\\$(VCPKGLibs);\\$(AdditionalDependencies)</AdditionalDependencies>\n+      <AdditionalOptions>invalidcontinue.obj %(AdditionalOptions)</AdditionalOptions>\n+      <EntryPointSymbol>wmainCRTStartup</EntryPointSymbol>\n+      <ManifestFile>$cdup\\\\compat\\\\win32\\\\git.manifest</ManifestFile>\n+      <SubSystem>Console</SubSystem>\n+    </Link>\n+EOM\n+    if ($target eq 'libgit') {\n+        print F << \"EOM\";\n+    <PreBuildEvent Condition=\"!Exists('$cdup\\\\compat\\\\vcbuild\\\\vcpkg\\\\installed\\\\\\$(VCPKGArch)\\\\include\\\\openssl\\\\ssl.h')\">\n+      <Message>Initialize VCPKG</Message>\n+      <Command>del \"$cdup\\\\compat\\\\vcbuild\\\\vcpkg\"</Command>\n+      <Command>call \"$cdup\\\\compat\\\\vcbuild\\\\vcpkg_install.bat\"</Command>\n+    </PreBuildEvent>\n+EOM\n+    }\n+    print F << \"EOM\";\n+  </ItemDefinitionGroup>\n+  <ItemDefinitionGroup Condition=\"'\\$(Platform)'=='Win32'\">\n+    <Link>\n+      <TargetMachine>MachineX86</TargetMachine>\n+    </Link>\n+  </ItemDefinitionGroup>\n+  <ItemDefinitionGroup Condition=\"'\\$(Configuration)'=='Debug'\">\n+    <ClCompile>\n+      <Optimization>Disabled</Optimization>\n+      <PreprocessorDefinitions>WIN32;_DEBUG;$defines;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n+      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>\n+    </ClCompile>\n+    <Link>\n+      <GenerateDebugInformation>true</GenerateDebugInformation>\n+    </Link>\n+  </ItemDefinitionGroup>\n+  <ItemDefinitionGroup Condition=\"'\\$(Configuration)'=='Release'\">\n+    <ClCompile>\n+      <Optimization>MaxSpeed</Optimization>\n+      <IntrinsicFunctions>true</IntrinsicFunctions>\n+      <PreprocessorDefinitions>WIN32;NDEBUG;$defines;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n+      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\n+      <FunctionLevelLinking>true</FunctionLevelLinking>\n+      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>\n+    </ClCompile>\n+    <Link>\n+      <GenerateDebugInformation>true</GenerateDebugInformation>\n+      <EnableCOMDATFolding>true</EnableCOMDATFolding>\n+      <OptimizeReferences>true</OptimizeReferences>\n+    </Link>\n+  </ItemDefinitionGroup>\n+  <ItemGroup>\n+EOM\n+    foreach(@sources) {\n+        print F << \"EOM\";\n+    <ClCompile Include=\"$_\" />\n+EOM\n+    }\n+    print F << \"EOM\";\n+  </ItemGroup>\n+EOM\n+    if (!$static_library || $target =~ 'vcs-svn' || $target =~ 'xdiff') {\n+      my $uuid_libgit = $$build_structure{\"LIBS_libgit_GUID\"};\n+      my $uuid_xdiff_lib = $$build_structure{\"LIBS_xdiff/lib_GUID\"};\n+\n+      print F << \"EOM\";\n+  <ItemGroup>\n+    <ProjectReference Include=\"$cdup\\\\libgit\\\\libgit.vcxproj\">\n+      <Project>$uuid_libgit</Project>\n+      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>\n+    </ProjectReference>\n+EOM\n+      if (!($name =~ 'xdiff')) {\n+        print F << \"EOM\";\n+    <ProjectReference Include=\"$cdup\\\\xdiff\\\\lib\\\\xdiff_lib.vcxproj\">\n+      <Project>$uuid_xdiff_lib</Project>\n+      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>\n+    </ProjectReference>\n+EOM\n+      }\n+      if ($name =~ /(test-(line-buffer|svn-fe)|^git-remote-testsvn)\\.exe$/) {\n+        my $uuid_vcs_svn_lib = $$build_structure{\"LIBS_vcs-svn/lib_GUID\"};\n+        print F << \"EOM\";\n+    <ProjectReference Include=\"$cdup\\\\vcs-svn\\\\lib\\\\vcs-svn_lib.vcxproj\">\n+      <Project>$uuid_vcs_svn_lib</Project>\n+      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>\n+    </ProjectReference>\n+EOM\n+      }\n+      print F << \"EOM\";\n+  </ItemGroup>\n+EOM\n+    }\n+    print F << \"EOM\";\n+  <Import Project=\"\\$(VCTargetsPath)\\\\Microsoft.Cpp.targets\" />\n+EOM\n+    if (!$static_library) {\n+      print F << \"EOM\";\n+  <Target Name=\"${target}_AfterBuild\" AfterTargets=\"AfterBuild\">\n+    <ItemGroup>\n+      <DLLsAndPDBs Include=\"\\$(VCPKGBinDirectory)\\\\*.dll;\\$(VCPKGBinDirectory)\\\\*.pdb\" />\n+    </ItemGroup>\n+    <Copy SourceFiles=\"@(DLLsAndPDBs)\" DestinationFolder=\"\\$(OutDir)\" SkipUnchangedFiles=\"true\" UseHardlinksIfPossible=\"true\" />\n+  </Target>\n+EOM\n+    }\n+    print F << \"EOM\";\n+</Project>\n+EOM\n+    close F;\n+}\n+\n+sub createGlueProject {\n+    my ($git_dir, $out_dir, $rel_dir, %build_structure) = @_;\n+    print \"Generate solutions file\\n\";\n+    $rel_dir = \"..\\\\$rel_dir\";\n+    $rel_dir =~ s/\\//\\\\/g;\n+    my $SLN_HEAD = \"Microsoft Visual Studio Solution File, Format Version 11.00\\n# Visual Studio 2010\\n\";\n+    my $SLN_PRE  = \"Project(\\\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\\\") = \";\n+    my $SLN_POST = \"\\nEndProject\\n\";\n+\n+    my @libs = @{$build_structure{\"LIBS\"}};\n+    my @tmp;\n+    foreach (@libs) {\n+        $_ =~ s/\\.a//;\n+        push(@tmp, $_);\n+    }\n+    @libs = @tmp;\n+\n+    my @apps = @{$build_structure{\"APPS\"}};\n+    @tmp = ();\n+    foreach (@apps) {\n+        $_ =~ s/\\.exe//;\n+        if ($_ eq \"git\" ) {\n+            unshift(@tmp, $_);\n+        } else {\n+            push(@tmp, $_);\n+        }\n+    }\n+    @apps = @tmp;\n+\n+    open F, \">git.sln\" || die \"Could not open git.sln for writing!\\n\";\n+    binmode F, \":crlf :utf8\";\n+    print F chr(0xFEFF);\n+    print F \"$SLN_HEAD\";\n+\n+    foreach (@apps) {\n+        my $appname = $_;\n+        my $uuid = $build_structure{\"APPS_${appname}_GUID\"};\n+        print F \"$SLN_PRE\";\n+\tmy $vcxproj = $build_structure{\"APPS_${appname}_VCXPROJ\"};\n+\t$vcxproj =~ s/\\//\\\\/g;\n+        $appname =~ s/.*\\///;\n+        print F \"\\\"${appname}\\\", \\\"${vcxproj}\\\", \\\"${uuid}\\\"\";\n+        print F \"$SLN_POST\";\n+    }\n+    foreach (@libs) {\n+        my $libname = $_;\n+        my $uuid = $build_structure{\"LIBS_${libname}_GUID\"};\n+        print F \"$SLN_PRE\";\n+        my $vcxproj = $build_structure{\"LIBS_${libname}_VCXPROJ\"};\n+\t$vcxproj =~ s/\\//\\\\/g;\n+        $libname =~ s/\\//_/g;\n+        print F \"\\\"${libname}\\\", \\\"${vcxproj}\\\", \\\"${uuid}\\\"\";\n+        print F \"$SLN_POST\";\n+    }\n+\n+    print F << \"EOM\";\n+Global\n+\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n+\t\tDebug|x64 = Debug|x64\n+\t\tDebug|x86 = Debug|x86\n+\t\tRelease|x64 = Release|x64\n+\t\tRelease|x86 = Release|x86\n+\tEndGlobalSection\n+EOM\n+    print F << \"EOM\";\n+\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n+EOM\n+    foreach (@apps) {\n+        my $appname = $_;\n+        my $uuid = $build_structure{\"APPS_${appname}_GUID\"};\n+        print F \"\\t\\t${uuid}.Debug|x64.ActiveCfg = Debug|x64\\n\";\n+        print F \"\\t\\t${uuid}.Debug|x64.Build.0 = Debug|x64\\n\";\n+        print F \"\\t\\t${uuid}.Debug|x86.ActiveCfg = Debug|Win32\\n\";\n+        print F \"\\t\\t${uuid}.Debug|x86.Build.0 = Debug|Win32\\n\";\n+        print F \"\\t\\t${uuid}.Release|x64.ActiveCfg = Release|x64\\n\";\n+        print F \"\\t\\t${uuid}.Release|x64.Build.0 = Release|x64\\n\";\n+        print F \"\\t\\t${uuid}.Release|x86.ActiveCfg = Release|Win32\\n\";\n+        print F \"\\t\\t${uuid}.Release|x86.Build.0 = Release|Win32\\n\";\n+    }\n+    foreach (@libs) {\n+        my $libname = $_;\n+        my $uuid = $build_structure{\"LIBS_${libname}_GUID\"};\n+        print F \"\\t\\t${uuid}.Debug|x64.ActiveCfg = Debug|x64\\n\";\n+        print F \"\\t\\t${uuid}.Debug|x64.Build.0 = Debug|x64\\n\";\n+        print F \"\\t\\t${uuid}.Debug|x86.ActiveCfg = Debug|Win32\\n\";\n+        print F \"\\t\\t${uuid}.Debug|x86.Build.0 = Debug|Win32\\n\";\n+        print F \"\\t\\t${uuid}.Release|x64.ActiveCfg = Release|x64\\n\";\n+        print F \"\\t\\t${uuid}.Release|x64.Build.0 = Release|x64\\n\";\n+        print F \"\\t\\t${uuid}.Release|x86.ActiveCfg = Release|Win32\\n\";\n+        print F \"\\t\\t${uuid}.Release|x86.Build.0 = Release|Win32\\n\";\n+    }\n+\n+    print F << \"EOM\";\n+\tEndGlobalSection\n+\tGlobalSection(SolutionProperties) = preSolution\n+\t\tHideSolutionNode = FALSE\n+\tEndGlobalSection\n+EndGlobal\n+EOM\n+    close F;\n+}\n+\n+1;\n-- \ngitgitgadget\n\n"},{"id":"379052","messageId":"971247e32056a564161e10d05237c41d041e7ff8.1563455939.git.gitgitgadget@gmail.com","threadId":"51494","inReplyTo":"pull.287.git.gitgitgadget@gmail.com","subject":"[PATCH 22/24] bin-wrappers: append `.exe` to target paths if necessary","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-07-18T13:19:15Z","receivedAt":"2019-07-18T13:19:22Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nWhen compiling with Visual Studio, the projects' names are identical to\nthe executables modulo the extensions. Read: there will exist both a\ndirectory called `git` as well as an executable called `git.exe` in the\nend. Which means that the bin-wrappers *need* to target the `.exe` files\nlest they try to execute directories.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n Makefile | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/Makefile b/Makefile\nindex 98a0588416..3716dadc08 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2717,7 +2717,7 @@ bin-wrappers/%: wrap-for-bin.sh\n \t@mkdir -p bin-wrappers\n \t$(QUIET_GEN)sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \\\n \t     -e 's|@@BUILD_DIR@@|$(shell pwd)|' \\\n-\t     -e 's|@@PROG@@|$(patsubst test-%,t/helper/test-%,$(@F))|' < $< > $@ && \\\n+\t     -e 's|@@PROG@@|$(patsubst test-%,t/helper/test-%$(X),$(@F))$(patsubst git%,$(X),$(filter $(@F),$(BINDIR_PROGRAMS_NEED_X)))|' < $< > $@ && \\\n \tchmod +x $@\n \n # GNU make supports exporting all variables by \"export\" without parameters.\n-- \ngitgitgadget\n\n"},{"id":"379053","messageId":"151b9921d09dd622e27caa4571d260ed24f4d69b.1563455939.git.gitgitgadget@gmail.com","threadId":"51494","inReplyTo":"pull.287.git.gitgitgadget@gmail.com","subject":"[PATCH 24/24] git: avoid calling aliased builtins via their dashed form","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-07-18T13:19:16Z","receivedAt":"2019-07-18T13:19:24Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nThis is one of the few places where Git violates its own deprecation of\nthe dashed form. It is not necessary, either.\n\nAs of 595d59e2b53 (git.c: ignore pager.* when launching builtin as\ndashed external, 2017-08-02), Git wants to ignore the pager.* config\nsetting when expanding aliases. So let's strip out the\ncheck_pager_config(<command-name>) call from the copy-edited code.\n\nThis code actually made it into upstream git.git already, but it was\ndisabled in `#if 0 ... #endif` guards so far.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n git.c | 3 ---\n 1 file changed, 3 deletions(-)\n\ndiff --git a/git.c b/git.c\nindex f4c0478f32..3049dae85b 100644\n--- a/git.c\n+++ b/git.c\n@@ -743,8 +743,6 @@ static int run_argv(int *argcp, const char ***argv)\n \t\t */\n \t\tif (!done_alias)\n \t\t\thandle_builtin(*argcp, *argv);\n-\n-#if 0 // TODO In GFW, need to amend a7924b655e940b06cb547c235d6bed9767929673 to include trace2_ and _tr2 lines.\n \t\telse if (get_builtin(**argv)) {\n \t\t\tstruct argv_array args = ARGV_ARRAY_INIT;\n \t\t\tint i;\n@@ -779,7 +777,6 @@ static int run_argv(int *argcp, const char ***argv)\n \t\t\t\texit(i);\n \t\t\tdie(\"could not execute builtin %s\", **argv);\n \t\t}\n-#endif // a7924b655e940b06cb547c235d6bed9767929673\n \n \t\t/* .. then try the external ones */\n \t\texecv_dashed_external(*argv);\n-- \ngitgitgadget\n"},{"id":"379054","messageId":"db69b33ff4a583f75e07f15d10dba70bd99fcaf7.1563455939.git.gitgitgadget@gmail.com","threadId":"51494","inReplyTo":"pull.287.git.gitgitgadget@gmail.com","subject":"[PATCH 23/24] t5505,t5516: create .git/branches/ when needed","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-07-18T13:19:16Z","receivedAt":"2019-07-18T13:19:26Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nIt is a real old anachronism from the Cogito days to have a\n.git/branches/ directory. And to have tests that ensure that Cogito\nusers can migrate away from using that directory.\n\nBut so be it, let's continue testing it.\n\nLet's make sure, however, that git init does not need to create that\ndirectory.\n\nThis bug was noticed when testing with templates that had been\npre-committed, skipping the empty branches/ directory of course because\nGit does not track empty directories.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n t/t5505-remote.sh     | 2 ++\n t/t5516-fetch-push.sh | 4 ++++\n 2 files changed, 6 insertions(+)\n\ndiff --git a/t/t5505-remote.sh b/t/t5505-remote.sh\nindex 883b32efa0..1132964044 100755\n--- a/t/t5505-remote.sh\n+++ b/t/t5505-remote.sh\n@@ -824,6 +824,7 @@ test_expect_success 'migrate a remote from named file in $GIT_DIR/branches' '\n \t(\n \t\tcd six &&\n \t\tgit remote rm origin &&\n+\t\tmkdir -p .git/branches &&\n \t\techo \"$origin_url\" >.git/branches/origin &&\n \t\tgit remote rename origin origin &&\n \t\ttest_path_is_missing .git/branches/origin &&\n@@ -838,6 +839,7 @@ test_expect_success 'migrate a remote from named file in $GIT_DIR/branches (2)'\n \t(\n \t\tcd seven &&\n \t\tgit remote rm origin &&\n+\t\tmkdir -p .git/branches &&\n \t\techo \"quux#foom\" > .git/branches/origin &&\n \t\tgit remote rename origin origin &&\n \t\ttest_path_is_missing .git/branches/origin &&\ndiff --git a/t/t5516-fetch-push.sh b/t/t5516-fetch-push.sh\nindex c81ca360ac..47c2959a90 100755\n--- a/t/t5516-fetch-push.sh\n+++ b/t/t5516-fetch-push.sh\n@@ -866,6 +866,7 @@ test_expect_success 'fetch with branches' '\n \tmk_empty testrepo &&\n \tgit branch second $the_first_commit &&\n \tgit checkout second &&\n+\tmkdir -p testrepo/.git/branches &&\n \techo \"..\" > testrepo/.git/branches/branch1 &&\n \t(\n \t\tcd testrepo &&\n@@ -879,6 +880,7 @@ test_expect_success 'fetch with branches' '\n \n test_expect_success 'fetch with branches containing #' '\n \tmk_empty testrepo &&\n+\tmkdir -p testrepo/.git/branches &&\n \techo \"..#second\" > testrepo/.git/branches/branch2 &&\n \t(\n \t\tcd testrepo &&\n@@ -893,6 +895,7 @@ test_expect_success 'fetch with branches containing #' '\n test_expect_success 'push with branches' '\n \tmk_empty testrepo &&\n \tgit checkout second &&\n+\tmkdir -p .git/branches &&\n \techo \"testrepo\" > .git/branches/branch1 &&\n \tgit push branch1 &&\n \t(\n@@ -905,6 +908,7 @@ test_expect_success 'push with branches' '\n \n test_expect_success 'push with branches containing #' '\n \tmk_empty testrepo &&\n+\tmkdir -p .git/branches &&\n \techo \"testrepo#branch3\" > .git/branches/branch2 &&\n \tgit push branch2 &&\n \t(\n-- \ngitgitgadget\n\n"},{"id":"379055","messageId":"052a98b8bb8aef572cba41dbdaf15a7b987b8270.1563455939.git.gitgitgadget@gmail.com","threadId":"51494","inReplyTo":"pull.287.git.gitgitgadget@gmail.com","subject":"[PATCH 14/24] contrib/buildsystems: handle libiconv, too","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-07-18T13:19:10Z","receivedAt":"2019-07-18T13:19:30Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nGit's test suite shows tons of breakages unless Git is compiled\n*without* NO_ICONV. That means, in turn, that we need to generate\nbuild definitions *with* libiconv, which in turn implies that we\nhave to handle the -liconv option properly.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n contrib/buildsystems/engine.pl | 2 ++\n 1 file changed, 2 insertions(+)\n\ndiff --git a/contrib/buildsystems/engine.pl b/contrib/buildsystems/engine.pl\nindex d613277595..c35844a0c7 100755\n--- a/contrib/buildsystems/engine.pl\n+++ b/contrib/buildsystems/engine.pl\n@@ -347,6 +347,8 @@ sub handleLinkLine\n             push(@libs, \"ssleay32.lib\");\n         } elsif (\"$part\" eq \"-lcurl\") {\n             push(@libs, \"libcurl.lib\");\n+        } elsif (\"$part\" eq \"-liconv\") {\n+            push(@libs, \"libiconv.lib\");\n         } elsif ($part =~ /^-/) {\n             push(@lflags, $part);\n         } elsif ($part =~ /\\.(a|lib)$/) {\n-- \ngitgitgadget\n\n"},{"id":"379057","messageId":"8f19bb5a8c816c4a269a946670b94940a7616247.1563455939.git.gitgitgadget@gmail.com","threadId":"51494","inReplyTo":"pull.287.git.gitgitgadget@gmail.com","subject":"[PATCH 21/24] .gitignore: ignore Visual Studio's temporary/generated files","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-07-18T13:19:14Z","receivedAt":"2019-07-18T13:19:31Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n .gitignore | 3 +++\n 1 file changed, 3 insertions(+)\n\ndiff --git a/.gitignore b/.gitignore\nindex e7bb15d301..fcfb708b9e 100644\n--- a/.gitignore\n+++ b/.gitignore\n@@ -233,4 +233,7 @@\n *.manifest\n Debug/\n Release/\n+/UpgradeLog*.htm\n+/git.VC.VC.opendb\n+/git.VC.db\n *.dSYM\n-- \ngitgitgadget\n\n"},{"id":"379056","messageId":"33bed9a7a6b3ac16108e90463d695dcb49d39720.1563455939.git.gitgitgadget@gmail.com","threadId":"51494","inReplyTo":"pull.287.git.gitgitgadget@gmail.com","subject":"[PATCH 19/24] vcxproj: also link-or-copy builtins","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-07-18T13:19:13Z","receivedAt":"2019-07-18T13:19:33Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nThe default location for `.exe` files linked by Visual Studio depends on\nthe mode (debug vs release) and the architecture. Meaning: after a full\nbuild, there is a `git.exe` in the top-level directory, but none of the\nbuilt-ins are linked..\n\nWhen running a test script in Git Bash, it therefore would pick up the\nwrong, say, `git-receive-pack.exe`: the one installed at the same time\nas the Git Bash.\n\nAbsolutely not what we want. We want to have confidence that our test\ncovers the MSVC-built Git executables, and not some random stuff.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n config.mak.uname                           | 15 +++++++++++++++\n contrib/buildsystems/Generators/Vcxproj.pm |  3 +++\n 2 files changed, 18 insertions(+)\n\ndiff --git a/config.mak.uname b/config.mak.uname\nindex 6d0ed923b8..db7f06b95f 100644\n--- a/config.mak.uname\n+++ b/config.mak.uname\n@@ -703,6 +703,21 @@ vcxproj:\n \tperl contrib/buildsystems/generate -g Vcxproj\n \tgit add -f git.sln {*,*/lib,t/helper/*}/*.vcxproj\n \n+\t# Generate the LinkOrCopyBuiltins.targets file\n+\t(echo '<Project xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">' && \\\n+\t echo '  <Target Name=\"CopyBuiltins_AfterBuild\" AfterTargets=\"AfterBuild\">' && \\\n+\t for name in $(BUILT_INS);\\\n+\t do \\\n+\t   echo '    <Copy SourceFiles=\"$$(OutDir)\\git.exe\" DestinationFiles=\"$$(OutDir)\\'\"$$name\"'\" SkipUnchangedFiles=\"true\" UseHardlinksIfPossible=\"true\" />'; \\\n+\t done && \\\n+\t for name in $(REMOTE_CURL_ALIASES); \\\n+\t do \\\n+\t   echo '    <Copy SourceFiles=\"$$(OutDir)\\'\"$(REMOTE_CURL_PRIMARY)\"'\" DestinationFiles=\"$$(OutDir)\\'\"$$name\"'\" SkipUnchangedFiles=\"true\" UseHardlinksIfPossible=\"true\" />'; \\\n+\t done && \\\n+\t echo '  </Target>' && \\\n+\t echo '</Project>') >git/LinkOrCopyBuiltins.targets\n+\tgit add -f git/LinkOrCopyBuiltins.targets\n+\n \t# Add command-list.h\n \t$(MAKE) MSVC=1 SKIP_VCPKG=1 prefix=/mingw64 command-list.h\n \tgit add -f command-list.h\ndiff --git a/contrib/buildsystems/Generators/Vcxproj.pm b/contrib/buildsystems/Generators/Vcxproj.pm\nindex 9e7ed24912..4b02524b10 100644\n--- a/contrib/buildsystems/Generators/Vcxproj.pm\n+++ b/contrib/buildsystems/Generators/Vcxproj.pm\n@@ -273,6 +273,9 @@ sub createProject {\n   </Target>\n EOM\n     }\n+    if ($target eq 'git') {\n+      print F \"  <Import Project=\\\"LinkOrCopyBuiltins.targets\\\" />\\n\";\n+    }\n     print F << \"EOM\";\n </Project>\n EOM\n-- \ngitgitgadget\n\n"},{"id":"379058","messageId":"1d4c5539ef5e9c1e83e0ce6d641c535dabf5d242.1563455939.git.gitgitgadget@gmail.com","threadId":"51494","inReplyTo":"pull.287.git.gitgitgadget@gmail.com","subject":"[PATCH 16/24] contrib/buildsystems: handle options starting with a slash","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-07-18T13:19:11Z","receivedAt":"2019-07-18T13:19:35Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nWith the recent changes to allow building with MSVC=1, we now pass the\n/OPT:REF option to the compiler. This confuses the parser that wants to\nturn the output of a dry run into project definitions for QMake and Visual\nStudio:\n\n\tUnhandled link option @ line 213: /OPT:REF at [...]\n\nLet's just extend the code that passes through options that start with a\ndash, so that it passes through options that start with a slash, too.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n contrib/buildsystems/engine.pl | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/contrib/buildsystems/engine.pl b/contrib/buildsystems/engine.pl\nindex 9bde7ae15b..8bb07e8e25 100755\n--- a/contrib/buildsystems/engine.pl\n+++ b/contrib/buildsystems/engine.pl\n@@ -351,7 +351,7 @@ sub handleLinkLine\n             push(@libs, \"expat.lib\");\n         } elsif (\"$part\" eq \"-liconv\") {\n             push(@libs, \"libiconv.lib\");\n-        } elsif ($part =~ /^-/) {\n+        } elsif ($part =~ /^[-\\/]/) {\n             push(@lflags, $part);\n         } elsif ($part =~ /\\.(a|lib)$/) {\n             $part =~ s/\\.a$/.lib/;\n-- \ngitgitgadget\n\n"},{"id":"379059","messageId":"c10fd668ef943c2bfc0cfb909e5807ee87d65e23.1563455939.git.gitgitgadget@gmail.com","threadId":"51494","inReplyTo":"pull.287.git.gitgitgadget@gmail.com","subject":"[PATCH 08/24] contrib/buildsystems: handle quoted spaces in filenames","fromName":"Philip Oakley via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-07-18T13:19:06Z","receivedAt":"2019-07-18T13:19:36Z","isPatch":true,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"From: Philip Oakley <philipoakley@iee.org>\n\nThe engine.pl script expects file names not to contain spaces. However,\npaths with spaces are quite prevalent on Windows. Use shellwords() rather\nthan split() to parse them correctly.\n\nHelped-by: Junio C Hamano <gitster@pobox.com>\nSigned-off-by: Philip Oakley <philipoakley@iee.org>\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n contrib/buildsystems/engine.pl | 7 ++++---\n 1 file changed, 4 insertions(+), 3 deletions(-)\n\ndiff --git a/contrib/buildsystems/engine.pl b/contrib/buildsystems/engine.pl\nindex 11f0e16dda..ad6a82c30c 100755\n--- a/contrib/buildsystems/engine.pl\n+++ b/contrib/buildsystems/engine.pl\n@@ -12,6 +12,7 @@\n use File::Spec;\n use Cwd;\n use Generators;\n+use Text::ParseWords;\n \n my (%build_structure, %compile_options, @makedry);\n my $out_dir = getcwd();\n@@ -231,7 +232,7 @@ sub removeDuplicates\n sub handleCompileLine\n {\n     my ($line, $lineno) = @_;\n-    my @parts = split(' ', $line);\n+    my @parts = shellwords($line);\n     my $sourcefile;\n     shift(@parts); # ignore cmd\n     while (my $part = shift @parts) {\n@@ -265,7 +266,7 @@ sub handleLibLine\n     my (@objfiles, @lflags, $libout, $part);\n     # kill cmd and rm 'prefix'\n     $line =~ s/^rm -f .* && .* rcs //;\n-    my @parts = split(' ', $line);\n+    my @parts = shellwords($line);\n     while ($part = shift @parts) {\n         if ($part =~ /^-/) {\n             push(@lflags, $part);\n@@ -306,7 +307,7 @@ sub handleLinkLine\n {\n     my ($line, $lineno) = @_;\n     my (@objfiles, @lflags, @libs, $appout, $part);\n-    my @parts = split(' ', $line);\n+    my @parts = shellwords($line);\n     shift(@parts); # ignore cmd\n     while ($part = shift @parts) {\n         if ($part =~ /^-IGNORE/) {\n-- \ngitgitgadget\n\n"},{"id":"379060","messageId":"f4d41c65e92b2aab43986c2f3763f33e82f3120c.1563455939.git.gitgitgadget@gmail.com","threadId":"51494","inReplyTo":"pull.287.git.gitgitgadget@gmail.com","subject":"[PATCH 04/24] Vcproj.pm: urlencode '<' and '>' when generating VC projects","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-07-18T13:19:03Z","receivedAt":"2019-07-18T13:19:37Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n contrib/buildsystems/Generators/Vcproj.pm | 8 ++++++++\n 1 file changed, 8 insertions(+)\n\ndiff --git a/contrib/buildsystems/Generators/Vcproj.pm b/contrib/buildsystems/Generators/Vcproj.pm\nindex b17800184c..737647e76a 100644\n--- a/contrib/buildsystems/Generators/Vcproj.pm\n+++ b/contrib/buildsystems/Generators/Vcproj.pm\n@@ -59,6 +59,8 @@ sub createLibProject {\n     my $includes= join(\";\", sort(map(\"&quot;$rel_dir\\\\$_&quot;\", @{$$build_structure{\"LIBS_${libname}_INCLUDES\"}})));\n     my $cflags  = join(\" \", sort(@{$$build_structure{\"LIBS_${libname}_CFLAGS\"}}));\n     $cflags =~ s/\\\"/&quot;/g;\n+    $cflags =~ s/</&lt;/g;\n+    $cflags =~ s/>/&gt;/g;\n \n     my $cflags_debug = $cflags;\n     $cflags_debug =~ s/-MT/-MTd/;\n@@ -80,6 +82,8 @@ sub createLibProject {\n \n     $defines =~ s/-D//g;\n     $defines =~ s/\\\"/\\\\&quot;/g;\n+    $defines =~ s/</&lt;/g;\n+    $defines =~ s/>/&gt;/g;\n     $defines =~ s/\\'//g;\n     $includes =~ s/-I//g;\n     mkdir \"$target\" || die \"Could not create the directory $target for lib project!\\n\";\n@@ -271,6 +275,8 @@ sub createAppProject {\n     my $includes= join(\";\", sort(map(\"&quot;$rel_dir\\\\$_&quot;\", @{$$build_structure{\"APPS_${appname}_INCLUDES\"}})));\n     my $cflags  = join(\" \", sort(@{$$build_structure{\"APPS_${appname}_CFLAGS\"}}));\n     $cflags =~ s/\\\"/&quot;/g;\n+    $cflags =~ s/</&lt;/g;\n+    $cflags =~ s/>/&gt;/g;\n \n     my $cflags_debug = $cflags;\n     $cflags_debug =~ s/-MT/-MTd/;\n@@ -297,6 +303,8 @@ sub createAppProject {\n \n     $defines =~ s/-D//g;\n     $defines =~ s/\\\"/\\\\&quot;/g;\n+    $defines =~ s/</&lt;/g;\n+    $defines =~ s/>/&gt;/g;\n     $defines =~ s/\\'//g;\n     $defines =~ s/\\\\\\\\/\\\\/g;\n     $includes =~ s/-I//g;\n-- \ngitgitgadget\n\n"},{"id":"379080","messageId":"xmqqftn3xet7.fsf@gitster-ct.c.googlers.com","threadId":"51494","inReplyTo":"db69b33ff4a583f75e07f15d10dba70bd99fcaf7.1563455939.git.gitgitgadget@gmail.com","subject":"Re: [PATCH 23/24] t5505,t5516: create .git/branches/ when needed","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2019-07-18T20:34:12Z","receivedAt":"2019-07-18T20:34:21Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Johannes Schindelin via GitGitGadget\" <gitgitgadget@gmail.com>\nwrites:\n\n> From: Johannes Schindelin <johannes.schindelin@gmx.de>\n>\n> It is a real old anachronism from the Cogito days to have a\n> .git/branches/ directory. And to have tests that ensure that Cogito\n> users can migrate away from using that directory.\n>\n> But so be it, let's continue testing it.\n>\n> Let's make sure, however, that git init does not need to create that\n> directory.\n>\n> This bug was noticed when testing with templates that had been\n> pre-committed, skipping the empty branches/ directory of course because\n> Git does not track empty directories.\n\nMany tests assume that the .git/info/ directory exists, and the only\nreason why they can is because we have templates/info--exclude; the\nsituation around .git/branches/ is exactly the same.\n\nDeprecating .git/branches/ directory and dropping the parts of tests\nthat wants to make sure the support still works (t5516 is not about\nmigration but about working with .git/branches configuration) would\nbe a different matter.  Until that happens, let's not do this patch;\notherwise it would force us to sprinkle \"mkdir -p .git/info/\" all\nover the place for the same rationale.  A directory in .git/ created\nby hardcoded mkdir in \"git init\" (like .git/refs/) and created by\ncopying templates by \"git init\" (like .git/info/ and .git/branches)\nare both \"created by 'git init'\".  Special casing the latter is just\nsilly.\n\n"},{"id":"379100","messageId":"nycvar.QRO.7.76.6.1907191555180.47@tvgsbejvaqbjf.bet","threadId":"51494","inReplyTo":"xmqqftn3xet7.fsf@gitster-ct.c.googlers.com","subject":"Re: [PATCH 23/24] t5505,t5516: create .git/branches/ when needed","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2019-07-19T14:52:00Z","receivedAt":"2019-07-19T14:52:27Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Junio,\n\nOn Thu, 18 Jul 2019, Junio C Hamano wrote:\n\n> \"Johannes Schindelin via GitGitGadget\" <gitgitgadget@gmail.com>\n> writes:\n>\n> > From: Johannes Schindelin <johannes.schindelin@gmx.de>\n> >\n> > It is a real old anachronism from the Cogito days to have a\n> > .git/branches/ directory. And to have tests that ensure that Cogito\n> > users can migrate away from using that directory.\n> >\n> > But so be it, let's continue testing it.\n> >\n> > Let's make sure, however, that git init does not need to create that\n> > directory.\n> >\n> > This bug was noticed when testing with templates that had been\n> > pre-committed, skipping the empty branches/ directory of course because\n> > Git does not track empty directories.\n>\n> Many tests assume that the .git/info/ directory exists, and the only\n> reason why they can is because we have templates/info--exclude; the\n> situation around .git/branches/ is exactly the same.\n\nNo, the situation with `info/` is that it includes a file called\n`exclude`, which means that the `templates/` directory can be \"tracked\".\nThis is important because we want to commit all those generated files\nthat cannot be generated inside Visual Studio without Git for Windows'\nSDK (which weighs in with several hundred megabytes to download, a\ngigabyte on disk).\n\nThe `branches/` subdirectory, in contrast, is totally useless for at\nleast 99.999% of the users, and hence it is understandable that it does\nnot even contain a single file. Which means that it is *not* \"tracked\".\n\nSo when checking out, e.g. the `vs/master` branch at\nhttps://github.com/git-for-windows/git, which is auto-generated using\nthis here patch series from Git for Windows' `master`, to allow building\nin Visual Studio without having to download the full Git for Windows\nSDK, there will be the `info/` directory (by virtue of containing a\ntrackable file) exists, and the `branches/` subdirectory won't exist.\n\nAs a consequence, the test scripts indicated in the commit message,\nwhich _can_ be run in a regular Git for Windows (no Git for Windows SDK\nrequired), will fail without this patch.\n\n> Deprecating .git/branches/ directory and dropping the parts of tests\n> that wants to make sure the support still works (t5516 is not about\n> migration but about working with .git/branches configuration) would\n> be a different matter.\n\nIndeed.\n\nYou probably forgot that I already proposed that, long time ago:\nhttps://public-inbox.org/git/cover.1494509599.git.johannes.schindelin@gmx.de/\n\nI haven't forgotten, because you shot it down unceremoniously:\n\n\tThe last time I thought about trying this several years ago, I found\n\tthat people who need to grab things from many places still do use\n\t.git/branches/ and their use case is hard to migrate to .git/config,\n\tprimarily because the former is \"one per file\" and it is easy to\n\tadd/remove/tweak without affecting others.  Ask akpm@ if he still\n\tprefers to use .git/branches/ for example.\n\nOf course, with such a kind of argument, there is no way how I could\npossibly prove that it is no longer advisable to have `.git/branches/`.\n\n\"Someone, somewhere _probably_ finds this still useful, so we won't\nremove it.\"\n\n> Until that happens, let's not do this patch;\n\nWell, that's another of these type of arguments.\n\nWithout this patch, and without removing support for `.git/branches/`,\nyou force the Visual Studio build to _not_ pass the test suite. It's as\nsimple as that.\n\nSo basically, by this statement you decided that there will not be a\nfully-functional way to build Git in Visual Studio and to pass the test\nsuite with that.\n\nWhich is a shame.\n\n> otherwise it would force us to sprinkle \"mkdir -p .git/info/\" all\n> over the place for the same rationale.\n\nYou may have assumed that I did not carefully verify that the test suite\npasses with these patches. But I did. And I would not have submitted\nthis patch series if such a patch was necessary, at least not without\nsaid patch.\n\n> A directory in .git/ created by hardcoded mkdir in \"git init\" (like\n> .git/refs/) and created by copying templates by \"git init\" (like\n> .git/info/ and .git/branches) are both \"created by 'git init'\".\n> Special casing the latter is just silly.\n\nThe thing that _really_ is silly is that we have that directory in\nGit's templates, still.\n\nGit itself does not populate it. Git does not need it, ever. Git works\nJust Fine without it, and it is really by design that it does not\nrequire the presence of that subdirectory.\n\nOnly those two test cases insist, for some reason that escapes me, on\nthe presence of those subdirectories.\n\nAs I said, Git does not populate that subdirectory. It even lacks all\nfacilities to populate it. You have to write the files inside it\nyourself, you have to figure out the syntax of the files in that\ndirectory, and the only place where we document this is buried deeply in\n`Documentation/gitrepository-layout.txt`.\n\nIt is a bit silly, too, that we say there, in that very documentation\nfor that very feature, that this feature is \"slightly deprecated\".\n\nEither it is deprecated, or it isn't.\n\nFurther, it is a bit silly that this \"slight deprecation\" has been there\nsince a1d4aa74241 (Add repository-layout document., 2005-09-01).\n\nIn other words, that feature was \"slightly deprecated\" already a mere\nfive months after Git was made public. Yet we still shlep it around,\nfourteen (!) years later.\n\nIn yet other words, the support for `.git/branches` has been \"slightly\ndeprecated\" more than 33x longer than it hasn't been.\n\nI just wish that my patches to remove the support for `.git/branches`\nwould have gone somewhere useful instead of into this ugly impasse.\n\nCiao,\nDscho\n"},{"id":"379101","messageId":"xmqqpnm6vz9m.fsf@gitster-ct.c.googlers.com","threadId":"51494","inReplyTo":"nycvar.QRO.7.76.6.1907191555180.47@tvgsbejvaqbjf.bet","subject":"Re: [PATCH 23/24] t5505,t5516: create .git/branches/ when needed","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2019-07-19T15:07:33Z","receivedAt":"2019-07-19T15:07:39Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> Without this patch, and without removing support for `.git/branches/`,\n> you force the Visual Studio build to _not_ pass the test suite. It's as\n> simple as that.\n\nI see it as deficiency of the build procedure.  What makes it so\ndifferent, compared to \"make\" we type on our boxes, where we do get\nthe .git/branches/ directory anyway, even without having any file in\nit?  The patch in question is to punt solving that and instead break\nthe test suite.\n"},{"id":"379104","messageId":"xmqqd0i6vxwt.fsf@gitster-ct.c.googlers.com","threadId":"51494","inReplyTo":"nycvar.QRO.7.76.6.1907191555180.47@tvgsbejvaqbjf.bet","subject":"Re: [PATCH 23/24] t5505,t5516: create .git/branches/ when needed","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2019-07-19T15:36:50Z","receivedAt":"2019-07-19T15:36:58Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> You probably forgot that I already proposed that, long time ago:\n> https://public-inbox.org/git/cover.1494509599.git.johannes.schindelin@gmx.de/\n\nNo, I haven't.  It was actually meant as an invitation to you to\nhelp us come up with a reasonable deprecation path.\n\nI'd be super happy if we did not have to support 3 sources and\ninstead just 2 sources of the remote information, but as I said\nnumber of times in the previous attempts' discussion, I think it is\ntrickier than any of our past migration (like \"push.default\") to\nremove support for .git/branches, as I see no reasonably convenient\nalternative/workaround for those who do take advantage of the fact\nthat .git/branches/ is \"one liner, single file per remote source\",\nwhich would make it convenient when you need to interact with dozens\nof sublevel integrators and the population of them changes\nregularly.  \"Run 'git remote add' with these options to limit its\nscope to a single branch\" is easy to say but cumbersome to execute.\n\nThe best case scenario I came up with is to start giving a message\nwhen we read *and* *use* information from .git/branches/ hierarchy\n(i.e. when we know we found a potential user who will get affected\nby removal of .git/branches support), asking to tell us not to go\nforward with the removal if and only if an alternative we leave for\nthem gives them unacceptably high cost (i.e. \"we cannot afford to\nmigrate our workflow not to use .git/branches/ because ...\"), and\nafter a few releases we do not hear anything from anybody.  The\nsecond best would be to see responses that can serve as concrete\nexamples to build our easy-to-use alternative after removing the\nsupport for .git/branches/.  The alternative might end up not\nremoving the support, but that is OK---we are in far better position\nthan we currently are either way.  The reason why we still have the\nsupport is mainly because we know there were users who took active\nadvantage of that facility (again, not Cogito) several years ago,\nand we do not know if they moved on to update their workflows to use\nthe config-based settings.  After the above (or something similar)\nhappens, we will know that nobody needs it and we can remove it with\nconfidence.\n"},{"id":"379105","messageId":"xmqq8ssuvvf4.fsf@gitster-ct.c.googlers.com","threadId":"51494","inReplyTo":"xmqqd0i6vxwt.fsf@gitster-ct.c.googlers.com","subject":"Re: [PATCH 23/24] t5505,t5516: create .git/branches/ when needed","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2019-07-19T16:30:39Z","receivedAt":"2019-07-19T16:30:44Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n>\n>> You probably forgot that I already proposed that, long time ago:\n>> https://public-inbox.org/git/cover.1494509599.git.johannes.schindelin@gmx.de/\n>\n> No, I haven't.  It was actually meant as an invitation to you to\n> help us come up with a reasonable deprecation path.\n\nBy the way, while the \"deprecation plan\" still has my attention ;-),\nthere is another thing I've been wanting to see happen *without*\nburning me like the last time it was brought up [*1*], which is also\nhard to come up with a reasonable deprecation path.\n\nA newer port like Git for Windows, where I suspect that most of the\nusers are not even aware of the \"git-foo\" form, can probably get\naway by not shipping the libexec/git/git-foo without getting its\nusers complaining (and as you repeatedly said, nobody on Windows\nwrite shell scripts, so lack of support for old scripts writtin in\nthe days back when git-foo was a norm is perfectly fine there).  But\nI am not sure about my tree where audiences are beyond Windows, and\nI certainly do not want to get burned again myself.  \n\nSomebody else volunteering to take both blame (and flame) and credit\nwould be most welcomed ;-).\n\n\n[Reference]\n\n*1* https://public-inbox.org/git/7vr68b8q9p.fsf@gitster.siamese.dyndns.org/\n"},{"id":"379521","messageId":"240ff4251774fbede9cce21a5140af655e05d7ba.1564430879.git.gitgitgadget@gmail.com","threadId":"51494","inReplyTo":"pull.287.v2.git.gitgitgadget@gmail.com","subject":"[PATCH v2 01/23] Vcproj.pm: auto-generate GUIDs","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-07-29T20:08:01Z","receivedAt":"2019-07-29T20:08:07Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nWe ran out GUIDs. Again. But there is no need to: we can generate them\nsemi-randomly from the target file name of the project.\n\nNote: the Vcproj generator is probably only interesting for historical\nreasons; nevertheless, the upcoming Vcxproj generator (to support modern\nVisual Studio versions) is based on the Vcproj generator and it is\nbetter to fix this here first.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n contrib/buildsystems/Generators/Vcproj.pm | 66 ++++-------------------\n 1 file changed, 9 insertions(+), 57 deletions(-)\n\ndiff --git a/contrib/buildsystems/Generators/Vcproj.pm b/contrib/buildsystems/Generators/Vcproj.pm\nindex cfa74adcc2..c79b706bc8 100644\n--- a/contrib/buildsystems/Generators/Vcproj.pm\n+++ b/contrib/buildsystems/Generators/Vcproj.pm\n@@ -3,6 +3,7 @@ package Generators::Vcproj;\n \n use strict;\n use vars qw($VERSION);\n+use Digest::SHA qw(sha256_hex);\n \n our $VERSION = '1.00';\n our(@ISA, @EXPORT, @EXPORT_OK, @AVAILABLE);\n@@ -12,59 +13,12 @@ BEGIN\n     push @EXPORT_OK, qw(generate);\n }\n \n-my $guid_index = 0;\n-my @GUIDS = (\n-    \"{E07B9989-2BF7-4F21-8918-BE22BA467AC3}\",\n-    \"{278FFB51-0296-4A44-A81A-22B87B7C3592}\",\n-    \"{7346A2C4-F0FD-444F-9EBE-1AF23B2B5650}\",\n-    \"{67F421AC-EB34-4D49-820B-3196807B423F}\",\n-    \"{385DCFE1-CC8C-4211-A451-80FCFC31CA51}\",\n-    \"{97CC46C5-D2CC-4D26-B634-E75792B79916}\",\n-    \"{C7CE21FE-6EF8-4012-A5C7-A22BCEDFBA11}\",\n-    \"{51575134-3FDF-42D1-BABD-3FB12669C6C9}\",\n-    \"{0AE195E4-9823-4B87-8E6F-20C5614AF2FF}\",\n-    \"{4B918255-67CA-43BB-A46C-26704B666E6B}\",\n-    \"{18CCFEEF-C8EE-4CC1-A265-26F95C9F4649}\",\n-    \"{5D5D90FA-01B7-4973-AFE5-CA88C53AC197}\",\n-    \"{1F054320-036D-49E1-B384-FB5DF0BC8AC0}\",\n-    \"{7CED65EE-F2D9-4171-825B-C7D561FE5786}\",\n-    \"{8D341679-0F07-4664-9A56-3BA0DE88B9BC}\",\n-    \"{C189FEDC-2957-4BD7-9FA4-7622241EA145}\",\n-    \"{66844203-1B9F-4C53-9274-164FFF95B847}\",\n-    \"{E4FEA145-DECC-440D-AEEA-598CF381FD43}\",\n-    \"{73300A8E-C8AC-41B0-B555-4F596B681BA7}\",\n-    \"{873FDEB1-D01D-40BF-A1BF-8BBC58EC0F51}\",\n-    \"{7922C8BE-76C5-4AC6-8BF7-885C0F93B782}\",\n-    \"{E245D370-308B-4A49-BFC1-1E527827975F}\",\n-    \"{F6FA957B-66FC-4ED7-B260-E59BBE4FE813}\",\n-    \"{E6055070-0198-431A-BC49-8DB6CEE770AE}\",\n-    \"{54159234-C3EB-43DA-906B-CE5DA5C74654}\",\n-    \"{594CFC35-0B60-46F6-B8EF-9983ACC1187D}\",\n-    \"{D93FCAB7-1F01-48D2-B832-F761B83231A5}\",\n-    \"{DBA5E6AC-E7BE-42D3-8703-4E787141526E}\",\n-    \"{6171953F-DD26-44C7-A3BE-CC45F86FC11F}\",\n-    \"{9E19DDBE-F5E4-4A26-A2FE-0616E04879B8}\",\n-    \"{AE81A615-99E3-4885-9CE0-D9CAA193E867}\",\n-    \"{FBF4067E-1855-4F6C-8BCD-4D62E801A04D}\",\n-    \"{17007948-6593-4AEB-8106-F7884B4F2C19}\",\n-    \"{199D4C8D-8639-4DA6-82EF-08668C35DEE0}\",\n-    \"{E085E50E-C140-4CF3-BE4B-094B14F0DDD6}\",\n-    \"{00785268-A9CC-4E40-AC29-BAC0019159CE}\",\n-    \"{4C06F56A-DCDB-46A6-B67C-02339935CF12}\",\n-    \"{3A62D3FD-519E-4EC9-8171-D2C1BFEA022F}\",\n-    \"{3A62D3FD-519E-4EC9-8171-D2C1BFEA022F}\",\n-    \"{9392EB58-D7BA-410B-B1F0-B2FAA6BC89A7}\",\n-    \"{2ACAB2D5-E0CE-4027-BCA0-D78B2D7A6C66}\",\n-    \"{86E216C3-43CE-481A-BCB2-BE5E62850635}\",\n-    \"{FB631291-7923-4B91-9A57-7B18FDBB7A42}\",\n-    \"{0A176EC9-E934-45B8-B87F-16C7F4C80039}\",\n-    \"{DF55CA80-46E8-4C53-B65B-4990A23DD444}\",\n-    \"{3A0F9895-55D2-4710-BE5E-AD7498B5BF44}\",\n-    \"{294BDC5A-F448-48B6-8110-DD0A81820F8C}\",\n-    \"{4B9F66E9-FAC9-47AB-B1EF-C16756FBFD06}\",\n-    \"{72EA49C6-2806-48BD-B81B-D4905102E19C}\",\n-    \"{5728EB7E-8929-486C-8CD5-3238D060E768}\"\n-);\n+sub generate_guid ($) {\n+    my $hex = sha256_hex($_[0]);\n+    $hex =~ s/^(.{8})(.{4})(.{4})(.{4})(.{12}).*/{$1-$2-$3-$4-$5}/;\n+    $hex =~ tr/a-z/A-Z/;\n+    return $hex;\n+}\n \n sub generate {\n     my ($git_dir, $out_dir, $rel_dir, %build_structure) = @_;\n@@ -92,9 +46,8 @@ sub createLibProject {\n     $target =~ s/\\//_/g;\n     $target =~ s/\\.a//;\n \n-    my $uuid = $GUIDS[$guid_index];\n+    my $uuid = generate_guid($libname);\n     $$build_structure{\"LIBS_${target}_GUID\"} = $uuid;\n-    $guid_index += 1;\n \n     my @srcs = sort(map(\"$rel_dir\\\\$_\", @{$$build_structure{\"LIBS_${libname}_SOURCES\"}}));\n     my @sources;\n@@ -311,9 +264,8 @@ sub createAppProject {\n     $target =~ s/\\//_/g;\n     $target =~ s/\\.exe//;\n \n-    my $uuid = $GUIDS[$guid_index];\n+    my $uuid = generate_guid($appname);\n     $$build_structure{\"APPS_${target}_GUID\"} = $uuid;\n-    $guid_index += 1;\n \n     my @srcs = sort(map(\"$rel_dir\\\\$_\", @{$$build_structure{\"APPS_${appname}_SOURCES\"}}));\n     my @sources;\n-- \ngitgitgadget\n\n"},{"id":"379522","messageId":"a7898b002590adcfb103e6851d84267715ee05b0.1564430879.git.gitgitgadget@gmail.com","threadId":"51494","inReplyTo":"pull.287.v2.git.gitgitgadget@gmail.com","subject":"[PATCH v2 02/23] Vcproj.pm: list git.exe first to be startup project","fromName":"Philip Oakley via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-07-29T20:08:01Z","receivedAt":"2019-07-29T20:08:08Z","isPatch":true,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"From: Philip Oakley <philipoakley@iee.org>\n\nVisual Studio takes the first listed application/library as the default\nstartup project [1].\n\nDetect the 'git' project and place it at the head of the project list,\nrather than at the tail.\n\nExport the apps list before libs list for both the projects and global\nstructures of the .sln file.\n\n[1] http://stackoverflow.com/questions/1238553/\nvs2008-where-is-the-startup-project-setting-stored-for-a-solution\n    \"In the solution file, there are a list of pseudo-XML \"Project\"\n    entries. It turns out that whatever is the first one ends up as\n    the Startup Project, unless it’s overridden in the suo file. Argh.\n    I just rearranged the order in the file and it’s good.\"\n\n    \"just moving the pseudo-xml isn't enough. You also have to move the\n    group of entries in the \"GlobalSection(ProjectConfigurationPlatforms)\n    = postSolution\" group that has the GUID of the project you moved to\n    the top. So there are two places to move lines.\"\n\nSigned-off-by: Philip Oakley <philipoakley@iee.org>\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n contrib/buildsystems/Generators/Vcproj.pm | 33 +++++++++++++----------\n 1 file changed, 19 insertions(+), 14 deletions(-)\n\ndiff --git a/contrib/buildsystems/Generators/Vcproj.pm b/contrib/buildsystems/Generators/Vcproj.pm\nindex c79b706bc8..d862cae503 100644\n--- a/contrib/buildsystems/Generators/Vcproj.pm\n+++ b/contrib/buildsystems/Generators/Vcproj.pm\n@@ -513,20 +513,18 @@ sub createGlueProject {\n     foreach (@apps) {\n         $_ =~ s/\\//_/g;\n         $_ =~ s/\\.exe//;\n-        push(@tmp, $_);\n+        if ($_ eq \"git\" ) {\n+            unshift(@tmp, $_);\n+        } else {\n+            push(@tmp, $_);\n+        }\n     }\n     @apps = @tmp;\n \n     open F, \">git.sln\" || die \"Could not open git.sln for writing!\\n\";\n     binmode F, \":crlf\";\n     print F \"$SLN_HEAD\";\n-    foreach (@libs) {\n-        my $libname = $_;\n-        my $uuid = $build_structure{\"LIBS_${libname}_GUID\"};\n-        print F \"$SLN_PRE\";\n-        print F \"\\\"${libname}\\\", \\\"${libname}\\\\${libname}.vcproj\\\", \\\"${uuid}\\\"\";\n-        print F \"$SLN_POST\";\n-    }\n+\n     my $uuid_libgit = $build_structure{\"LIBS_libgit_GUID\"};\n     my $uuid_xdiff_lib = $build_structure{\"LIBS_xdiff_lib_GUID\"};\n     foreach (@apps) {\n@@ -540,6 +538,13 @@ sub createGlueProject {\n         print F \"\tEndProjectSection\";\n         print F \"$SLN_POST\";\n     }\n+    foreach (@libs) {\n+        my $libname = $_;\n+        my $uuid = $build_structure{\"LIBS_${libname}_GUID\"};\n+        print F \"$SLN_PRE\";\n+        print F \"\\\"${libname}\\\", \\\"${libname}\\\\${libname}.vcproj\\\", \\\"${uuid}\\\"\";\n+        print F \"$SLN_POST\";\n+    }\n \n     print F << \"EOM\";\n Global\n@@ -551,17 +556,17 @@ sub createGlueProject {\n     print F << \"EOM\";\n \tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n EOM\n-    foreach (@libs) {\n-        my $libname = $_;\n-        my $uuid = $build_structure{\"LIBS_${libname}_GUID\"};\n+    foreach (@apps) {\n+        my $appname = $_;\n+        my $uuid = $build_structure{\"APPS_${appname}_GUID\"};\n         print F \"\\t\\t${uuid}.Debug|Win32.ActiveCfg = Debug|Win32\\n\";\n         print F \"\\t\\t${uuid}.Debug|Win32.Build.0 = Debug|Win32\\n\";\n         print F \"\\t\\t${uuid}.Release|Win32.ActiveCfg = Release|Win32\\n\";\n         print F \"\\t\\t${uuid}.Release|Win32.Build.0 = Release|Win32\\n\";\n     }\n-    foreach (@apps) {\n-        my $appname = $_;\n-        my $uuid = $build_structure{\"APPS_${appname}_GUID\"};\n+    foreach (@libs) {\n+        my $libname = $_;\n+        my $uuid = $build_structure{\"LIBS_${libname}_GUID\"};\n         print F \"\\t\\t${uuid}.Debug|Win32.ActiveCfg = Debug|Win32\\n\";\n         print F \"\\t\\t${uuid}.Debug|Win32.Build.0 = Debug|Win32\\n\";\n         print F \"\\t\\t${uuid}.Release|Win32.ActiveCfg = Release|Win32\\n\";\n-- \ngitgitgadget\n\n"},{"id":"379523","messageId":"d42fd0fe2e8433b14b8efe4e788cc55e53c5c06d.1564430879.git.gitgitgadget@gmail.com","threadId":"51494","inReplyTo":"pull.287.v2.git.gitgitgadget@gmail.com","subject":"[PATCH v2 03/23] Vcproj.pm: do not configure VCWebServiceProxyGeneratorTool","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-07-29T20:08:02Z","receivedAt":"2019-07-29T20:08:10Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nIt is not necessary, and Visual Studio 2015 no longer supports it, anyway.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n contrib/buildsystems/Generators/Vcproj.pm | 12 ------------\n 1 file changed, 12 deletions(-)\n\ndiff --git a/contrib/buildsystems/Generators/Vcproj.pm b/contrib/buildsystems/Generators/Vcproj.pm\nindex d862cae503..b17800184c 100644\n--- a/contrib/buildsystems/Generators/Vcproj.pm\n+++ b/contrib/buildsystems/Generators/Vcproj.pm\n@@ -115,9 +115,6 @@ sub createLibProject {\n \t\t\t<Tool\n \t\t\t\tName=\"VCXMLDataGeneratorTool\"\n \t\t\t/>\n-\t\t\t<Tool\n-\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n-\t\t\t/>\n \t\t\t<Tool\n \t\t\t\tName=\"VCMIDLTool\"\n \t\t\t/>\n@@ -181,9 +178,6 @@ sub createLibProject {\n \t\t\t<Tool\n \t\t\t\tName=\"VCXMLDataGeneratorTool\"\n \t\t\t/>\n-\t\t\t<Tool\n-\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n-\t\t\t/>\n \t\t\t<Tool\n \t\t\t\tName=\"VCMIDLTool\"\n \t\t\t/>\n@@ -339,9 +333,6 @@ sub createAppProject {\n \t\t\t<Tool\n \t\t\t\tName=\"VCXMLDataGeneratorTool\"\n \t\t\t/>\n-\t\t\t<Tool\n-\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n-\t\t\t/>\n \t\t\t<Tool\n \t\t\t\tName=\"VCMIDLTool\"\n \t\t\t/>\n@@ -410,9 +401,6 @@ sub createAppProject {\n \t\t\t<Tool\n \t\t\t\tName=\"VCXMLDataGeneratorTool\"\n \t\t\t/>\n-\t\t\t<Tool\n-\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n-\t\t\t/>\n \t\t\t<Tool\n \t\t\t\tName=\"VCMIDLTool\"\n \t\t\t/>\n-- \ngitgitgadget\n\n"},{"id":"379524","messageId":"f4d41c65e92b2aab43986c2f3763f33e82f3120c.1564430879.git.gitgitgadget@gmail.com","threadId":"51494","inReplyTo":"pull.287.v2.git.gitgitgadget@gmail.com","subject":"[PATCH v2 04/23] Vcproj.pm: urlencode '<' and '>' when generating VC projects","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-07-29T20:08:03Z","receivedAt":"2019-07-29T20:08:10Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n contrib/buildsystems/Generators/Vcproj.pm | 8 ++++++++\n 1 file changed, 8 insertions(+)\n\ndiff --git a/contrib/buildsystems/Generators/Vcproj.pm b/contrib/buildsystems/Generators/Vcproj.pm\nindex b17800184c..737647e76a 100644\n--- a/contrib/buildsystems/Generators/Vcproj.pm\n+++ b/contrib/buildsystems/Generators/Vcproj.pm\n@@ -59,6 +59,8 @@ sub createLibProject {\n     my $includes= join(\";\", sort(map(\"&quot;$rel_dir\\\\$_&quot;\", @{$$build_structure{\"LIBS_${libname}_INCLUDES\"}})));\n     my $cflags  = join(\" \", sort(@{$$build_structure{\"LIBS_${libname}_CFLAGS\"}}));\n     $cflags =~ s/\\\"/&quot;/g;\n+    $cflags =~ s/</&lt;/g;\n+    $cflags =~ s/>/&gt;/g;\n \n     my $cflags_debug = $cflags;\n     $cflags_debug =~ s/-MT/-MTd/;\n@@ -80,6 +82,8 @@ sub createLibProject {\n \n     $defines =~ s/-D//g;\n     $defines =~ s/\\\"/\\\\&quot;/g;\n+    $defines =~ s/</&lt;/g;\n+    $defines =~ s/>/&gt;/g;\n     $defines =~ s/\\'//g;\n     $includes =~ s/-I//g;\n     mkdir \"$target\" || die \"Could not create the directory $target for lib project!\\n\";\n@@ -271,6 +275,8 @@ sub createAppProject {\n     my $includes= join(\";\", sort(map(\"&quot;$rel_dir\\\\$_&quot;\", @{$$build_structure{\"APPS_${appname}_INCLUDES\"}})));\n     my $cflags  = join(\" \", sort(@{$$build_structure{\"APPS_${appname}_CFLAGS\"}}));\n     $cflags =~ s/\\\"/&quot;/g;\n+    $cflags =~ s/</&lt;/g;\n+    $cflags =~ s/>/&gt;/g;\n \n     my $cflags_debug = $cflags;\n     $cflags_debug =~ s/-MT/-MTd/;\n@@ -297,6 +303,8 @@ sub createAppProject {\n \n     $defines =~ s/-D//g;\n     $defines =~ s/\\\"/\\\\&quot;/g;\n+    $defines =~ s/</&lt;/g;\n+    $defines =~ s/>/&gt;/g;\n     $defines =~ s/\\'//g;\n     $defines =~ s/\\\\\\\\/\\\\/g;\n     $includes =~ s/-I//g;\n-- \ngitgitgadget\n\n"},{"id":"379525","messageId":"pull.287.v2.git.gitgitgadget@gmail.com","threadId":"51494","inReplyTo":"pull.287.git.gitgitgadget@gmail.com","subject":"[PATCH v2 00/23] Reinstate support for Visual Studio","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-07-29T20:08:00Z","receivedAt":"2019-07-29T20:08:12Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"A long time ago, we added support to build .sln and .vcproj files for use\nwithin Visual Studio, so that Git could be built in that popular IDE.\n\nThis support languished for years and was finally brought back into Git for\nWindows partially through the jh/msvc branch that was just merged into \nmaster. With the tremendous help by Philip Oakley and Jeff Hostetler, this\nre-adds support for Visual Studio, focusing on VS 2015 and later (older\nversions are currently unsupported, even if we worked a bit on that front,\ntoo; If there are volunteers to add support for older versions, I would be\ndelighted to review PRs to that end on \nhttps://github.com/git-for-windows/git).\n\nNote: the currently preferred way to contribute using Visual Studio is by\nusing Git for Windows' vs/master branch (which is automatically generated\nusing the make vcxproj build target that this patch series adds, updated\nevery time Git for Windows' master advances). My plan is to provide a\nsimilar branch in GitGitGadget, based on top of git.git's master, once this\npatch series is integrated.\n\nChanges since v1:\n\n * The empty directory templates/blt/branches/ is now created as part of the\n   build.\n\nJohannes Schindelin (14):\n  Vcproj.pm: auto-generate GUIDs\n  Vcproj.pm: do not configure VCWebServiceProxyGeneratorTool\n  Vcproj.pm: urlencode '<' and '>' when generating VC projects\n  contrib/buildsystems: ignore irrelevant files in Generators/\n  contrib/buildsystems: error out on unknown option\n  contrib/buildsystems: handle libiconv, too\n  contrib/buildsystems: also handle -lexpat\n  contrib/buildsystems: handle options starting with a slash\n  contrib/buildsystems: add a backend for modern Visual Studio versions\n  msvc: add a Makefile target to pre-generate the Visual Studio solution\n  vcxproj: also link-or-copy builtins\n  .gitignore: ignore Visual Studio's temporary/generated files\n  bin-wrappers: append `.exe` to target paths if necessary\n  git: avoid calling aliased builtins via their dashed form\n\nPhilip Oakley (9):\n  Vcproj.pm: list git.exe first to be startup project\n  contrib/buildsystems: ignore invalidcontinue.obj\n  contrib/buildsystems: fix misleading error message\n  contrib/buildsystems: handle quoted spaces in filenames\n  contrib/buildsystems: ignore gettext stuff\n  contrib/buildsystems: redirect errors of the dry run into a log file\n  contrib/buildsystems: optionally capture the dry-run in a file\n  contrib/buildsystems: handle the curl library option\n  .gitignore: touch up the entries regarding Visual Studio\n\n .gitignore                                 |   8 +-\n Makefile                                   |   2 +-\n compat/vcbuild/README                      |  23 ++\n config.mak.uname                           |  76 ++++\n contrib/buildsystems/Generators.pm         |   2 +-\n contrib/buildsystems/Generators/Vcproj.pm  | 119 ++-----\n contrib/buildsystems/Generators/Vcxproj.pm | 388 +++++++++++++++++++++\n contrib/buildsystems/engine.pl             |  55 ++-\n git.c                                      |   3 -\n 9 files changed, 576 insertions(+), 100 deletions(-)\n create mode 100644 contrib/buildsystems/Generators/Vcxproj.pm\n\n\nbase-commit: 9d418600f4d10dcbbfb0b5fdbc71d509e03ba719\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-287%2Fdscho%2Fvisual-studio-v2\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-287/dscho/visual-studio-v2\nPull-Request: https://github.com/gitgitgadget/git/pull/287\n\nRange-diff vs v1:\n\n  1:  240ff42517 =  1:  240ff42517 Vcproj.pm: auto-generate GUIDs\n  2:  a7898b0025 =  2:  a7898b0025 Vcproj.pm: list git.exe first to be startup project\n  3:  d42fd0fe2e =  3:  d42fd0fe2e Vcproj.pm: do not configure VCWebServiceProxyGeneratorTool\n  4:  f4d41c65e9 =  4:  f4d41c65e9 Vcproj.pm: urlencode '<' and '>' when generating VC projects\n  5:  82e820017b =  5:  82e820017b contrib/buildsystems: ignore invalidcontinue.obj\n  6:  60a45f2694 =  6:  60a45f2694 contrib/buildsystems: ignore irrelevant files in Generators/\n  7:  b8eb868316 =  7:  b8eb868316 contrib/buildsystems: fix misleading error message\n  8:  c10fd668ef =  8:  c10fd668ef contrib/buildsystems: handle quoted spaces in filenames\n  9:  e908d01f07 =  9:  e908d01f07 contrib/buildsystems: ignore gettext stuff\n 10:  3cfbb7843a = 10:  3cfbb7843a contrib/buildsystems: redirect errors of the dry run into a log file\n 11:  eaf1dd449d = 11:  eaf1dd449d contrib/buildsystems: optionally capture the dry-run in a file\n 12:  c696152c7f = 12:  c696152c7f contrib/buildsystems: error out on unknown option\n 13:  b07e83440d = 13:  b07e83440d contrib/buildsystems: handle the curl library option\n 14:  052a98b8bb = 14:  052a98b8bb contrib/buildsystems: handle libiconv, too\n 15:  5c9702ea50 = 15:  5c9702ea50 contrib/buildsystems: also handle -lexpat\n 16:  1d4c5539ef = 16:  1d4c5539ef contrib/buildsystems: handle options starting with a slash\n 17:  59c50989ea ! 17:  bc6a10ba47 contrib/buildsystems: add a backend for modern Visual Studio versions\n     @@ -296,6 +296,7 @@\n      +      <DLLsAndPDBs Include=\"\\$(VCPKGBinDirectory)\\\\*.dll;\\$(VCPKGBinDirectory)\\\\*.pdb\" />\n      +    </ItemGroup>\n      +    <Copy SourceFiles=\"@(DLLsAndPDBs)\" DestinationFolder=\"\\$(OutDir)\" SkipUnchangedFiles=\"true\" UseHardlinksIfPossible=\"true\" />\n     ++    <MakeDir Directories=\"..\\\\templates\\\\blt\\\\branches\" />\n      +  </Target>\n      +EOM\n      +    }\n 18:  23615bc8cf = 18:  2a3379d721 msvc: add a Makefile target to pre-generate the Visual Studio solution\n 19:  33bed9a7a6 = 19:  4dbbe3f4a2 vcxproj: also link-or-copy builtins\n 20:  44f0f3235e = 20:  dc4a9cc620 .gitignore: touch up the entries regarding Visual Studio\n 21:  8f19bb5a8c = 21:  3f862bf878 .gitignore: ignore Visual Studio's temporary/generated files\n 22:  971247e320 = 22:  a81cc2ccce bin-wrappers: append `.exe` to target paths if necessary\n 23:  db69b33ff4 <  -:  ---------- t5505,t5516: create .git/branches/ when needed\n 24:  151b9921d0 = 23:  6452dc11bc git: avoid calling aliased builtins via their dashed form\n\n-- \ngitgitgadget\n"},{"id":"379526","messageId":"82e820017b6ab7ce8612742a85679ea837d3596b.1564430879.git.gitgitgadget@gmail.com","threadId":"51494","inReplyTo":"pull.287.v2.git.gitgitgadget@gmail.com","subject":"[PATCH v2 05/23] contrib/buildsystems: ignore invalidcontinue.obj","fromName":"Philip Oakley via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-07-29T20:08:03Z","receivedAt":"2019-07-29T20:08:14Z","isPatch":true,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"From: Philip Oakley <philipoakley@iee.org>\n\nSince 4b623d8 (MSVC: link in invalidcontinue.obj for better POSIX\ncompatibility, 2014-03-29), invalidcontinue.obj is linked in the MSVC\nbuild, but it was not parsed correctly by the buildsystem. Ignore it, as\nit is known to Visual Studio and will be handled elsewhere.\n\nAlso only substitute filenames ending with .o when generating the\nsource .c filename, otherwise we would start to expect .cbj files to\ngenerate .obj files (which are not generated by our build)...\n\nIn the future there may be source files that produce .obj files\nso keep the two issues (.obj files with & without source files)\nseparate.\n\nSigned-off-by: Philip Oakley <philipoakley@iee.org>\nSigned-off-by: Duncan Smart <duncan.smart@gmail.com>\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n contrib/buildsystems/engine.pl | 10 +++++++---\n 1 file changed, 7 insertions(+), 3 deletions(-)\n\ndiff --git a/contrib/buildsystems/engine.pl b/contrib/buildsystems/engine.pl\nindex 23da787dc5..53e65d4db7 100755\n--- a/contrib/buildsystems/engine.pl\n+++ b/contrib/buildsystems/engine.pl\n@@ -282,7 +282,7 @@ sub handleLibLine\n #    exit(1);\n     foreach (@objfiles) {\n         my $sourcefile = $_;\n-        $sourcefile =~ s/\\.o/.c/;\n+        $sourcefile =~ s/\\.o$/.c/;\n         push(@sources, $sourcefile);\n         push(@cflags, @{$compile_options{\"${sourcefile}_CFLAGS\"}});\n         push(@defines, @{$compile_options{\"${sourcefile}_DEFINES\"}});\n@@ -326,8 +326,12 @@ sub handleLinkLine\n         } elsif ($part =~ /\\.(a|lib)$/) {\n             $part =~ s/\\.a$/.lib/;\n             push(@libs, $part);\n-        } elsif ($part =~ /\\.(o|obj)$/) {\n+        } elsif ($part eq 'invalidcontinue.obj') {\n+            # ignore - known to MSVC\n+        } elsif ($part =~ /\\.o$/) {\n             push(@objfiles, $part);\n+        } elsif ($part =~ /\\.obj$/) {\n+            # do nothing, 'make' should not be producing .obj, only .o files\n         } else {\n             die \"Unhandled lib option @ line $lineno: $part\";\n         }\n@@ -336,7 +340,7 @@ sub handleLinkLine\n #    exit(1);\n     foreach (@objfiles) {\n         my $sourcefile = $_;\n-        $sourcefile =~ s/\\.o/.c/;\n+        $sourcefile =~ s/\\.o$/.c/;\n         push(@sources, $sourcefile);\n         push(@cflags, @{$compile_options{\"${sourcefile}_CFLAGS\"}});\n         push(@defines, @{$compile_options{\"${sourcefile}_DEFINES\"}});\n-- \ngitgitgadget\n\n"},{"id":"379527","messageId":"eaf1dd449d541d7b8272c6f95af056a548b577ef.1564430879.git.gitgitgadget@gmail.com","threadId":"51494","inReplyTo":"pull.287.v2.git.gitgitgadget@gmail.com","subject":"[PATCH v2 11/23] contrib/buildsystems: optionally capture the dry-run in a file","fromName":"Philip Oakley via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-07-29T20:08:07Z","receivedAt":"2019-07-29T20:08:15Z","isPatch":true,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"From: Philip Oakley <philipoakley@iee.org>\n\nAdd an option for capturing the output of the make dry-run used in\ndetermining the msvc-build structure for easy debugging.\n\nYou can use the output of `--make-out <path>` in subsequent runs via the\n`--in <path>` option.\n\nSigned-off-by: Philip Oakley <philipoakley@iee.org>\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n contrib/buildsystems/engine.pl | 10 ++++++++++\n 1 file changed, 10 insertions(+)\n\ndiff --git a/contrib/buildsystems/engine.pl b/contrib/buildsystems/engine.pl\nindex de5c0b6b25..732239d817 100755\n--- a/contrib/buildsystems/engine.pl\n+++ b/contrib/buildsystems/engine.pl\n@@ -32,6 +32,7 @@ sub showUsage\n   -g <GENERATOR>  --gen <GENERATOR> Specify the buildsystem generator    (default: $gen)\n                                     Available: $genlist\n   -o <PATH>       --out <PATH>      Specify output directory generation  (default: .)\n+                  --make-out <PATH> Write the output of GNU Make into a file\n   -i <FILE>       --in <FILE>       Specify input file, instead of running GNU Make\n   -h,-?           --help            This help\n EOM\n@@ -39,6 +40,7 @@ sub showUsage\n }\n \n # Parse command-line options\n+my $make_out;\n while (@ARGV) {\n     my $arg = shift @ARGV;\n     if (\"$arg\" eq \"-h\" || \"$arg\" eq \"--help\" || \"$arg\" eq \"-?\") {\n@@ -46,6 +48,8 @@ sub showUsage\n \texit(0);\n     } elsif(\"$arg\" eq \"--out\" || \"$arg\" eq \"-o\") {\n \t$out_dir = shift @ARGV;\n+    } elsif(\"$arg\" eq \"--make-out\") {\n+\t$make_out = shift @ARGV;\n     } elsif(\"$arg\" eq \"--gen\" || \"$arg\" eq \"-g\") {\n \t$gen = shift @ARGV;\n     } elsif(\"$arg\" eq \"--in\" || \"$arg\" eq \"-i\") {\n@@ -80,6 +84,12 @@ sub showUsage\n # test for an empty Errors file and remove it\n unlink $ErrsFile if -f -z $ErrsFile;\n \n+if (defined $make_out) {\n+    open OUT, \">\" . $make_out;\n+    print OUT @makedry;\n+    close OUT;\n+}\n+\n # Parse the make output into usable info\n parseMakeOutput();\n \n-- \ngitgitgadget\n\n"},{"id":"379528","messageId":"c696152c7f3e424d2d3ba9f57a2668cc4f1c0629.1564430879.git.gitgitgadget@gmail.com","threadId":"51494","inReplyTo":"pull.287.v2.git.gitgitgadget@gmail.com","subject":"[PATCH v2 12/23] contrib/buildsystems: error out on unknown option","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-07-29T20:08:08Z","receivedAt":"2019-07-29T20:08:17Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nOne time too many did this developer call the `generate` script passing\na `--make-out=<PATH>` option that was happily ignored (because there\nshould be a space, not an equal sign, between `--make-out` and the\npath).\n\nAnd one time too many, this script not only ignored it but did not even\ncomplain. Let's fix that.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n contrib/buildsystems/engine.pl | 2 ++\n 1 file changed, 2 insertions(+)\n\ndiff --git a/contrib/buildsystems/engine.pl b/contrib/buildsystems/engine.pl\nindex 732239d817..1a12f4d556 100755\n--- a/contrib/buildsystems/engine.pl\n+++ b/contrib/buildsystems/engine.pl\n@@ -57,6 +57,8 @@ sub showUsage\n         open(F, \"<$infile\") || die \"Couldn't open file $infile\";\n         @makedry = <F>;\n         close(F);\n+    } else {\n+        die \"Unknown option: \" . $arg;\n     }\n }\n \n-- \ngitgitgadget\n\n"},{"id":"379529","messageId":"1d4c5539ef5e9c1e83e0ce6d641c535dabf5d242.1564430879.git.gitgitgadget@gmail.com","threadId":"51494","inReplyTo":"pull.287.v2.git.gitgitgadget@gmail.com","subject":"[PATCH v2 16/23] contrib/buildsystems: handle options starting with a slash","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-07-29T20:08:11Z","receivedAt":"2019-07-29T20:08:18Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nWith the recent changes to allow building with MSVC=1, we now pass the\n/OPT:REF option to the compiler. This confuses the parser that wants to\nturn the output of a dry run into project definitions for QMake and Visual\nStudio:\n\n\tUnhandled link option @ line 213: /OPT:REF at [...]\n\nLet's just extend the code that passes through options that start with a\ndash, so that it passes through options that start with a slash, too.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n contrib/buildsystems/engine.pl | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/contrib/buildsystems/engine.pl b/contrib/buildsystems/engine.pl\nindex 9bde7ae15b..8bb07e8e25 100755\n--- a/contrib/buildsystems/engine.pl\n+++ b/contrib/buildsystems/engine.pl\n@@ -351,7 +351,7 @@ sub handleLinkLine\n             push(@libs, \"expat.lib\");\n         } elsif (\"$part\" eq \"-liconv\") {\n             push(@libs, \"libiconv.lib\");\n-        } elsif ($part =~ /^-/) {\n+        } elsif ($part =~ /^[-\\/]/) {\n             push(@lflags, $part);\n         } elsif ($part =~ /\\.(a|lib)$/) {\n             $part =~ s/\\.a$/.lib/;\n-- \ngitgitgadget\n\n"},{"id":"379530","messageId":"5c9702ea50fa2eac880e5a3d02b4e6734593d445.1564430879.git.gitgitgadget@gmail.com","threadId":"51494","inReplyTo":"pull.287.v2.git.gitgitgadget@gmail.com","subject":"[PATCH v2 15/23] contrib/buildsystems: also handle -lexpat","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-07-29T20:08:10Z","receivedAt":"2019-07-29T20:08:21Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nThis is a dependency required for the non-smart HTTP backend.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n contrib/buildsystems/engine.pl | 2 ++\n 1 file changed, 2 insertions(+)\n\ndiff --git a/contrib/buildsystems/engine.pl b/contrib/buildsystems/engine.pl\nindex c35844a0c7..9bde7ae15b 100755\n--- a/contrib/buildsystems/engine.pl\n+++ b/contrib/buildsystems/engine.pl\n@@ -347,6 +347,8 @@ sub handleLinkLine\n             push(@libs, \"ssleay32.lib\");\n         } elsif (\"$part\" eq \"-lcurl\") {\n             push(@libs, \"libcurl.lib\");\n+        } elsif (\"$part\" eq \"-lexpat\") {\n+            push(@libs, \"expat.lib\");\n         } elsif (\"$part\" eq \"-liconv\") {\n             push(@libs, \"libiconv.lib\");\n         } elsif ($part =~ /^-/) {\n-- \ngitgitgadget\n\n"},{"id":"379531","messageId":"bc6a10ba47eed97e8122b35e95c26eb136d008bd.1564430879.git.gitgitgadget@gmail.com","threadId":"51494","inReplyTo":"pull.287.v2.git.gitgitgadget@gmail.com","subject":"[PATCH v2 17/23] contrib/buildsystems: add a backend for modern Visual Studio versions","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-07-29T20:08:12Z","receivedAt":"2019-07-29T20:08:22Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nBased on the previous patches in this patch series that fixed the\ngenerator for `.vcproj` files (which were used by Visual Studio prior to\n2015 to define projects), this patch offers to generate project\ndefinitions for neweer versions of Visual Studio (which use `.vcxproj`\nfiles).\n\nTo that end, this patch copy-edits the generator of the `.vcproj`.\n\nIn addition, we now use the `vcpkg` system which allows us to build\nGit's dependencies (e.g. curl, libexpat) conveniently. The support\nscripts were introduced in the `jh/msvc` patch series, and with this\npatch we initialize the `vcpkg` conditionally, in the `libgit` project's\n`PreBuildEvent`. To allow for parallel building of the projects, we\ntherefore put `libgit` at the bottom of the project hierarchy.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n contrib/buildsystems/Generators/Vcxproj.pm | 385 +++++++++++++++++++++\n 1 file changed, 385 insertions(+)\n create mode 100644 contrib/buildsystems/Generators/Vcxproj.pm\n\ndiff --git a/contrib/buildsystems/Generators/Vcxproj.pm b/contrib/buildsystems/Generators/Vcxproj.pm\nnew file mode 100644\nindex 0000000000..e65d78e16d\n--- /dev/null\n+++ b/contrib/buildsystems/Generators/Vcxproj.pm\n@@ -0,0 +1,385 @@\n+package Generators::Vcxproj;\n+require Exporter;\n+\n+use strict;\n+use vars qw($VERSION);\n+use Digest::SHA qw(sha256_hex);\n+\n+our $VERSION = '1.00';\n+our(@ISA, @EXPORT, @EXPORT_OK, @AVAILABLE);\n+@ISA = qw(Exporter);\n+\n+BEGIN {\n+    push @EXPORT_OK, qw(generate);\n+}\n+\n+sub generate_guid ($) {\n+\tmy $hex = sha256_hex($_[0]);\n+\t$hex =~ s/^(.{8})(.{4})(.{4})(.{4})(.{12}).*/{$1-$2-$3-$4-$5}/;\n+\t$hex =~ tr/a-z/A-Z/;\n+\treturn $hex;\n+}\n+\n+sub generate {\n+    my ($git_dir, $out_dir, $rel_dir, %build_structure) = @_;\n+    my @libs = @{$build_structure{\"LIBS\"}};\n+    foreach (@libs) {\n+        createProject($_, $git_dir, $out_dir, $rel_dir, \\%build_structure, 1);\n+    }\n+\n+    my @apps = @{$build_structure{\"APPS\"}};\n+    foreach (@apps) {\n+        createProject($_, $git_dir, $out_dir, $rel_dir, \\%build_structure, 0);\n+    }\n+\n+    createGlueProject($git_dir, $out_dir, $rel_dir, %build_structure);\n+    return 0;\n+}\n+\n+sub createProject {\n+    my ($name, $git_dir, $out_dir, $rel_dir, $build_structure, $static_library) = @_;\n+    my $label = $static_library ? \"lib\" : \"app\";\n+    my $prefix = $static_library ? \"LIBS_\" : \"APPS_\";\n+    my $config_type = $static_library ? \"StaticLibrary\" : \"Application\";\n+    print \"Generate $name vcxproj $label project\\n\";\n+    my $cdup = $name;\n+    $cdup =~ s/[^\\/]+/../g;\n+    $cdup =~ s/\\//\\\\/g;\n+    $rel_dir = $rel_dir eq \".\" ? $cdup : \"$cdup\\\\$rel_dir\";\n+    $rel_dir =~ s/\\//\\\\/g;\n+\n+    my $target = $name;\n+    if ($static_library) {\n+      $target =~ s/\\.a//;\n+    } else {\n+      $target =~ s/\\.exe//;\n+    }\n+\n+    my $uuid = generate_guid($name);\n+    $$build_structure{\"$prefix${target}_GUID\"} = $uuid;\n+    my $vcxproj = $target;\n+    $vcxproj =~ s/(.*\\/)?(.*)/$&\\/$2.vcxproj/;\n+    $vcxproj =~ s/([^\\/]*)(\\/lib)\\/(lib.vcxproj)/$1$2\\/$1_$3/;\n+    $$build_structure{\"$prefix${target}_VCXPROJ\"} = $vcxproj;\n+\n+    my @srcs = sort(map(\"$rel_dir\\\\$_\", @{$$build_structure{\"$prefix${name}_SOURCES\"}}));\n+    my @sources;\n+    foreach (@srcs) {\n+        $_ =~ s/\\//\\\\/g;\n+        push(@sources, $_);\n+    }\n+    my $defines = join(\";\", sort(@{$$build_structure{\"$prefix${name}_DEFINES\"}}));\n+    my $includes= join(\";\", sort(map { s/^-I//; s/\\//\\\\/g; File::Spec->file_name_is_absolute($_) ? $_ : \"$rel_dir\\\\$_\" } @{$$build_structure{\"$prefix${name}_INCLUDES\"}}));\n+    my $cflags = join(\" \", sort(map { s/^-[GLMOWZ].*//; s/.* .*/\"$&\"/; $_; } @{$$build_structure{\"$prefix${name}_CFLAGS\"}}));\n+    $cflags =~ s/</&lt;/g;\n+    $cflags =~ s/>/&gt;/g;\n+\n+    my $libs_release = \"\\n    \";\n+    my $libs_debug = \"\\n    \";\n+    if (!$static_library) {\n+      $libs_release = join(\";\", sort(grep /^(?!libgit\\.lib|xdiff\\/lib\\.lib|vcs-svn\\/lib\\.lib)/, @{$$build_structure{\"$prefix${name}_LIBS\"}}));\n+      $libs_debug = $libs_release;\n+      $libs_debug =~ s/zlib\\.lib/zlibd\\.lib/;\n+    }\n+\n+    $defines =~ s/-D//g;\n+    $defines =~ s/</&lt;/g;\n+    $defines =~ s/>/&gt;/g;\n+    $defines =~ s/\\'//g;\n+\n+    die \"Could not create the directory $target for $label project!\\n\" unless (-d \"$target\" || mkdir \"$target\");\n+\n+    open F, \">$vcxproj\" or die \"Could not open $vcxproj for writing!\\n\";\n+    binmode F, \":crlf :utf8\";\n+    print F chr(0xFEFF);\n+    print F << \"EOM\";\n+<?xml version=\"1.0\" encoding=\"utf-8\"?>\n+<Project DefaultTargets=\"Build\" ToolsVersion=\"14.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n+  <ItemGroup Label=\"ProjectConfigurations\">\n+    <ProjectConfiguration Include=\"Debug|Win32\">\n+      <Configuration>Debug</Configuration>\n+      <Platform>Win32</Platform>\n+    </ProjectConfiguration>\n+    <ProjectConfiguration Include=\"Release|Win32\">\n+      <Configuration>Release</Configuration>\n+      <Platform>Win32</Platform>\n+    </ProjectConfiguration>\n+    <ProjectConfiguration Include=\"Debug|x64\">\n+      <Configuration>Debug</Configuration>\n+      <Platform>x64</Platform>\n+    </ProjectConfiguration>\n+    <ProjectConfiguration Include=\"Release|x64\">\n+      <Configuration>Release</Configuration>\n+      <Platform>x64</Platform>\n+    </ProjectConfiguration>\n+  </ItemGroup>\n+  <PropertyGroup Label=\"Globals\">\n+    <ProjectGuid>$uuid</ProjectGuid>\n+    <Keyword>Win32Proj</Keyword>\n+    <VCPKGArch Condition=\"'\\$(Platform)'=='Win32'\">x86-windows</VCPKGArch>\n+    <VCPKGArch Condition=\"'\\$(Platform)'!='Win32'\">x64-windows</VCPKGArch>\n+    <VCPKGArchDirectory>$cdup\\\\compat\\\\vcbuild\\\\vcpkg\\\\installed\\\\\\$(VCPKGArch)</VCPKGArchDirectory>\n+    <VCPKGBinDirectory Condition=\"'\\(Configuration)'=='Debug'\">\\$(VCPKGArchDirectory)\\\\debug\\\\bin</VCPKGBinDirectory>\n+    <VCPKGLibDirectory Condition=\"'\\(Configuration)'=='Debug'\">\\$(VCPKGArchDirectory)\\\\debug\\\\lib</VCPKGLibDirectory>\n+    <VCPKGBinDirectory Condition=\"'\\(Configuration)'!='Debug'\">\\$(VCPKGArchDirectory)\\\\bin</VCPKGBinDirectory>\n+    <VCPKGLibDirectory Condition=\"'\\(Configuration)'!='Debug'\">\\$(VCPKGArchDirectory)\\\\lib</VCPKGLibDirectory>\n+    <VCPKGIncludeDirectory>\\$(VCPKGArchDirectory)\\\\include</VCPKGIncludeDirectory>\n+    <VCPKGLibs Condition=\"'\\(Configuration)'=='Debug'\">$libs_debug</VCPKGLibs>\n+    <VCPKGLibs Condition=\"'\\(Configuration)'!='Debug'\">$libs_release</VCPKGLibs>\n+  </PropertyGroup>\n+  <Import Project=\"\\$(VCTargetsPath)\\\\Microsoft.Cpp.Default.props\" />\n+  <PropertyGroup Condition=\"'\\$(Configuration)'=='Debug'\" Label=\"Configuration\">\n+    <UseDebugLibraries>true</UseDebugLibraries>\n+    <LinkIncremental>true</LinkIncremental>\n+  </PropertyGroup>\n+  <PropertyGroup Condition=\"'\\$(Configuration)'=='Release'\" Label=\"Configuration\">\n+    <UseDebugLibraries>false</UseDebugLibraries>\n+    <WholeProgramOptimization>true</WholeProgramOptimization>\n+  </PropertyGroup>\n+  <PropertyGroup>\n+    <ConfigurationType>$config_type</ConfigurationType>\n+    <PlatformToolset>v140</PlatformToolset>\n+    <!-- <CharacterSet>UTF-8</CharacterSet> -->\n+    <OutDir>..\\\\</OutDir>\n+    <!-- <IntDir>\\$(ProjectDir)\\$(Configuration)\\\\</IntDir> -->\n+  </PropertyGroup>\n+  <Import Project=\"\\$(VCTargetsPath)\\\\Microsoft.Cpp.props\" />\n+  <ImportGroup Label=\"ExtensionSettings\">\n+  </ImportGroup>\n+  <ImportGroup Label=\"Shared\">\n+  </ImportGroup>\n+  <ImportGroup Label=\"PropertySheets\">\n+    <Import Project=\"\\$(UserRootDir)\\\\Microsoft.Cpp.\\$(Platform).user.props\" Condition=\"exists('\\$(UserRootDir)\\\\Microsoft.Cpp.\\$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n+  </ImportGroup>\n+  <PropertyGroup Label=\"UserMacros\" />\n+  <PropertyGroup>\n+    <GenerateManifest>false</GenerateManifest>\n+    <EnableManagedIncrementalBuild>true</EnableManagedIncrementalBuild>\n+  </PropertyGroup>\n+  <ItemDefinitionGroup>\n+    <ClCompile>\n+      <AdditionalOptions>$cflags %(AdditionalOptions)</AdditionalOptions>\n+      <AdditionalIncludeDirectories>$cdup;$cdup\\\\compat;$cdup\\\\compat\\\\regex;$cdup\\\\compat\\\\win32;$cdup\\\\compat\\\\poll;$cdup\\\\compat\\\\vcbuild\\\\include;\\$(VCPKGIncludeDirectory);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n+      <EnableParallelCodeGeneration />\n+      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>\n+      <PrecompiledHeader />\n+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\n+    </ClCompile>\n+    <Lib>\n+      <SuppressStartupBanner>true</SuppressStartupBanner>\n+    </Lib>\n+    <Link>\n+      <AdditionalLibraryDirectories>\\$(VCPKGLibDirectory);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n+      <AdditionalDependencies>\\$(VCPKGLibs);\\$(AdditionalDependencies)</AdditionalDependencies>\n+      <AdditionalOptions>invalidcontinue.obj %(AdditionalOptions)</AdditionalOptions>\n+      <EntryPointSymbol>wmainCRTStartup</EntryPointSymbol>\n+      <ManifestFile>$cdup\\\\compat\\\\win32\\\\git.manifest</ManifestFile>\n+      <SubSystem>Console</SubSystem>\n+    </Link>\n+EOM\n+    if ($target eq 'libgit') {\n+        print F << \"EOM\";\n+    <PreBuildEvent Condition=\"!Exists('$cdup\\\\compat\\\\vcbuild\\\\vcpkg\\\\installed\\\\\\$(VCPKGArch)\\\\include\\\\openssl\\\\ssl.h')\">\n+      <Message>Initialize VCPKG</Message>\n+      <Command>del \"$cdup\\\\compat\\\\vcbuild\\\\vcpkg\"</Command>\n+      <Command>call \"$cdup\\\\compat\\\\vcbuild\\\\vcpkg_install.bat\"</Command>\n+    </PreBuildEvent>\n+EOM\n+    }\n+    print F << \"EOM\";\n+  </ItemDefinitionGroup>\n+  <ItemDefinitionGroup Condition=\"'\\$(Platform)'=='Win32'\">\n+    <Link>\n+      <TargetMachine>MachineX86</TargetMachine>\n+    </Link>\n+  </ItemDefinitionGroup>\n+  <ItemDefinitionGroup Condition=\"'\\$(Configuration)'=='Debug'\">\n+    <ClCompile>\n+      <Optimization>Disabled</Optimization>\n+      <PreprocessorDefinitions>WIN32;_DEBUG;$defines;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n+      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>\n+    </ClCompile>\n+    <Link>\n+      <GenerateDebugInformation>true</GenerateDebugInformation>\n+    </Link>\n+  </ItemDefinitionGroup>\n+  <ItemDefinitionGroup Condition=\"'\\$(Configuration)'=='Release'\">\n+    <ClCompile>\n+      <Optimization>MaxSpeed</Optimization>\n+      <IntrinsicFunctions>true</IntrinsicFunctions>\n+      <PreprocessorDefinitions>WIN32;NDEBUG;$defines;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n+      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\n+      <FunctionLevelLinking>true</FunctionLevelLinking>\n+      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>\n+    </ClCompile>\n+    <Link>\n+      <GenerateDebugInformation>true</GenerateDebugInformation>\n+      <EnableCOMDATFolding>true</EnableCOMDATFolding>\n+      <OptimizeReferences>true</OptimizeReferences>\n+    </Link>\n+  </ItemDefinitionGroup>\n+  <ItemGroup>\n+EOM\n+    foreach(@sources) {\n+        print F << \"EOM\";\n+    <ClCompile Include=\"$_\" />\n+EOM\n+    }\n+    print F << \"EOM\";\n+  </ItemGroup>\n+EOM\n+    if (!$static_library || $target =~ 'vcs-svn' || $target =~ 'xdiff') {\n+      my $uuid_libgit = $$build_structure{\"LIBS_libgit_GUID\"};\n+      my $uuid_xdiff_lib = $$build_structure{\"LIBS_xdiff/lib_GUID\"};\n+\n+      print F << \"EOM\";\n+  <ItemGroup>\n+    <ProjectReference Include=\"$cdup\\\\libgit\\\\libgit.vcxproj\">\n+      <Project>$uuid_libgit</Project>\n+      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>\n+    </ProjectReference>\n+EOM\n+      if (!($name =~ 'xdiff')) {\n+        print F << \"EOM\";\n+    <ProjectReference Include=\"$cdup\\\\xdiff\\\\lib\\\\xdiff_lib.vcxproj\">\n+      <Project>$uuid_xdiff_lib</Project>\n+      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>\n+    </ProjectReference>\n+EOM\n+      }\n+      if ($name =~ /(test-(line-buffer|svn-fe)|^git-remote-testsvn)\\.exe$/) {\n+        my $uuid_vcs_svn_lib = $$build_structure{\"LIBS_vcs-svn/lib_GUID\"};\n+        print F << \"EOM\";\n+    <ProjectReference Include=\"$cdup\\\\vcs-svn\\\\lib\\\\vcs-svn_lib.vcxproj\">\n+      <Project>$uuid_vcs_svn_lib</Project>\n+      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>\n+    </ProjectReference>\n+EOM\n+      }\n+      print F << \"EOM\";\n+  </ItemGroup>\n+EOM\n+    }\n+    print F << \"EOM\";\n+  <Import Project=\"\\$(VCTargetsPath)\\\\Microsoft.Cpp.targets\" />\n+EOM\n+    if (!$static_library) {\n+      print F << \"EOM\";\n+  <Target Name=\"${target}_AfterBuild\" AfterTargets=\"AfterBuild\">\n+    <ItemGroup>\n+      <DLLsAndPDBs Include=\"\\$(VCPKGBinDirectory)\\\\*.dll;\\$(VCPKGBinDirectory)\\\\*.pdb\" />\n+    </ItemGroup>\n+    <Copy SourceFiles=\"@(DLLsAndPDBs)\" DestinationFolder=\"\\$(OutDir)\" SkipUnchangedFiles=\"true\" UseHardlinksIfPossible=\"true\" />\n+    <MakeDir Directories=\"..\\\\templates\\\\blt\\\\branches\" />\n+  </Target>\n+EOM\n+    }\n+    print F << \"EOM\";\n+</Project>\n+EOM\n+    close F;\n+}\n+\n+sub createGlueProject {\n+    my ($git_dir, $out_dir, $rel_dir, %build_structure) = @_;\n+    print \"Generate solutions file\\n\";\n+    $rel_dir = \"..\\\\$rel_dir\";\n+    $rel_dir =~ s/\\//\\\\/g;\n+    my $SLN_HEAD = \"Microsoft Visual Studio Solution File, Format Version 11.00\\n# Visual Studio 2010\\n\";\n+    my $SLN_PRE  = \"Project(\\\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\\\") = \";\n+    my $SLN_POST = \"\\nEndProject\\n\";\n+\n+    my @libs = @{$build_structure{\"LIBS\"}};\n+    my @tmp;\n+    foreach (@libs) {\n+        $_ =~ s/\\.a//;\n+        push(@tmp, $_);\n+    }\n+    @libs = @tmp;\n+\n+    my @apps = @{$build_structure{\"APPS\"}};\n+    @tmp = ();\n+    foreach (@apps) {\n+        $_ =~ s/\\.exe//;\n+        if ($_ eq \"git\" ) {\n+            unshift(@tmp, $_);\n+        } else {\n+            push(@tmp, $_);\n+        }\n+    }\n+    @apps = @tmp;\n+\n+    open F, \">git.sln\" || die \"Could not open git.sln for writing!\\n\";\n+    binmode F, \":crlf :utf8\";\n+    print F chr(0xFEFF);\n+    print F \"$SLN_HEAD\";\n+\n+    foreach (@apps) {\n+        my $appname = $_;\n+        my $uuid = $build_structure{\"APPS_${appname}_GUID\"};\n+        print F \"$SLN_PRE\";\n+\tmy $vcxproj = $build_structure{\"APPS_${appname}_VCXPROJ\"};\n+\t$vcxproj =~ s/\\//\\\\/g;\n+        $appname =~ s/.*\\///;\n+        print F \"\\\"${appname}\\\", \\\"${vcxproj}\\\", \\\"${uuid}\\\"\";\n+        print F \"$SLN_POST\";\n+    }\n+    foreach (@libs) {\n+        my $libname = $_;\n+        my $uuid = $build_structure{\"LIBS_${libname}_GUID\"};\n+        print F \"$SLN_PRE\";\n+        my $vcxproj = $build_structure{\"LIBS_${libname}_VCXPROJ\"};\n+\t$vcxproj =~ s/\\//\\\\/g;\n+        $libname =~ s/\\//_/g;\n+        print F \"\\\"${libname}\\\", \\\"${vcxproj}\\\", \\\"${uuid}\\\"\";\n+        print F \"$SLN_POST\";\n+    }\n+\n+    print F << \"EOM\";\n+Global\n+\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n+\t\tDebug|x64 = Debug|x64\n+\t\tDebug|x86 = Debug|x86\n+\t\tRelease|x64 = Release|x64\n+\t\tRelease|x86 = Release|x86\n+\tEndGlobalSection\n+EOM\n+    print F << \"EOM\";\n+\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n+EOM\n+    foreach (@apps) {\n+        my $appname = $_;\n+        my $uuid = $build_structure{\"APPS_${appname}_GUID\"};\n+        print F \"\\t\\t${uuid}.Debug|x64.ActiveCfg = Debug|x64\\n\";\n+        print F \"\\t\\t${uuid}.Debug|x64.Build.0 = Debug|x64\\n\";\n+        print F \"\\t\\t${uuid}.Debug|x86.ActiveCfg = Debug|Win32\\n\";\n+        print F \"\\t\\t${uuid}.Debug|x86.Build.0 = Debug|Win32\\n\";\n+        print F \"\\t\\t${uuid}.Release|x64.ActiveCfg = Release|x64\\n\";\n+        print F \"\\t\\t${uuid}.Release|x64.Build.0 = Release|x64\\n\";\n+        print F \"\\t\\t${uuid}.Release|x86.ActiveCfg = Release|Win32\\n\";\n+        print F \"\\t\\t${uuid}.Release|x86.Build.0 = Release|Win32\\n\";\n+    }\n+    foreach (@libs) {\n+        my $libname = $_;\n+        my $uuid = $build_structure{\"LIBS_${libname}_GUID\"};\n+        print F \"\\t\\t${uuid}.Debug|x64.ActiveCfg = Debug|x64\\n\";\n+        print F \"\\t\\t${uuid}.Debug|x64.Build.0 = Debug|x64\\n\";\n+        print F \"\\t\\t${uuid}.Debug|x86.ActiveCfg = Debug|Win32\\n\";\n+        print F \"\\t\\t${uuid}.Debug|x86.Build.0 = Debug|Win32\\n\";\n+        print F \"\\t\\t${uuid}.Release|x64.ActiveCfg = Release|x64\\n\";\n+        print F \"\\t\\t${uuid}.Release|x64.Build.0 = Release|x64\\n\";\n+        print F \"\\t\\t${uuid}.Release|x86.ActiveCfg = Release|Win32\\n\";\n+        print F \"\\t\\t${uuid}.Release|x86.Build.0 = Release|Win32\\n\";\n+    }\n+\n+    print F << \"EOM\";\n+\tEndGlobalSection\n+\tGlobalSection(SolutionProperties) = preSolution\n+\t\tHideSolutionNode = FALSE\n+\tEndGlobalSection\n+EndGlobal\n+EOM\n+    close F;\n+}\n+\n+1;\n-- \ngitgitgadget\n\n"},{"id":"379532","messageId":"dc4a9cc6205afac03d1154ca935e4334536fa693.1564430879.git.gitgitgadget@gmail.com","threadId":"51494","inReplyTo":"pull.287.v2.git.gitgitgadget@gmail.com","subject":"[PATCH v2 20/23] .gitignore: touch up the entries regarding Visual Studio","fromName":"Philip Oakley via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-07-29T20:08:14Z","receivedAt":"2019-07-29T20:08:24Z","isPatch":true,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"From: Philip Oakley <philipoakley@iee.org>\n\nAdd the Microsoft .manifest pattern, and do not anchor the 'Debug'\nand 'Release' entries at the top-level directory, to allow for\nmultiple projects (one per target).\n\nSigned-off-by: Philip Oakley <philipoakley@iee.org>\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n .gitignore | 5 +++--\n 1 file changed, 3 insertions(+), 2 deletions(-)\n\ndiff --git a/.gitignore b/.gitignore\nindex e096e0a51c..e7bb15d301 100644\n--- a/.gitignore\n+++ b/.gitignore\n@@ -230,6 +230,7 @@\n *.ipdb\n *.dll\n .vs/\n-/Debug/\n-/Release/\n+*.manifest\n+Debug/\n+Release/\n *.dSYM\n-- \ngitgitgadget\n\n"},{"id":"379533","messageId":"3f862bf87845899852504158113cdd9143820a09.1564430879.git.gitgitgadget@gmail.com","threadId":"51494","inReplyTo":"pull.287.v2.git.gitgitgadget@gmail.com","subject":"[PATCH v2 21/23] .gitignore: ignore Visual Studio's temporary/generated files","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-07-29T20:08:15Z","receivedAt":"2019-07-29T20:08:25Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n .gitignore | 3 +++\n 1 file changed, 3 insertions(+)\n\ndiff --git a/.gitignore b/.gitignore\nindex e7bb15d301..fcfb708b9e 100644\n--- a/.gitignore\n+++ b/.gitignore\n@@ -233,4 +233,7 @@\n *.manifest\n Debug/\n Release/\n+/UpgradeLog*.htm\n+/git.VC.VC.opendb\n+/git.VC.db\n *.dSYM\n-- \ngitgitgadget\n\n"},{"id":"379534","messageId":"6452dc11bc5f715455318917525e2217ecc99232.1564430879.git.gitgitgadget@gmail.com","threadId":"51494","inReplyTo":"pull.287.v2.git.gitgitgadget@gmail.com","subject":"[PATCH v2 23/23] git: avoid calling aliased builtins via their dashed form","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-07-29T20:08:16Z","receivedAt":"2019-07-29T20:08:27Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nThis is one of the few places where Git violates its own deprecation of\nthe dashed form. It is not necessary, either.\n\nAs of 595d59e2b53 (git.c: ignore pager.* when launching builtin as\ndashed external, 2017-08-02), Git wants to ignore the pager.* config\nsetting when expanding aliases. So let's strip out the\ncheck_pager_config(<command-name>) call from the copy-edited code.\n\nThis code actually made it into upstream git.git already, but it was\ndisabled in `#if 0 ... #endif` guards so far.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n git.c | 3 ---\n 1 file changed, 3 deletions(-)\n\ndiff --git a/git.c b/git.c\nindex f4c0478f32..3049dae85b 100644\n--- a/git.c\n+++ b/git.c\n@@ -743,8 +743,6 @@ static int run_argv(int *argcp, const char ***argv)\n \t\t */\n \t\tif (!done_alias)\n \t\t\thandle_builtin(*argcp, *argv);\n-\n-#if 0 // TODO In GFW, need to amend a7924b655e940b06cb547c235d6bed9767929673 to include trace2_ and _tr2 lines.\n \t\telse if (get_builtin(**argv)) {\n \t\t\tstruct argv_array args = ARGV_ARRAY_INIT;\n \t\t\tint i;\n@@ -779,7 +777,6 @@ static int run_argv(int *argcp, const char ***argv)\n \t\t\t\texit(i);\n \t\t\tdie(\"could not execute builtin %s\", **argv);\n \t\t}\n-#endif // a7924b655e940b06cb547c235d6bed9767929673\n \n \t\t/* .. then try the external ones */\n \t\texecv_dashed_external(*argv);\n-- \ngitgitgadget\n"},{"id":"379535","messageId":"052a98b8bb8aef572cba41dbdaf15a7b987b8270.1564430879.git.gitgitgadget@gmail.com","threadId":"51494","inReplyTo":"pull.287.v2.git.gitgitgadget@gmail.com","subject":"[PATCH v2 14/23] contrib/buildsystems: handle libiconv, too","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-07-29T20:08:10Z","receivedAt":"2019-07-29T20:08:29Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nGit's test suite shows tons of breakages unless Git is compiled\n*without* NO_ICONV. That means, in turn, that we need to generate\nbuild definitions *with* libiconv, which in turn implies that we\nhave to handle the -liconv option properly.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n contrib/buildsystems/engine.pl | 2 ++\n 1 file changed, 2 insertions(+)\n\ndiff --git a/contrib/buildsystems/engine.pl b/contrib/buildsystems/engine.pl\nindex d613277595..c35844a0c7 100755\n--- a/contrib/buildsystems/engine.pl\n+++ b/contrib/buildsystems/engine.pl\n@@ -347,6 +347,8 @@ sub handleLinkLine\n             push(@libs, \"ssleay32.lib\");\n         } elsif (\"$part\" eq \"-lcurl\") {\n             push(@libs, \"libcurl.lib\");\n+        } elsif (\"$part\" eq \"-liconv\") {\n+            push(@libs, \"libiconv.lib\");\n         } elsif ($part =~ /^-/) {\n             push(@lflags, $part);\n         } elsif ($part =~ /\\.(a|lib)$/) {\n-- \ngitgitgadget\n\n"},{"id":"379536","messageId":"4dbbe3f4a20be45902d2a37238524a52ce7d98c3.1564430879.git.gitgitgadget@gmail.com","threadId":"51494","inReplyTo":"pull.287.v2.git.gitgitgadget@gmail.com","subject":"[PATCH v2 19/23] vcxproj: also link-or-copy builtins","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-07-29T20:08:13Z","receivedAt":"2019-07-29T20:08:31Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nThe default location for `.exe` files linked by Visual Studio depends on\nthe mode (debug vs release) and the architecture. Meaning: after a full\nbuild, there is a `git.exe` in the top-level directory, but none of the\nbuilt-ins are linked..\n\nWhen running a test script in Git Bash, it therefore would pick up the\nwrong, say, `git-receive-pack.exe`: the one installed at the same time\nas the Git Bash.\n\nAbsolutely not what we want. We want to have confidence that our test\ncovers the MSVC-built Git executables, and not some random stuff.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n config.mak.uname                           | 15 +++++++++++++++\n contrib/buildsystems/Generators/Vcxproj.pm |  3 +++\n 2 files changed, 18 insertions(+)\n\ndiff --git a/config.mak.uname b/config.mak.uname\nindex 6d0ed923b8..db7f06b95f 100644\n--- a/config.mak.uname\n+++ b/config.mak.uname\n@@ -703,6 +703,21 @@ vcxproj:\n \tperl contrib/buildsystems/generate -g Vcxproj\n \tgit add -f git.sln {*,*/lib,t/helper/*}/*.vcxproj\n \n+\t# Generate the LinkOrCopyBuiltins.targets file\n+\t(echo '<Project xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">' && \\\n+\t echo '  <Target Name=\"CopyBuiltins_AfterBuild\" AfterTargets=\"AfterBuild\">' && \\\n+\t for name in $(BUILT_INS);\\\n+\t do \\\n+\t   echo '    <Copy SourceFiles=\"$$(OutDir)\\git.exe\" DestinationFiles=\"$$(OutDir)\\'\"$$name\"'\" SkipUnchangedFiles=\"true\" UseHardlinksIfPossible=\"true\" />'; \\\n+\t done && \\\n+\t for name in $(REMOTE_CURL_ALIASES); \\\n+\t do \\\n+\t   echo '    <Copy SourceFiles=\"$$(OutDir)\\'\"$(REMOTE_CURL_PRIMARY)\"'\" DestinationFiles=\"$$(OutDir)\\'\"$$name\"'\" SkipUnchangedFiles=\"true\" UseHardlinksIfPossible=\"true\" />'; \\\n+\t done && \\\n+\t echo '  </Target>' && \\\n+\t echo '</Project>') >git/LinkOrCopyBuiltins.targets\n+\tgit add -f git/LinkOrCopyBuiltins.targets\n+\n \t# Add command-list.h\n \t$(MAKE) MSVC=1 SKIP_VCPKG=1 prefix=/mingw64 command-list.h\n \tgit add -f command-list.h\ndiff --git a/contrib/buildsystems/Generators/Vcxproj.pm b/contrib/buildsystems/Generators/Vcxproj.pm\nindex e65d78e16d..576ccabe1d 100644\n--- a/contrib/buildsystems/Generators/Vcxproj.pm\n+++ b/contrib/buildsystems/Generators/Vcxproj.pm\n@@ -274,6 +274,9 @@ sub createProject {\n   </Target>\n EOM\n     }\n+    if ($target eq 'git') {\n+      print F \"  <Import Project=\\\"LinkOrCopyBuiltins.targets\\\" />\\n\";\n+    }\n     print F << \"EOM\";\n </Project>\n EOM\n-- \ngitgitgadget\n\n"},{"id":"379537","messageId":"a81cc2cccef71fbcc73b72c3a26fba4097ced5f4.1564430879.git.gitgitgadget@gmail.com","threadId":"51494","inReplyTo":"pull.287.v2.git.gitgitgadget@gmail.com","subject":"[PATCH v2 22/23] bin-wrappers: append `.exe` to target paths if necessary","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-07-29T20:08:16Z","receivedAt":"2019-07-29T20:08:31Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nWhen compiling with Visual Studio, the projects' names are identical to\nthe executables modulo the extensions. Read: there will exist both a\ndirectory called `git` as well as an executable called `git.exe` in the\nend. Which means that the bin-wrappers *need* to target the `.exe` files\nlest they try to execute directories.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n Makefile | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/Makefile b/Makefile\nindex 98a0588416..3716dadc08 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2717,7 +2717,7 @@ bin-wrappers/%: wrap-for-bin.sh\n \t@mkdir -p bin-wrappers\n \t$(QUIET_GEN)sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \\\n \t     -e 's|@@BUILD_DIR@@|$(shell pwd)|' \\\n-\t     -e 's|@@PROG@@|$(patsubst test-%,t/helper/test-%,$(@F))|' < $< > $@ && \\\n+\t     -e 's|@@PROG@@|$(patsubst test-%,t/helper/test-%$(X),$(@F))$(patsubst git%,$(X),$(filter $(@F),$(BINDIR_PROGRAMS_NEED_X)))|' < $< > $@ && \\\n \tchmod +x $@\n \n # GNU make supports exporting all variables by \"export\" without parameters.\n-- \ngitgitgadget\n\n"},{"id":"379538","messageId":"2a3379d72185680d44b2444844d9fc87e733c30c.1564430879.git.gitgitgadget@gmail.com","threadId":"51494","inReplyTo":"pull.287.v2.git.gitgitgadget@gmail.com","subject":"[PATCH v2 18/23] msvc: add a Makefile target to pre-generate the Visual Studio solution","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-07-29T20:08:12Z","receivedAt":"2019-07-29T20:08:31Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nThe entire idea of generating the VS solution makes only sense if we\ngenerate it via Continuous Integration; otherwise potential users would\nstill have to download the entire Git for Windows SDK.\n\nIf we pre-generate the Visual Studio solution, Git can be built entirely\nwithin Visual Studio, and the test scripts can be run in a regular Git\nfor Windows (e.g. the Portable Git flavor, which does not include a full\nGCC toolchain and therefore weighs only about a tenth of Git for\nWindows' SDK).\n\nSo let's just add a target in the Makefile that can be used to generate\nsaid solution; The generated files will then be committed so that they\ncan be pushed to a branch ready to check out by Visual Studio users.\n\nTo make things even more useful, we also generate and commit other files\nthat are required to run the test suite, such as templates and\nbin-wrappers: with this, developers can run the test suite in a regular\nGit Bash after building the solution in Visual Studio.\n\nNote: for this build target, we do not actually need to initialize the\n`vcpkg` system, so we don't.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n compat/vcbuild/README          | 23 +++++++++++++\n config.mak.uname               | 61 ++++++++++++++++++++++++++++++++++\n contrib/buildsystems/engine.pl |  3 +-\n 3 files changed, 86 insertions(+), 1 deletion(-)\n\ndiff --git a/compat/vcbuild/README b/compat/vcbuild/README\nindex b633e7db98..1b6dabf5a2 100644\n--- a/compat/vcbuild/README\n+++ b/compat/vcbuild/README\n@@ -37,6 +37,29 @@ The Steps to Build Git with VS2015 or VS2017 from the command line.\n \n ================================================================\n \n+Alternatively, run `make vcxproj` and then load the generated `git.sln` in\n+Visual Studio. The initial build will install the vcpkg system and build the\n+dependencies automatically. This will take a while.\n+\n+Instead of generating the `git.sln` file yourself (which requires a full Git\n+for Windows SDK), you may want to consider fetching the `vs/master` branch of\n+https://github.com/git-for-windows/git instead (which is updated automatically\n+via CI running `make vcxproj`). The `vs/master` branch does not require a Git\n+for Windows to build, but you can run the test scripts in a regular Git Bash.\n+\n+Note that `make vcxproj` will automatically add and commit the generated `.sln`\n+and `.vcxproj` files to the repo. This is necessary to allow building a\n+fully-testable Git in Visual Studio, where a regular Git Bash can be used to\n+run the test scripts (as opposed to a full Git for Windows SDK): a number of\n+build targets, such as Git commands implemented as Unix shell scripts (where\n+`@@SHELL_PATH@@` and other placeholders are interpolated) require a full-blown\n+Git for Windows SDK (which is about 10x the size of a regular Git for Windows\n+installation).\n+\n+If your plan is to open a Pull Request with Git for Windows, it is a good idea\n+to drop this commit before submitting.\n+\n+================================================================\n The Steps of Build Git with VS2008\n \n 1. You need the build environment, which contains the Git dependencies\ndiff --git a/config.mak.uname b/config.mak.uname\nindex 48a6723222..6d0ed923b8 100644\n--- a/config.mak.uname\n+++ b/config.mak.uname\n@@ -25,10 +25,12 @@ include compat/vcbuild/MSVC-DEFS-GEN\n \t# See if vcpkg and the vcpkg-build versions of the third-party\n \t# libraries that we use are installed.  We include the result\n \t# to get $(vcpkg_*) variables defined for the Makefile.\n+ifeq (,$(SKIP_VCPKG))\n compat/vcbuild/VCPKG-DEFS: compat/vcbuild/vcpkg_install.bat\n \t@\"$<\"\n include compat/vcbuild/VCPKG-DEFS\n endif\n+endif\n \n # We choose to avoid \"if .. else if .. else .. endif endif\"\n # because maintaining the nesting to match is a pain.  If\n@@ -689,3 +691,62 @@ ifeq ($(uname_S),QNX)\n \tNO_STRCASESTR = YesPlease\n \tNO_STRLCPY = YesPlease\n endif\n+\n+vcxproj:\n+\t# Require clean work tree\n+\tgit update-index -q --refresh && \\\n+\tgit diff-files --quiet && \\\n+\tgit diff-index --cached --quiet HEAD --\n+\n+\t# Make .vcxproj files and add them\n+\tunset QUIET_GEN QUIET_BUILT_IN; \\\n+\tperl contrib/buildsystems/generate -g Vcxproj\n+\tgit add -f git.sln {*,*/lib,t/helper/*}/*.vcxproj\n+\n+\t# Add command-list.h\n+\t$(MAKE) MSVC=1 SKIP_VCPKG=1 prefix=/mingw64 command-list.h\n+\tgit add -f command-list.h\n+\n+\t# Add scripts\n+\trm -f perl/perl.mak\n+\t$(MAKE) MSVC=1 SKIP_VCPKG=1 prefix=/mingw64 \\\n+\t\t$(SCRIPT_LIB) $(SCRIPT_SH_GEN) $(SCRIPT_PERL_GEN)\n+\t# Strip out the sane tool path, needed only for building\n+\tsed -i '/^git_broken_path_fix \".*/d' git-sh-setup\n+\tgit add -f $(SCRIPT_LIB) $(SCRIPT_SH_GEN) $(SCRIPT_PERL_GEN)\n+\n+\t# Add Perl module\n+\t$(MAKE) $(LIB_PERL_GEN)\n+\tgit add -f perl/build\n+\n+\t# Add bin-wrappers, for testing\n+\trm -rf bin-wrappers/\n+\t$(MAKE) MSVC=1 SKIP_VCPKG=1 prefix=/mingw64 $(test_bindir_programs)\n+\t# Ensure that the GIT_EXEC_PATH is a Unix-y one, and that the absolute\n+\t# path of the repository is not hard-coded (GIT_EXEC_PATH will be set\n+\t# by test-lib.sh according to the current setup)\n+\tsed -i -e 's/^\\(GIT_EXEC_PATH\\)=.*/test -n \"$${\\1##*:*}\" ||\\\n+\t\t\t\\1=\"$$(cygpath -u \"$$\\1\")\"/' \\\n+\t\t-e \"s|'$$(pwd)|\\\"\\$$GIT_EXEC_PATH\\\"'|g\" bin-wrappers/*\n+\t# Ensure that test-* helpers find the .dll files copied to top-level\n+\tsed -i 's|^PATH=.*|&:\"$$GIT_EXEC_PATH\"|' bin-wrappers/test-*\n+\t# We do not want to force hard-linking builtins\n+\tsed -i 's|\\(git\\)-\\([-a-z]*\\)\\.exe\"|\\1.exe\" \\2|g' \\\n+\t\tbin-wrappers/git-{receive-pack,upload-archive}\n+\tgit add -f $(test_bindir_programs)\n+\t# remote-ext is a builtin, but invoked as if it were external\n+\tsed 's|receive-pack|remote-ext|g' \\\n+\t\t<bin-wrappers/git-receive-pack >bin-wrappers/git-remote-ext\n+\tgit add -f bin-wrappers/git-remote-ext\n+\n+\t# Add templates\n+\t$(MAKE) -C templates\n+\tgit add -f templates/boilerplates.made templates/blt/\n+\n+\t# Add build options\n+\t$(MAKE) MSVC=1 SKIP_VCPKG=1 prefix=/mingw64 GIT-BUILD-OPTIONS\n+\tgit add -f GIT-BUILD-OPTIONS\n+\n+\t# Commit the whole shebang\n+\tgit commit -m \"Generate Visual Studio solution\" \\\n+\t\t-m \"Auto-generated by \\`$(MAKE)$(MAKEFLAGS) $@\\`\"\ndiff --git a/contrib/buildsystems/engine.pl b/contrib/buildsystems/engine.pl\nindex 8bb07e8e25..fba8a3f056 100755\n--- a/contrib/buildsystems/engine.pl\n+++ b/contrib/buildsystems/engine.pl\n@@ -82,7 +82,8 @@ sub showUsage\n # Capture the make dry stderr to file for review (will be empty for a release build).\n \n my $ErrsFile = \"msvc-build-makedryerrors.txt\";\n-@makedry = `make -C $git_dir -n MSVC=1 V=1 2>$ErrsFile` if !@makedry;\n+@makedry = `make -C $git_dir -n MSVC=1 SKIP_VCPKG=1 V=1 2>$ErrsFile`\n+if !@makedry;\n # test for an empty Errors file and remove it\n unlink $ErrsFile if -f -z $ErrsFile;\n \n-- \ngitgitgadget\n\n"},{"id":"379539","messageId":"3cfbb7843ac3a27c79da4554cc550608b19f2d55.1564430879.git.gitgitgadget@gmail.com","threadId":"51494","inReplyTo":"pull.287.v2.git.gitgitgadget@gmail.com","subject":"[PATCH v2 10/23] contrib/buildsystems: redirect errors of the dry run into a log file","fromName":"Philip Oakley via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-07-29T20:08:07Z","receivedAt":"2019-07-29T20:08:32Z","isPatch":true,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"From: Philip Oakley <philipoakley@iee.org>\n\nRather than swallowing the errors, it is better to have them in a file.\n\nTo make it obvious what this is about, use the file name\n'msvc-build-makedryerrors.txt'.\n\nFurther, if the output is empty, simply delete that file. As we target\nGit for Windows' SDK (which, unlike its predecessor msysGit, offers Perl\nversions newer than 5.8), we can use the quite readable syntax `if -f -z\n$ErrsFile` (available in Perl >=5.10).\n\nNote that the file will contain the new values of the GIT_VERSION and\nGITGUI_VERSION if they were generated by the make file. They are omitted\nif the release is tagged and indentically defined in their respective\nGIT_VERSION_GEN file DEF_VER variables.\n\nSigned-off-by: Philip Oakley <philipoakley@iee.org>\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n contrib/buildsystems/engine.pl | 7 ++++++-\n 1 file changed, 6 insertions(+), 1 deletion(-)\n\ndiff --git a/contrib/buildsystems/engine.pl b/contrib/buildsystems/engine.pl\nindex 9db3d43a1e..de5c0b6b25 100755\n--- a/contrib/buildsystems/engine.pl\n+++ b/contrib/buildsystems/engine.pl\n@@ -73,7 +73,12 @@ sub showUsage\n EOM\n \n # Pipe a make --dry-run into a variable, if not already loaded from file\n-@makedry = `cd $git_dir && make -n MSVC=1 V=1 2>/dev/null` if !@makedry;\n+# Capture the make dry stderr to file for review (will be empty for a release build).\n+\n+my $ErrsFile = \"msvc-build-makedryerrors.txt\";\n+@makedry = `make -C $git_dir -n MSVC=1 V=1 2>$ErrsFile` if !@makedry;\n+# test for an empty Errors file and remove it\n+unlink $ErrsFile if -f -z $ErrsFile;\n \n # Parse the make output into usable info\n parseMakeOutput();\n-- \ngitgitgadget\n\n"},{"id":"379540","messageId":"60a45f26948989f928ca439a2860433c0f08f412.1564430879.git.gitgitgadget@gmail.com","threadId":"51494","inReplyTo":"pull.287.v2.git.gitgitgadget@gmail.com","subject":"[PATCH v2 06/23] contrib/buildsystems: ignore irrelevant files in Generators/","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-07-29T20:08:04Z","receivedAt":"2019-07-29T20:08:34Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nThe Generators/ directory can contain spurious files such as editors'\nbackup files. Even worse, there could be .swp files which are not even\nvalid Perl scripts.\n\nLet's just ignore anything but .pm files in said directory.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n contrib/buildsystems/Generators.pm | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/contrib/buildsystems/Generators.pm b/contrib/buildsystems/Generators.pm\nindex 408ef714b8..aa4cbaa2ad 100644\n--- a/contrib/buildsystems/Generators.pm\n+++ b/contrib/buildsystems/Generators.pm\n@@ -17,7 +17,7 @@ BEGIN\n     $me = dirname($me);\n     if (opendir(D,\"$me/Generators\")) {\n         foreach my $gen (readdir(D)) {\n-            next if ($gen  =~ /^\\.\\.?$/);\n+            next unless ($gen  =~ /\\.pm$/);\n             require \"${me}/Generators/$gen\";\n             $gen =~ s,\\.pm,,;\n             push(@AVAILABLE, $gen);\n-- \ngitgitgadget\n\n"},{"id":"379541","messageId":"b07e83440d10da5116ed8507efdef87c02eba32e.1564430879.git.gitgitgadget@gmail.com","threadId":"51494","inReplyTo":"pull.287.v2.git.gitgitgadget@gmail.com","subject":"[PATCH v2 13/23] contrib/buildsystems: handle the curl library option","fromName":"Philip Oakley via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-07-29T20:08:09Z","receivedAt":"2019-07-29T20:08:36Z","isPatch":true,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"From: Philip Oakley <philipoakley@iee.org>\n\nUpon seeing the '-lcurl' option, point to the libcurl.lib.\n\nWhile there, fix the elsif indentation.\n\nSigned-off-by: Philip Oakley <philipoakley@iee.org>\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n contrib/buildsystems/engine.pl | 4 +++-\n 1 file changed, 3 insertions(+), 1 deletion(-)\n\ndiff --git a/contrib/buildsystems/engine.pl b/contrib/buildsystems/engine.pl\nindex 1a12f4d556..d613277595 100755\n--- a/contrib/buildsystems/engine.pl\n+++ b/contrib/buildsystems/engine.pl\n@@ -341,10 +341,12 @@ sub handleLinkLine\n             $appout = shift @parts;\n         } elsif (\"$part\" eq \"-lz\") {\n             push(@libs, \"zlib.lib\");\n-\t} elsif (\"$part\" eq \"-lcrypto\") {\n+        } elsif (\"$part\" eq \"-lcrypto\") {\n             push(@libs, \"libeay32.lib\");\n         } elsif (\"$part\" eq \"-lssl\") {\n             push(@libs, \"ssleay32.lib\");\n+        } elsif (\"$part\" eq \"-lcurl\") {\n+            push(@libs, \"libcurl.lib\");\n         } elsif ($part =~ /^-/) {\n             push(@lflags, $part);\n         } elsif ($part =~ /\\.(a|lib)$/) {\n-- \ngitgitgadget\n\n"},{"id":"379542","messageId":"e908d01f076e5954d4c2af4fb3e297c5762aaf48.1564430879.git.gitgitgadget@gmail.com","threadId":"51494","inReplyTo":"pull.287.v2.git.gitgitgadget@gmail.com","subject":"[PATCH v2 09/23] contrib/buildsystems: ignore gettext stuff","fromName":"Philip Oakley via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-07-29T20:08:06Z","receivedAt":"2019-07-29T20:08:38Z","isPatch":true,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"From: Philip Oakley <philipoakley@iee.org>\n\nGit's build contains steps to handle internationalization. This caused\nhiccups in the parser used to generate QMake/Visual Studio project files.\n\nAs those steps are irrelevant in this context, let's just ignore them.\n\nSigned-off-by: Philip Oakley <philipoakley@iee.org>\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n contrib/buildsystems/engine.pl | 6 ++++++\n 1 file changed, 6 insertions(+)\n\ndiff --git a/contrib/buildsystems/engine.pl b/contrib/buildsystems/engine.pl\nindex ad6a82c30c..9db3d43a1e 100755\n--- a/contrib/buildsystems/engine.pl\n+++ b/contrib/buildsystems/engine.pl\n@@ -141,6 +141,12 @@ sub parseMakeOutput\n             next;\n         }\n \n+        if ($text =~ /^(mkdir|msgfmt) /) {\n+            # options to the Portable Object translations\n+            # the line \"mkdir ... && msgfmt ...\" contains no linker options\n+            next;\n+        }\n+\n         if($text =~ / -c /) {\n             # compilation\n             handleCompileLine($text, $line);\n-- \ngitgitgadget\n\n"},{"id":"379543","messageId":"b8eb868316990ae180323d04efe08ed7d48c61ef.1564430879.git.gitgitgadget@gmail.com","threadId":"51494","inReplyTo":"pull.287.v2.git.gitgitgadget@gmail.com","subject":"[PATCH v2 07/23] contrib/buildsystems: fix misleading error message","fromName":"Philip Oakley via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-07-29T20:08:05Z","receivedAt":"2019-07-29T20:08:40Z","isPatch":true,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"From: Philip Oakley <philipoakley@iee.org>\n\nThe error message talked about a \"lib option\", but it clearly referred\nto a link option.\n\nSigned-off-by: Philip Oakley <philipoakley@iee.org>\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n contrib/buildsystems/engine.pl | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/contrib/buildsystems/engine.pl b/contrib/buildsystems/engine.pl\nindex 53e65d4db7..11f0e16dda 100755\n--- a/contrib/buildsystems/engine.pl\n+++ b/contrib/buildsystems/engine.pl\n@@ -333,7 +333,7 @@ sub handleLinkLine\n         } elsif ($part =~ /\\.obj$/) {\n             # do nothing, 'make' should not be producing .obj, only .o files\n         } else {\n-            die \"Unhandled lib option @ line $lineno: $part\";\n+            die \"Unhandled link option @ line $lineno: $part\";\n         }\n     }\n #    print \"AppOut: '$appout'\\nLFlags: @lflags\\nLibs  : @libs\\nOfiles: @objfiles\\n\";\n-- \ngitgitgadget\n\n"},{"id":"379544","messageId":"c10fd668ef943c2bfc0cfb909e5807ee87d65e23.1564430879.git.gitgitgadget@gmail.com","threadId":"51494","inReplyTo":"pull.287.v2.git.gitgitgadget@gmail.com","subject":"[PATCH v2 08/23] contrib/buildsystems: handle quoted spaces in filenames","fromName":"Philip Oakley via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-07-29T20:08:05Z","receivedAt":"2019-07-29T20:08:41Z","isPatch":true,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"From: Philip Oakley <philipoakley@iee.org>\n\nThe engine.pl script expects file names not to contain spaces. However,\npaths with spaces are quite prevalent on Windows. Use shellwords() rather\nthan split() to parse them correctly.\n\nHelped-by: Junio C Hamano <gitster@pobox.com>\nSigned-off-by: Philip Oakley <philipoakley@iee.org>\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n contrib/buildsystems/engine.pl | 7 ++++---\n 1 file changed, 4 insertions(+), 3 deletions(-)\n\ndiff --git a/contrib/buildsystems/engine.pl b/contrib/buildsystems/engine.pl\nindex 11f0e16dda..ad6a82c30c 100755\n--- a/contrib/buildsystems/engine.pl\n+++ b/contrib/buildsystems/engine.pl\n@@ -12,6 +12,7 @@\n use File::Spec;\n use Cwd;\n use Generators;\n+use Text::ParseWords;\n \n my (%build_structure, %compile_options, @makedry);\n my $out_dir = getcwd();\n@@ -231,7 +232,7 @@ sub removeDuplicates\n sub handleCompileLine\n {\n     my ($line, $lineno) = @_;\n-    my @parts = split(' ', $line);\n+    my @parts = shellwords($line);\n     my $sourcefile;\n     shift(@parts); # ignore cmd\n     while (my $part = shift @parts) {\n@@ -265,7 +266,7 @@ sub handleLibLine\n     my (@objfiles, @lflags, $libout, $part);\n     # kill cmd and rm 'prefix'\n     $line =~ s/^rm -f .* && .* rcs //;\n-    my @parts = split(' ', $line);\n+    my @parts = shellwords($line);\n     while ($part = shift @parts) {\n         if ($part =~ /^-/) {\n             push(@lflags, $part);\n@@ -306,7 +307,7 @@ sub handleLinkLine\n {\n     my ($line, $lineno) = @_;\n     my (@objfiles, @lflags, @libs, $appout, $part);\n-    my @parts = split(' ', $line);\n+    my @parts = shellwords($line);\n     shift(@parts); # ignore cmd\n     while ($part = shift @parts) {\n         if ($part =~ /^-IGNORE/) {\n-- \ngitgitgadget\n\n"},{"id":"379557","messageId":"xmqqd0hstsgr.fsf@gitster-ct.c.googlers.com","threadId":"51494","inReplyTo":"pull.287.v2.git.gitgitgadget@gmail.com","subject":"Re: [PATCH v2 00/23] Reinstate support for Visual Studio","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2019-07-29T21:56:52Z","receivedAt":"2019-07-29T21:57:00Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Johannes Schindelin via GitGitGadget\" <gitgitgadget@gmail.com>\nwrites:\n\n> A long time ago, we added support to build .sln and .vcproj files for use\n> within Visual Studio, so that Git could be built in that popular IDE.\n> ...\n> Changes since v1:\n>\n>  * The empty directory templates/blt/branches/ is now created as part of the\n>    build.\n\nThis did not cut today's pushout, but replacing the topic branch and\nrebuilding 'pu' was quite straight-forward with just a single liner\nchange ;-)\n\nIt will appear in 'next' sometime tomorrow.\n\nThanks.\n"},{"id":"381108","messageId":"20190825120741.GM20404@szeder.dev","threadId":"51494","inReplyTo":"dc4a9cc6205afac03d1154ca935e4334536fa693.1564430879.git.gitgitgadget@gmail.com","subject":"Re: [PATCH v2 20/23] .gitignore: touch up the entries regarding Visual Studio","fromName":"SZEDER Gábor","fromEmail":"szeder.dev@gmail.com","sentAt":"2019-08-25T12:07:41Z","receivedAt":"2019-08-25T12:07:48Z","isPatch":true,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"On Mon, Jul 29, 2019 at 01:08:14PM -0700, Philip Oakley via GitGitGadget wrote:\n> Add the Microsoft .manifest pattern, and do not anchor the 'Debug'\n> and 'Release' entries at the top-level directory, to allow for\n> multiple projects (one per target).\n> \n> Signed-off-by: Philip Oakley <philipoakley@iee.org>\n> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> ---\n>  .gitignore | 5 +++--\n>  1 file changed, 3 insertions(+), 2 deletions(-)\n> \n> diff --git a/.gitignore b/.gitignore\n> index e096e0a51c..e7bb15d301 100644\n> --- a/.gitignore\n> +++ b/.gitignore\n> @@ -230,6 +230,7 @@\n>  *.ipdb\n>  *.dll\n>  .vs/\n> -/Debug/\n> -/Release/\n> +*.manifest\n\nThis new line ignores the tracked file 'compat/win32/git.manifest'\nthat was added fairly recently in fe90397604 (mingw: embed a manifest\nto trick UAC into Doing The Right Thing, 2019-06-27).\n\nI wonder whether that's intentional or accidental.\n\nI'm inclined to think that it's merely accidental, because, as far as\nI understand, this is an old-ish patch from times when there wasn't\nany 'git.manifest' file in tree, and simply noone noticed that in the\nmeantime we got one.  But I have no idea about how a Git build with\nVisual Studio is supposed to work, so it doesn't really matter what\nI'm inclined to think :)\n\n"},{"id":"381113","messageId":"9eed02e7-7e2d-4ae3-6c08-ab17b3c92fb6@iee.email","threadId":"51494","inReplyTo":"20190825120741.GM20404@szeder.dev","subject":"Re: [PATCH v2 20/23] .gitignore: touch up the entries regarding Visual Studio","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.email","sentAt":"2019-08-25T13:20:32Z","receivedAt":"2019-08-25T13:20:36Z","isPatch":true,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"Hi Szeder,\n\nOn 25/08/2019 13:07, SZEDER Gábor wrote:\n> On Mon, Jul 29, 2019 at 01:08:14PM -0700, Philip Oakley via GitGitGadget wrote:\n>> Add the Microsoft .manifest pattern, and do not anchor the 'Debug'\n>> and 'Release' entries at the top-level directory, to allow for\n>> multiple projects (one per target).\n>>\n>> Signed-off-by: Philip Oakley <philipoakley@iee.org>\n>> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n>> ---\n>>   .gitignore | 5 +++--\n>>   1 file changed, 3 insertions(+), 2 deletions(-)\n>>\n>> diff --git a/.gitignore b/.gitignore\n>> index e096e0a51c..e7bb15d301 100644\n>> --- a/.gitignore\n>> +++ b/.gitignore\n>> @@ -230,6 +230,7 @@\n>>   *.ipdb\n>>   *.dll\n>>   .vs/\n>> -/Debug/\n>> -/Release/\n>> +*.manifest\n> This new line ignores the tracked file 'compat/win32/git.manifest'\n> that was added fairly recently in fe90397604 (mingw: embed a manifest\n> to trick UAC into Doing The Right Thing, 2019-06-27).\n>\n> I wonder whether that's intentional or accidental.\n>\n> I'm inclined to think that it's merely accidental, because, as far as\n> I understand, this is an old-ish patch from times when there wasn't\n> any 'git.manifest' file in tree, and simply noone noticed that in the\n> meantime we got one.  But I have no idea about how a Git build with\n> Visual Studio is supposed to work, so it doesn't really matter what\n> I'm inclined to think :)\n>\nAt the time, it was just one of the many non-source files that were \ngenerated by Visual Studio that cluttered the status list and also could \naccidentally added to the tracked files.\n\nThe newly added .manifest file does appear to be there to 'trick' the \nWindows User Access Control (UAC) which otherwise can be an annoyance to \n'regular' users.\nPhilip\n"},{"id":"381123","messageId":"20190825190957.GN20404@szeder.dev","threadId":"51494","inReplyTo":"9eed02e7-7e2d-4ae3-6c08-ab17b3c92fb6@iee.email","subject":"Re: [PATCH v2 20/23] .gitignore: touch up the entries regarding Visual Studio","fromName":"SZEDER Gábor","fromEmail":"szeder.dev@gmail.com","sentAt":"2019-08-25T19:09:57Z","receivedAt":"2019-08-25T19:10:04Z","isPatch":true,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"On Sun, Aug 25, 2019 at 02:20:32PM +0100, Philip Oakley wrote:\n> Hi Szeder,\n> \n> On 25/08/2019 13:07, SZEDER Gábor wrote:\n> >On Mon, Jul 29, 2019 at 01:08:14PM -0700, Philip Oakley via GitGitGadget wrote:\n> >>Add the Microsoft .manifest pattern, and do not anchor the 'Debug'\n> >>and 'Release' entries at the top-level directory, to allow for\n> >>multiple projects (one per target).\n> >>\n> >>Signed-off-by: Philip Oakley <philipoakley@iee.org>\n> >>Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> >>---\n> >>  .gitignore | 5 +++--\n> >>  1 file changed, 3 insertions(+), 2 deletions(-)\n> >>\n> >>diff --git a/.gitignore b/.gitignore\n> >>index e096e0a51c..e7bb15d301 100644\n> >>--- a/.gitignore\n> >>+++ b/.gitignore\n> >>@@ -230,6 +230,7 @@\n> >>  *.ipdb\n> >>  *.dll\n> >>  .vs/\n> >>-/Debug/\n> >>-/Release/\n> >>+*.manifest\n> >This new line ignores the tracked file 'compat/win32/git.manifest'\n> >that was added fairly recently in fe90397604 (mingw: embed a manifest\n> >to trick UAC into Doing The Right Thing, 2019-06-27).\n> >\n> >I wonder whether that's intentional or accidental.\n> >\n> >I'm inclined to think that it's merely accidental, because, as far as\n> >I understand, this is an old-ish patch from times when there wasn't\n> >any 'git.manifest' file in tree, and simply noone noticed that in the\n> >meantime we got one.  But I have no idea about how a Git build with\n> >Visual Studio is supposed to work, so it doesn't really matter what\n> >I'm inclined to think :)\n> >\n> At the time, it was just one of the many non-source files that were\n> generated by Visual Studio that cluttered the status list and also could\n> accidentally added to the tracked files.\n> \n> The newly added .manifest file does appear to be there to 'trick' the\n> Windows User Access Control (UAC) which otherwise can be an annoyance to\n> 'regular' users.\n\nSorry, I'm not sure how to interpret your reply, and can't decide\nwhether it tries to justify why that tracked file should be ignored,\nor explains that ignoring it was accidental.\n\nAnyway, ignoring that tracked file apparently triggered a nested\nworktree-related bug in 'git clean', which can lead to data loss:\n\nhttps://public-inbox.org/git/20190825185918.3909-1-szeder.dev@gmail.com/\n\n"},{"id":"381128","messageId":"e221aaf8-7d0b-6feb-3f58-1e9e4382939b@iee.email","threadId":"51494","inReplyTo":"20190825190957.GN20404@szeder.dev","subject":"Re: [PATCH v2 20/23] .gitignore: touch up the entries regarding Visual Studio","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.email","sentAt":"2019-08-25T22:21:23Z","receivedAt":"2019-08-25T22:21:28Z","isPatch":true,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"Hi Szeder,\n\nOn 25/08/2019 20:09, SZEDER Gábor wrote:\n> On Sun, Aug 25, 2019 at 02:20:32PM +0100, Philip Oakley wrote:\n>> Hi Szeder,\n>>\n>> On 25/08/2019 13:07, SZEDER Gábor wrote:\n>>> On Mon, Jul 29, 2019 at 01:08:14PM -0700, Philip Oakley via GitGitGadget wrote:\n>>>> Add the Microsoft .manifest pattern, and do not anchor the 'Debug'\n>>>> and 'Release' entries at the top-level directory, to allow for\n>>>> multiple projects (one per target).\n>>>>\n>>>> Signed-off-by: Philip Oakley <philipoakley@iee.org>\n>>>> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n>>>> ---\n>>>>   .gitignore | 5 +++--\n>>>>   1 file changed, 3 insertions(+), 2 deletions(-)\n>>>>\n>>>> diff --git a/.gitignore b/.gitignore\n>>>> index e096e0a51c..e7bb15d301 100644\n>>>> --- a/.gitignore\n>>>> +++ b/.gitignore\n>>>> @@ -230,6 +230,7 @@\n>>>>   *.ipdb\n>>>>   *.dll\n>>>>   .vs/\n>>>> -/Debug/\n>>>> -/Release/\n>>>> +*.manifest\n>>> This new line ignores the tracked file 'compat/win32/git.manifest'\n>>> that was added fairly recently in fe90397604 (mingw: embed a manifest\n>>> to trick UAC into Doing The Right Thing, 2019-06-27).\n>>>\n>>> I wonder whether that's intentional or accidental.\n>>>\n>>> I'm inclined to think that it's merely accidental, because, as far as\n>>> I understand, this is an old-ish patch from times when there wasn't\n>>> any 'git.manifest' file in tree, and simply noone noticed that in the\n>>> meantime we got one.  But I have no idea about how a Git build with\n>>> Visual Studio is supposed to work, so it doesn't really matter what\n>>> I'm inclined to think :)\n>>>\n>> At the time, it was just one of the many non-source files that were\n>> generated by Visual Studio that cluttered the status list and also could\n>> accidentally added to the tracked files.\n>>\n>> The newly added .manifest file does appear to be there to 'trick' the\n>> Windows User Access Control (UAC) which otherwise can be an annoyance to\n>> 'regular' users.\n> Sorry, I'm not sure how to interpret your reply, and can't decide\n> whether it tries to justify why that tracked file should be ignored,\n> or explains that ignoring it was accidental.\n>\n> Anyway, ignoring that tracked file apparently triggered a nested\n> worktree-related bug in 'git clean', which can lead to data loss:\n>\n> https://public-inbox.org/git/20190825185918.3909-1-szeder.dev@gmail.com/\n>\nBasically manifests are a build artefact from Visual Studio [1], so it \nwas just another file to be ignored, from a _source_ control control \nviewpoint.\n\nI hadn't fully appreciated the reason for your question, but I can now \nsee how the general 'ignore most, but keep an occasional' file type can \nbe a problem for the `git clean` filter, along with sub-module repos in \nsub-directories. It probably extends beyond this special case .manifest \nfile.\n\nI doubt that dscho wants to also do file renaming to achieve the trick \nthat added that file to avoid this. the clean command should never be \nignoring (and possibly deleting) tracked files.\n\nWhen clean hits a nested repo (maybe with .git directory - not sure of \nsome of the sub-module changes) then it should stop referring to that \ntop level gitignore, at least that's my expectation. The commit \ndescription in the referenced patch appears to get the two parts \ninter-twined.\n\nPhilip\n[1] \nhttps://docs.microsoft.com/en-us/cpp/build/manifest-generation-in-visual-studio?view=vs-2019\n"},{"id":"381169","messageId":"20190826091025.GQ20404@szeder.dev","threadId":"51494","inReplyTo":"e221aaf8-7d0b-6feb-3f58-1e9e4382939b@iee.email","subject":"Re: [PATCH v2 20/23] .gitignore: touch up the entries regarding Visual Studio","fromName":"SZEDER Gábor","fromEmail":"szeder.dev@gmail.com","sentAt":"2019-08-26T09:10:25Z","receivedAt":"2019-08-26T09:10:32Z","isPatch":true,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"On Sun, Aug 25, 2019 at 11:21:23PM +0100, Philip Oakley wrote:\n> >>>>diff --git a/.gitignore b/.gitignore\n> >>>>index e096e0a51c..e7bb15d301 100644\n> >>>>--- a/.gitignore\n> >>>>+++ b/.gitignore\n> >>>>@@ -230,6 +230,7 @@\n> >>>>  *.ipdb\n> >>>>  *.dll\n> >>>>  .vs/\n> >>>>-/Debug/\n> >>>>-/Release/\n> >>>>+*.manifest\n> >>>This new line ignores the tracked file 'compat/win32/git.manifest'\n> >>>that was added fairly recently in fe90397604 (mingw: embed a manifest\n> >>>to trick UAC into Doing The Right Thing, 2019-06-27).\n> >>>\n> >>>I wonder whether that's intentional or accidental.\n> >>>\n> >>>I'm inclined to think that it's merely accidental, because, as far as\n> >>>I understand, this is an old-ish patch from times when there wasn't\n> >>>any 'git.manifest' file in tree, and simply noone noticed that in the\n> >>>meantime we got one.  But I have no idea about how a Git build with\n> >>>Visual Studio is supposed to work, so it doesn't really matter what\n> >>>I'm inclined to think :)\n> >>>\n> >>At the time, it was just one of the many non-source files that were\n> >>generated by Visual Studio that cluttered the status list and also could\n> >>accidentally added to the tracked files.\n> >>\n> >>The newly added .manifest file does appear to be there to 'trick' the\n> >>Windows User Access Control (UAC) which otherwise can be an annoyance to\n> >>'regular' users.\n> >Sorry, I'm not sure how to interpret your reply, and can't decide\n> >whether it tries to justify why that tracked file should be ignored,\n> >or explains that ignoring it was accidental.\n> >\n> >Anyway, ignoring that tracked file apparently triggered a nested\n> >worktree-related bug in 'git clean', which can lead to data loss:\n> >\n> >https://public-inbox.org/git/20190825185918.3909-1-szeder.dev@gmail.com/\n> >\n> Basically manifests are a build artefact from Visual Studio [1], so it was\n> just another file to be ignored, from a _source_ control control viewpoint.\n\nI understand that manifest files, in general, are build artifacts.\nBut does Visual Studio overwrite the existing\n'compat/win32/git.manifest' file in particular?  Yes or no? :)\n\n"},{"id":"381185","messageId":"nycvar.QRO.7.76.6.1908261638450.46@tvgsbejvaqbjf.bet","threadId":"51494","inReplyTo":"e221aaf8-7d0b-6feb-3f58-1e9e4382939b@iee.email","subject":"Re: [PATCH v2 20/23] .gitignore: touch up the entries regarding Visual Studio","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2019-08-26T14:57:08Z","receivedAt":"2019-08-26T14:57:39Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sun, 25 Aug 2019, Philip Oakley wrote:\n\n> On 25/08/2019 20:09, SZEDER Gábor wrote:\n> > On Sun, Aug 25, 2019 at 02:20:32PM +0100, Philip Oakley wrote:\n> > >\n> > > On 25/08/2019 13:07, SZEDER Gábor wrote:\n> > > > On Mon, Jul 29, 2019 at 01:08:14PM -0700, Philip Oakley via GitGitGadget\n> > > > wrote:\n> > > > > Add the Microsoft .manifest pattern, and do not anchor the 'Debug'\n> > > > > and 'Release' entries at the top-level directory, to allow for\n> > > > > multiple projects (one per target).\n> > > > >\n> > > > > Signed-off-by: Philip Oakley <philipoakley@iee.org>\n> > > > > Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> > > > > ---\n> > > > >   .gitignore | 5 +++--\n> > > > >   1 file changed, 3 insertions(+), 2 deletions(-)\n> > > > >\n> > > > > diff --git a/.gitignore b/.gitignore\n> > > > > index e096e0a51c..e7bb15d301 100644\n> > > > > --- a/.gitignore\n> > > > > +++ b/.gitignore\n> > > > > @@ -230,6 +230,7 @@\n> > > > >   *.ipdb\n> > > > >   *.dll\n> > > > >   .vs/\n> > > > > -/Debug/\n> > > > > -/Release/\n> > > > > +*.manifest\n> > > > This new line ignores the tracked file 'compat/win32/git.manifest'\n> > > > that was added fairly recently in fe90397604 (mingw: embed a manifest\n> > > > to trick UAC into Doing The Right Thing, 2019-06-27).\n> > > >\n> > > > I wonder whether that's intentional or accidental.\n\nThis was an oversight of mine, my apologies. That line should go.\n\n> > > > I'm inclined to think that it's merely accidental, because, as far as\n> > > > I understand, this is an old-ish patch from times when there wasn't\n> > > > any 'git.manifest' file in tree, and simply noone noticed that in the\n> > > > meantime we got one.  But I have no idea about how a Git build with\n> > > > Visual Studio is supposed to work, so it doesn't really matter what\n> > > > I'm inclined to think :)\n> > > >\n> > > At the time, it was just one of the many non-source files that were\n> > > generated by Visual Studio that cluttered the status list and also could\n> > > accidentally added to the tracked files.\n> > >\n> > > The newly added .manifest file does appear to be there to 'trick' the\n> > > Windows User Access Control (UAC) which otherwise can be an annoyance to\n> > > 'regular' users.\n> > Sorry, I'm not sure how to interpret your reply, and can't decide\n> > whether it tries to justify why that tracked file should be ignored,\n> > or explains that ignoring it was accidental.\n> >\n> > Anyway, ignoring that tracked file apparently triggered a nested\n> > worktree-related bug in 'git clean', which can lead to data loss:\n> >\n> > https://public-inbox.org/git/20190825185918.3909-1-szeder.dev@gmail.com/\n\nWhoa. At least we found a bug via my oversight ;-)\n\n> Basically manifests are a build artefact from Visual Studio [1], so it was\n> just another file to be ignored, from a _source_ control control viewpoint.\n\nMore precisely, manifest files are something specific to Windows, where\nyou can embed metadata in an executable. Visual Studio auto-generated it\nunder certain circumstances, but recent versions seem not to do that\nanymore.\n\nCiao,\nDscho\n\n> I hadn't fully appreciated the reason for your question, but I can now see how\n> the general 'ignore most, but keep an occasional' file type can be a problem\n> for the `git clean` filter, along with sub-module repos in sub-directories. It\n> probably extends beyond this special case .manifest file.\n>\n> I doubt that dscho wants to also do file renaming to achieve the trick that\n> added that file to avoid this. the clean command should never be ignoring (and\n> possibly deleting) tracked files.\n>\n> When clean hits a nested repo (maybe with .git directory - not sure of some of\n> the sub-module changes) then it should stop referring to that top level\n> gitignore, at least that's my expectation. The commit description in the\n> referenced patch appears to get the two parts inter-twined.\n>\n> Philip\n> [1]\n> https://docs.microsoft.com/en-us/cpp/build/manifest-generation-in-visual-studio?view=vs-2019\n>\n"},{"id":"381197","messageId":"xmqqk1b0j5a7.fsf@gitster-ct.c.googlers.com","threadId":"51494","inReplyTo":"nycvar.QRO.7.76.6.1908261638450.46@tvgsbejvaqbjf.bet","subject":"Re: [PATCH v2 20/23] .gitignore: touch up the entries regarding Visual Studio","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2019-08-26T15:49:20Z","receivedAt":"2019-08-26T15:49:27Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n>> > > > > --- a/.gitignore\n>> > > > > +++ b/.gitignore\n>> > > > > @@ -230,6 +230,7 @@\n>> > > > >   *.ipdb\n>> > > > >   *.dll\n>> > > > >   .vs/\n>> > > > > -/Debug/\n>> > > > > -/Release/\n>> > > > > +*.manifest\n>> > > > This new line ignores the tracked file 'compat/win32/git.manifest'\n>> > > > that was added fairly recently in fe90397604 (mingw: embed a manifest\n>> > > > to trick UAC into Doing The Right Thing, 2019-06-27).\n>> > > >\n>> > > > I wonder whether that's intentional or accidental.\n>\n> This was an oversight of mine, my apologies. That line should go.\n\nGood to see people finding glitches in topics that have graduated to\n'master' not so long ago.  It would have been even nicer if we found\nthem while in 'next', but we are all human ;-)\n\n> More precisely, manifest files are something specific to Windows, where\n> you can embed metadata in an executable. Visual Studio auto-generated it\n> under certain circumstances, but recent versions seem not to do that\n> anymore.\n\nI expect somebody who knows Windows .manifest better than I do to\ncome up with a one-liner patch with a single paragraph log message.\nOr it can just be a part of a larger series that is the next batch\nof Windows updates.\n\nThanks.\n"},{"id":"381435","messageId":"nycvar.QRO.7.76.6.1908281333030.46@tvgsbejvaqbjf.bet","threadId":"51494","inReplyTo":"20190826091025.GQ20404@szeder.dev","subject":"Re: [PATCH v2 20/23] .gitignore: touch up the entries regarding Visual Studio","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2019-08-28T11:34:24Z","receivedAt":"2019-08-28T11:34:39Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Gábor,\n\nOn Mon, 26 Aug 2019, SZEDER Gábor wrote:\n\n> On Sun, Aug 25, 2019 at 11:21:23PM +0100, Philip Oakley wrote:\n> > >>>>diff --git a/.gitignore b/.gitignore\n> > >>>>index e096e0a51c..e7bb15d301 100644\n> > >>>>--- a/.gitignore\n> > >>>>+++ b/.gitignore\n> > >>>>@@ -230,6 +230,7 @@\n> > >>>>  *.ipdb\n> > >>>>  *.dll\n> > >>>>  .vs/\n> > >>>>-/Debug/\n> > >>>>-/Release/\n> > >>>>+*.manifest\n> > >>>This new line ignores the tracked file 'compat/win32/git.manifest'\n> > >>>that was added fairly recently in fe90397604 (mingw: embed a manifest\n> > >>>to trick UAC into Doing The Right Thing, 2019-06-27).\n> > >>>\n> > >>>I wonder whether that's intentional or accidental.\n> > >>>\n> > >>>I'm inclined to think that it's merely accidental, because, as far as\n> > >>>I understand, this is an old-ish patch from times when there wasn't\n> > >>>any 'git.manifest' file in tree, and simply noone noticed that in the\n> > >>>meantime we got one.  But I have no idea about how a Git build with\n> > >>>Visual Studio is supposed to work, so it doesn't really matter what\n> > >>>I'm inclined to think :)\n> > >>>\n> > >>At the time, it was just one of the many non-source files that were\n> > >>generated by Visual Studio that cluttered the status list and also could\n> > >>accidentally added to the tracked files.\n> > >>\n> > >>The newly added .manifest file does appear to be there to 'trick' the\n> > >>Windows User Access Control (UAC) which otherwise can be an annoyance to\n> > >>'regular' users.\n> > >Sorry, I'm not sure how to interpret your reply, and can't decide\n> > >whether it tries to justify why that tracked file should be ignored,\n> > >or explains that ignoring it was accidental.\n> > >\n> > >Anyway, ignoring that tracked file apparently triggered a nested\n> > >worktree-related bug in 'git clean', which can lead to data loss:\n> > >\n> > >https://public-inbox.org/git/20190825185918.3909-1-szeder.dev@gmail.com/\n> > >\n> > Basically manifests are a build artefact from Visual Studio [1], so it was\n> > just another file to be ignored, from a _source_ control control viewpoint.\n>\n> I understand that manifest files, in general, are build artifacts.\n> But does Visual Studio overwrite the existing\n> 'compat/win32/git.manifest' file in particular?  Yes or no? :)\n\nNo.\n\nThe reason this entry was there: at least _some_ Visual Studio versions\n(IIRC), auto-generates `.manifest` files when the project does not have\nany. But now we do. So this line's gotta go.\n\n#leftoverbits ?\n\nCiao,\nDscho\n"}]}