{"thread":{"id":"48942","subject":"[PATCH 0/9] Add support to develop Git in Visual Studio Code","startedAt":"2018-07-23T13:52:50Z","lastAt":"2018-07-30T15:43:01Z","messageCount":29,"participants":["Johannes Schindelin via GitGitGadget","Jonathan Nieder","Junio C Hamano","Johannes Sixt","Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":9},"messages":[{"id":"353353","messageId":"pull.2.git.gitgitgadget@gmail.com","threadId":"48942","inReplyTo":null,"subject":"[PATCH 0/9] Add support to develop Git in Visual Studio Code","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2018-07-23T13:52:47Z","receivedAt":"2018-07-23T13:52:50Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"[Visual Studio Code](https://code.visualstudio.com/) (nickname \"VS Code\") is a light-weight, cross-platform, Open Source development environment, with an increasingly powerful extension to support C/C++ development. In particular the intellisense support as well as all the other niceties developers might have come to expect from Integrated Development Environments will help accelerate development.\n\nThis topic branch makes it easy to get started using VS Code to develop Git itself.\n\nTo get started, run the script `./contrib/vscode/init.sh`. This will initialize the `.vscode/` directory and some files in that directory. After that, simply open Git's top-level directory as \"folder\" in VS Code.\n\nThe files have to be generated because of the curious way Git determines what flags to pass to the C compiler, in particular which constants are defined, because they change the compile flow in rather dramatic ways (determining, e.g. which SHA-1 backend to use).\n\nJohannes Schindelin (9):\n  contrib: add a script to initialize VS Code configuration\n  vscode: hard-code a couple defines\n  cache.h: extract enum declaration from inside a struct declaration\n  mingw: define WIN32 explicitly\n  vscode: only overwrite C/C++ settings\n  vscode: wrap commit messages at column 72 by default\n  vscode: use 8-space tabs, no trailing ws, etc for Git's source code\n  vscode: add a dictionary for cSpell\n  vscode: let cSpell work on commit messages, too\n\n .gitignore                    |   1 +\n cache.h                       |  24 ++-\n config.mak.uname              |   2 +-\n contrib/vscode/.gitattributes |   1 +\n contrib/vscode/README.md      |  14 ++\n contrib/vscode/init.sh        | 375 ++++++++++++++++++++++++++++++++++\n 6 files changed, 405 insertions(+), 12 deletions(-)\n create mode 100644 contrib/vscode/.gitattributes\n create mode 100644 contrib/vscode/README.md\n create mode 100755 contrib/vscode/init.sh\n\n\nbase-commit: 53f9a3e157dbbc901a02ac2c73346d375e24978c\nPublished-As: https://github.com/gitgitgadget/git/releases/tags/pr-2%2Fdscho%2Fvscode-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-2/dscho/vscode-v1\nPull-Request: https://github.com/gitgitgadget/git/pull/2\n-- \ngitgitgadget\n"},{"id":"353354","messageId":"e2e449a00385531d326d6811a871dde59624b818.1532353966.git.gitgitgadget@gmail.com","threadId":"48942","inReplyTo":"pull.2.git.gitgitgadget@gmail.com","subject":"[PATCH 1/9] contrib: add a script to initialize VS Code configuration","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2018-07-23T13:52:49Z","receivedAt":"2018-07-23T13:52:52Z","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\nVS Code is a lightweight but powerful source code editor which runs on\nyour desktop and is available for Windows, macOS and Linux. Among other\nlanguages, it has support for C/C++ via an extension.\n\nTo start developing Git with VS Code, simply run the Unix shell script\ncontrib/vscode/init.sh, which creates the configuration files in\n.vscode/ that VS Code consumes.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n .gitignore                    |   1 +\n contrib/vscode/.gitattributes |   1 +\n contrib/vscode/README.md      |  14 +++\n contrib/vscode/init.sh        | 165 ++++++++++++++++++++++++++++++++++\n 4 files changed, 181 insertions(+)\n create mode 100644 contrib/vscode/.gitattributes\n create mode 100644 contrib/vscode/README.md\n create mode 100755 contrib/vscode/init.sh\n\ndiff --git a/.gitignore b/.gitignore\nindex 388cc4bee..592e8f879 100644\n--- a/.gitignore\n+++ b/.gitignore\n@@ -206,6 +206,7 @@\n /config.mak.autogen\n /config.mak.append\n /configure\n+/.vscode/\n /tags\n /TAGS\n /cscope*\ndiff --git a/contrib/vscode/.gitattributes b/contrib/vscode/.gitattributes\nnew file mode 100644\nindex 000000000..e89f2236e\n--- /dev/null\n+++ b/contrib/vscode/.gitattributes\n@@ -0,0 +1 @@\n+init.sh whitespace=-indent-with-non-tab\ndiff --git a/contrib/vscode/README.md b/contrib/vscode/README.md\nnew file mode 100644\nindex 000000000..8202d6203\n--- /dev/null\n+++ b/contrib/vscode/README.md\n@@ -0,0 +1,14 @@\n+Configuration for VS Code\n+=========================\n+\n+[VS Code](https://code.visualstudio.com/) is a lightweight but powerful source\n+code editor which runs on your desktop and is available for\n+[Windows](https://code.visualstudio.com/docs/setup/windows),\n+[macOS](https://code.visualstudio.com/docs/setup/mac) and\n+[Linux](https://code.visualstudio.com/docs/setup/linux). Among other languages,\n+it has [support for C/C++ via an extension](https://github.com/Microsoft/vscode-cpptools).\n+\n+To start developing Git with VS Code, simply run the Unix shell script called\n+`init.sh` in this directory, which creates the configuration files in\n+`.vscode/` that VS Code consumes. `init.sh` needs access to `make` and `gcc`,\n+so run the script in a Git SDK shell if you are using Windows.\ndiff --git a/contrib/vscode/init.sh b/contrib/vscode/init.sh\nnew file mode 100755\nindex 000000000..3cc93243f\n--- /dev/null\n+++ b/contrib/vscode/init.sh\n@@ -0,0 +1,165 @@\n+#!/bin/sh\n+\n+die () {\n+\techo \"$*\" >&2\n+\texit 1\n+}\n+\n+cd \"$(dirname \"$0\")\"/../.. ||\n+die \"Could not cd to top-level directory\"\n+\n+mkdir -p .vscode ||\n+die \"Could not create .vscode/\"\n+\n+# General settings\n+\n+cat >.vscode/settings.json <<\\EOF ||\n+{\n+    \"C_Cpp.intelliSenseEngine\": \"Default\",\n+    \"C_Cpp.intelliSenseEngineFallback\": \"Disabled\",\n+    \"files.associations\": {\n+        \"*.h\": \"c\",\n+        \"*.c\": \"c\"\n+    }\n+}\n+EOF\n+die \"Could not write settings.json\"\n+\n+# Infer some setup-specific locations/names\n+\n+GCCPATH=\"$(which gcc)\"\n+GDBPATH=\"$(which gdb)\"\n+MAKECOMMAND=\"make -j5 DEVELOPER=1\"\n+OSNAME=\n+X=\n+case \"$(uname -s)\" in\n+MINGW*)\n+\tGCCPATH=\"$(cygpath -am \"$GCCPATH\")\"\n+\tGDBPATH=\"$(cygpath -am \"$GDBPATH\")\"\n+\tMAKE_BASH=\"$(cygpath -am /git-cmd.exe) --command=usr\\\\\\\\bin\\\\\\\\bash.exe\"\n+\tMAKECOMMAND=\"$MAKE_BASH -lc \\\\\\\"$MAKECOMMAND\\\\\\\"\"\n+\tOSNAME=Win32\n+\tX=.exe\n+\t;;\n+Linux)\n+\tOSNAME=Linux\n+\t;;\n+Darwin)\n+\tOSNAME=macOS\n+\t;;\n+esac\n+\n+# Default build task\n+\n+cat >.vscode/tasks.json <<EOF ||\n+{\n+    // See https://go.microsoft.com/fwlink/?LinkId=733558\n+    // for the documentation about the tasks.json format\n+    \"version\": \"2.0.0\",\n+    \"tasks\": [\n+        {\n+            \"label\": \"make\",\n+            \"type\": \"shell\",\n+            \"command\": \"$MAKECOMMAND\",\n+            \"group\": {\n+                \"kind\": \"build\",\n+                \"isDefault\": true\n+            }\n+        }\n+    ]\n+}\n+EOF\n+die \"Could not install default build task\"\n+\n+# Debugger settings\n+\n+cat >.vscode/launch.json <<EOF ||\n+{\n+    // Use IntelliSense to learn about possible attributes.\n+    // Hover to view descriptions of existing attributes.\n+    // For more information, visit:\n+    // https://go.microsoft.com/fwlink/?linkid=830387\n+    \"version\": \"0.2.0\",\n+    \"configurations\": [\n+        {\n+            \"name\": \"(gdb) Launch\",\n+            \"type\": \"cppdbg\",\n+            \"request\": \"launch\",\n+            \"program\": \"\\${workspaceFolder}/git$X\",\n+            \"args\": [],\n+            \"stopAtEntry\": false,\n+            \"cwd\": \"\\${workspaceFolder}\",\n+            \"environment\": [],\n+            \"externalConsole\": true,\n+            \"MIMode\": \"gdb\",\n+            \"miDebuggerPath\": \"$GDBPATH\",\n+            \"setupCommands\": [\n+                {\n+                    \"description\": \"Enable pretty-printing for gdb\",\n+                    \"text\": \"-enable-pretty-printing\",\n+                    \"ignoreFailures\": true\n+                }\n+            ]\n+        }\n+    ]\n+}\n+EOF\n+die \"Could not write launch configuration\"\n+\n+# C/C++ extension settings\n+\n+make -f - OSNAME=$OSNAME GCCPATH=\"$GCCPATH\" vscode-init \\\n+\t>.vscode/c_cpp_properties.json <<\\EOF ||\n+include Makefile\n+\n+vscode-init:\n+\t@mkdir -p .vscode && \\\n+\tincs= && defs= && \\\n+\tfor e in $(ALL_CFLAGS); do \\\n+\t\tcase \"$$e\" in \\\n+\t\t-I.) \\\n+\t\t\tincs=\"$$(printf '% 16s\"$${workspaceRoot}\",\\n%s' \\\n+\t\t\t\t\"\" \"$$incs\")\" \\\n+\t\t\t;; \\\n+\t\t-I/*) \\\n+\t\t\tincs=\"$$(printf '% 16s\"%s\",\\n%s' \\\n+\t\t\t\t\"\" \"$${e#-I}\" \"$$incs\")\" \\\n+\t\t\t;; \\\n+\t\t-I*) \\\n+\t\t\tincs=\"$$(printf '% 16s\"$${workspaceRoot}/%s\",\\n%s' \\\n+\t\t\t\t\"\" \"$${e#-I}\" \"$$incs\")\" \\\n+\t\t\t;; \\\n+\t\t-D*) \\\n+\t\t\tdefs=\"$$(printf '% 16s\"%s\",\\n%s' \\\n+\t\t\t\t\"\" \"$$(echo \"$${e#-D}\" | sed 's/\"/\\\\&/g')\" \\\n+\t\t\t\t\"$$defs\")\" \\\n+\t\t\t;; \\\n+\t\tesac; \\\n+\tdone && \\\n+\techo '{' && \\\n+\techo '    \"configurations\": [' && \\\n+\techo '        {' && \\\n+\techo '            \"name\": \"$(OSNAME)\",' && \\\n+\techo '            \"intelliSenseMode\": \"clang-x64\",' && \\\n+\techo '            \"includePath\": [' && \\\n+\techo \"$$incs\" | sort | sed '$$s/,$$//' && \\\n+\techo '            ],' && \\\n+\techo '            \"defines\": [' && \\\n+\techo \"$$defs\" | sort | sed '$$s/,$$//' && \\\n+\techo '            ],' && \\\n+\techo '            \"browse\": {' && \\\n+\techo '                \"limitSymbolsToIncludedHeaders\": true,' && \\\n+\techo '                \"databaseFilename\": \"\",' && \\\n+\techo '                \"path\": [' && \\\n+\techo '                    \"$${workspaceRoot}\"' && \\\n+\techo '                ]' && \\\n+\techo '            },' && \\\n+\techo '            \"cStandard\": \"c11\",' && \\\n+\techo '            \"cppStandard\": \"c++17\",' && \\\n+\techo '            \"compilerPath\": \"$(GCCPATH)\"' && \\\n+\techo '        }' && \\\n+\techo '    ],' && \\\n+\techo '    \"version\": 4' && \\\n+\techo '}'\n+EOF\n+die \"Could not write settings for the C/C++ extension\"\n-- \ngitgitgadget\n\n"},{"id":"353355","messageId":"3770bd855c6f3e69acfe418ea7fe5b40454e4dfb.1532353966.git.gitgitgadget@gmail.com","threadId":"48942","inReplyTo":"pull.2.git.gitgitgadget@gmail.com","subject":"[PATCH 2/9] vscode: hard-code a couple defines","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2018-07-23T13:52:50Z","receivedAt":"2018-07-23T13:52:54Z","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\nSadly, we do not get all of the definitions via ALL_CFLAGS. Some defines\nare passed to GCC *only* when compiling specific files, such as git.o.\n\nLet's just hard-code them into the script for the time being.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n contrib/vscode/init.sh | 14 +++++++++++++-\n 1 file changed, 13 insertions(+), 1 deletion(-)\n\ndiff --git a/contrib/vscode/init.sh b/contrib/vscode/init.sh\nindex 3cc93243f..494a51ac5 100755\n--- a/contrib/vscode/init.sh\n+++ b/contrib/vscode/init.sh\n@@ -115,7 +115,19 @@ include Makefile\n vscode-init:\n \t@mkdir -p .vscode && \\\n \tincs= && defs= && \\\n-\tfor e in $(ALL_CFLAGS); do \\\n+\tfor e in $(ALL_CFLAGS) \\\n+\t\t\t'-DGIT_EXEC_PATH=\"$(gitexecdir_SQ)\"' \\\n+\t\t\t'-DGIT_LOCALE_PATH=\"$(localedir_relative_SQ)\"' \\\n+\t\t\t'-DBINDIR=\"$(bindir_relative_SQ)\"' \\\n+\t\t\t'-DFALLBACK_RUNTIME_PREFIX=\"$(prefix_SQ)\"' \\\n+\t\t\t'-DDEFAULT_GIT_TEMPLATE_DIR=\"$(template_dir_SQ)\"' \\\n+\t\t\t'-DETC_GITCONFIG=\"$(ETC_GITCONFIG_SQ)\"' \\\n+\t\t\t'-DETC_GITATTRIBUTES=\"$(ETC_GITATTRIBUTES_SQ)\"' \\\n+\t\t\t'-DGIT_LOCALE_PATH=\"$(localedir_relative_SQ)\"' \\\n+\t\t\t'-DCURL_DISABLE_TYPECHECK', \\\n+\t\t\t'-DGIT_HTML_PATH=\"$(htmldir_relative_SQ)\"' \\\n+\t\t\t'-DGIT_MAN_PATH=\"$(mandir_relative_SQ)\"' \\\n+\t\t\t'-DGIT_INFO_PATH=\"$(infodir_relative_SQ)\"'; do \\\n \t\tcase \"$$e\" in \\\n \t\t-I.) \\\n \t\t\tincs=\"$$(printf '% 16s\"$${workspaceRoot}\",\\n%s' \\\n-- \ngitgitgadget\n\n"},{"id":"353356","messageId":"de49c4bf264e31ab6d76b23f3590ef6466cb8936.1532353966.git.gitgitgadget@gmail.com","threadId":"48942","inReplyTo":"pull.2.git.gitgitgadget@gmail.com","subject":"[PATCH 3/9] cache.h: extract enum declaration from inside a struct declaration","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2018-07-23T13:52:52Z","receivedAt":"2018-07-23T13:52:55Z","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\nWhile it is technically possible, it is confusing. Not only the user,\nbut also VS Code's intellisense.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n cache.h | 24 +++++++++++++-----------\n 1 file changed, 13 insertions(+), 11 deletions(-)\n\ndiff --git a/cache.h b/cache.h\nindex 89a107a7f..2380136f6 100644\n--- a/cache.h\n+++ b/cache.h\n@@ -1425,18 +1425,20 @@ extern void *read_object_with_reference(const struct object_id *oid,\n extern struct object *peel_to_type(const char *name, int namelen,\n \t\t\t\t   struct object *o, enum object_type);\n \n+enum date_mode_type {\n+\tDATE_NORMAL = 0,\n+\tDATE_RELATIVE,\n+\tDATE_SHORT,\n+\tDATE_ISO8601,\n+\tDATE_ISO8601_STRICT,\n+\tDATE_RFC2822,\n+\tDATE_STRFTIME,\n+\tDATE_RAW,\n+\tDATE_UNIX\n+};\n+\n struct date_mode {\n-\tenum date_mode_type {\n-\t\tDATE_NORMAL = 0,\n-\t\tDATE_RELATIVE,\n-\t\tDATE_SHORT,\n-\t\tDATE_ISO8601,\n-\t\tDATE_ISO8601_STRICT,\n-\t\tDATE_RFC2822,\n-\t\tDATE_STRFTIME,\n-\t\tDATE_RAW,\n-\t\tDATE_UNIX\n-\t} type;\n+\tenum date_mode_type type;\n \tconst char *strftime_fmt;\n \tint local;\n };\n-- \ngitgitgadget\n\n"},{"id":"353357","messageId":"b3ce2ccf4ae27811953be4cb02c4530551266213.1532353966.git.gitgitgadget@gmail.com","threadId":"48942","inReplyTo":"pull.2.git.gitgitgadget@gmail.com","subject":"[PATCH 4/9] mingw: define WIN32 explicitly","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2018-07-23T13:52:53Z","receivedAt":"2018-07-23T13:52:57Z","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 helps VS Code's intellisense to figure out that we want to include\nwindows.h, and that we want to define the minimum target Windows version\nas Windows Vista/2008R2.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n config.mak.uname | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/config.mak.uname b/config.mak.uname\nindex 684fc5bf0..2be2f1981 100644\n--- a/config.mak.uname\n+++ b/config.mak.uname\n@@ -528,7 +528,7 @@ ifneq (,$(findstring MINGW,$(uname_S)))\n \tCOMPAT_OBJS += compat/mingw.o compat/winansi.o \\\n \t\tcompat/win32/pthread.o compat/win32/syslog.o \\\n \t\tcompat/win32/dirent.o\n-\tBASIC_CFLAGS += -DPROTECT_NTFS_DEFAULT=1\n+\tBASIC_CFLAGS += -DWIN32 -DPROTECT_NTFS_DEFAULT=1\n \tEXTLIBS += -lws2_32\n \tGITLIBS += git.res\n \tPTHREAD_LIBS =\n-- \ngitgitgadget\n\n"},{"id":"353358","messageId":"06dcf6d974b67afcd599daa79b5820160ac42ed2.1532353966.git.gitgitgadget@gmail.com","threadId":"48942","inReplyTo":"pull.2.git.gitgitgadget@gmail.com","subject":"[PATCH 5/9] vscode: only overwrite C/C++ settings","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2018-07-23T13:52:54Z","receivedAt":"2018-07-23T13:52:59Z","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 C/C++ settings are special, as they are the only generated VS Code\nconfigurations that *will* change over the course of Git's development,\ne.g. when a new constant is defined.\n\nTherefore, let's only update the C/C++ settings, also to prevent user\nmodifications from being overwritten.\n\nIdeally, we would keep user modifications in the C/C++ settings, but\nthat would require parsing JSON, a task for which a Unix shell script is\ndistinctly unsuited. So we write out .new files instead, and warn the\nuser if they may want to reconcile their changes.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n contrib/vscode/init.sh | 23 ++++++++++++++++++++---\n 1 file changed, 20 insertions(+), 3 deletions(-)\n\ndiff --git a/contrib/vscode/init.sh b/contrib/vscode/init.sh\nindex 494a51ac5..ba9469226 100755\n--- a/contrib/vscode/init.sh\n+++ b/contrib/vscode/init.sh\n@@ -13,7 +13,7 @@ die \"Could not create .vscode/\"\n \n # General settings\n \n-cat >.vscode/settings.json <<\\EOF ||\n+cat >.vscode/settings.json.new <<\\EOF ||\n {\n     \"C_Cpp.intelliSenseEngine\": \"Default\",\n     \"C_Cpp.intelliSenseEngineFallback\": \"Disabled\",\n@@ -51,7 +51,7 @@ esac\n \n # Default build task\n \n-cat >.vscode/tasks.json <<EOF ||\n+cat >.vscode/tasks.json.new <<EOF ||\n {\n     // See https://go.microsoft.com/fwlink/?LinkId=733558\n     // for the documentation about the tasks.json format\n@@ -73,7 +73,7 @@ die \"Could not install default build task\"\n \n # Debugger settings\n \n-cat >.vscode/launch.json <<EOF ||\n+cat >.vscode/launch.json.new <<EOF ||\n {\n     // Use IntelliSense to learn about possible attributes.\n     // Hover to view descriptions of existing attributes.\n@@ -175,3 +175,20 @@ vscode-init:\n \techo '}'\n EOF\n die \"Could not write settings for the C/C++ extension\"\n+\n+for file in .vscode/settings.json .vscode/tasks.json .vscode/launch.json\n+do\n+\tif test -f $file\n+\tthen\n+\t\tif git diff --no-index --quiet --exit-code $file $file.new\n+\t\tthen\n+\t\t\trm $file.new\n+\t\telse\n+\t\t\tprintf \"The file $file.new has these changes:\\n\\n\"\n+\t\t\tgit --no-pager diff --no-index $file $file.new\n+\t\t\tprintf \"\\n\\nMaybe \\`mv $file.new $file\\`?\\n\\n\"\n+\t\tfi\n+\telse\n+\t\tmv $file.new $file\n+\tfi\n+done\n-- \ngitgitgadget\n\n"},{"id":"353359","messageId":"08212c57e5c088b4f2de3cc97d3305069c551613.1532353966.git.gitgitgadget@gmail.com","threadId":"48942","inReplyTo":"pull.2.git.gitgitgadget@gmail.com","subject":"[PATCH 6/9] vscode: wrap commit messages at column 72 by default","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2018-07-23T13:52:56Z","receivedAt":"2018-07-23T13:53:01Z","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 configuring VS Code as core.editor (via `code --wait`), we really\nwant to adhere to the Git conventions of wrapping commit messages.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n contrib/vscode/init.sh | 4 ++++\n 1 file changed, 4 insertions(+)\n\ndiff --git a/contrib/vscode/init.sh b/contrib/vscode/init.sh\nindex ba9469226..face115e8 100755\n--- a/contrib/vscode/init.sh\n+++ b/contrib/vscode/init.sh\n@@ -17,6 +17,10 @@ cat >.vscode/settings.json.new <<\\EOF ||\n {\n     \"C_Cpp.intelliSenseEngine\": \"Default\",\n     \"C_Cpp.intelliSenseEngineFallback\": \"Disabled\",\n+    \"[git-commit]\": {\n+        \"editor.wordWrap\": \"wordWrapColumn\",\n+        \"editor.wordWrapColumn\": 72\n+    },\n     \"files.associations\": {\n         \"*.h\": \"c\",\n         \"*.c\": \"c\"\n-- \ngitgitgadget\n\n"},{"id":"353360","messageId":"ce216cf431935a3e5fc00cd67090042578c32e65.1532353966.git.gitgitgadget@gmail.com","threadId":"48942","inReplyTo":"pull.2.git.gitgitgadget@gmail.com","subject":"[PATCH 8/9] vscode: add a dictionary for cSpell","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2018-07-23T13:52:58Z","receivedAt":"2018-07-23T13:53:02Z","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 quite useful cSpell extension allows VS Code to have \"squiggly\"\nlines under spelling mistakes. By default, this would add too much\nclutter, though, because so much of Git's source code uses words that\nwould trigger cSpell.\n\nLet's add a few words to make the spell checking more useful by reducing\nthe number of false positives.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n contrib/vscode/init.sh | 169 ++++++++++++++++++++++++++++++++++++++++-\n 1 file changed, 168 insertions(+), 1 deletion(-)\n\ndiff --git a/contrib/vscode/init.sh b/contrib/vscode/init.sh\nindex 29f2a729d..a134cb4c5 100755\n--- a/contrib/vscode/init.sh\n+++ b/contrib/vscode/init.sh\n@@ -32,7 +32,174 @@ cat >.vscode/settings.json.new <<\\EOF ||\n     \"files.associations\": {\n         \"*.h\": \"c\",\n         \"*.c\": \"c\"\n-    }\n+    },\n+    \"cSpell.words\": [\n+        \"DATAW\",\n+        \"DBCACHED\",\n+        \"DFCHECK\",\n+        \"DTYPE\",\n+        \"Hamano\",\n+        \"HCAST\",\n+        \"HEXSZ\",\n+        \"HKEY\",\n+        \"HKLM\",\n+        \"IFGITLINK\",\n+        \"IFINVALID\",\n+        \"ISBROKEN\",\n+        \"ISGITLINK\",\n+        \"ISSYMREF\",\n+        \"Junio\",\n+        \"LPDWORD\",\n+        \"LPPROC\",\n+        \"LPWSTR\",\n+        \"MSVCRT\",\n+        \"NOARG\",\n+        \"NOCOMPLETE\",\n+        \"NOINHERIT\",\n+        \"RENORMALIZE\",\n+        \"STARTF\",\n+        \"STARTUPINFOEXW\",\n+        \"Schindelin\",\n+        \"UCRT\",\n+        \"YESNO\",\n+        \"argcp\",\n+        \"beginthreadex\",\n+        \"committish\",\n+        \"contentp\",\n+        \"cpath\",\n+        \"cpidx\",\n+        \"ctim\",\n+        \"dequote\",\n+        \"envw\",\n+        \"ewah\",\n+        \"fdata\",\n+        \"fherr\",\n+        \"fhin\",\n+        \"fhout\",\n+        \"fragp\",\n+        \"fsmonitor\",\n+        \"hnsec\",\n+        \"idents\",\n+        \"includeif\",\n+        \"interpr\",\n+        \"iprog\",\n+        \"isexe\",\n+        \"iskeychar\",\n+        \"kompare\",\n+        \"mksnpath\",\n+        \"mktag\",\n+        \"mktree\",\n+        \"mmblob\",\n+        \"mmbuffer\",\n+        \"mmfile\",\n+        \"noenv\",\n+        \"nparents\",\n+        \"ntpath\",\n+        \"ondisk\",\n+        \"ooid\",\n+        \"oplen\",\n+        \"osdl\",\n+        \"pnew\",\n+        \"pold\",\n+        \"ppinfo\",\n+        \"pushf\",\n+        \"pushv\",\n+        \"rawsz\",\n+        \"rebasing\",\n+        \"reencode\",\n+        \"repo\",\n+        \"rerere\",\n+        \"scld\",\n+        \"sharedrepo\",\n+        \"spawnv\",\n+        \"spawnve\",\n+        \"spawnvpe\",\n+        \"strdup'ing\",\n+        \"submodule\",\n+        \"submodules\",\n+        \"topath\",\n+        \"topo\",\n+        \"tpatch\",\n+        \"unexecutable\",\n+        \"unhide\",\n+        \"unkc\",\n+        \"unkv\",\n+        \"unmark\",\n+        \"unmatch\",\n+        \"unsets\",\n+        \"unshown\",\n+        \"untracked\",\n+        \"untrackedcache\",\n+        \"unuse\",\n+        \"upos\",\n+        \"uval\",\n+        \"vreportf\",\n+        \"wargs\",\n+        \"wargv\",\n+        \"wbuffer\",\n+        \"wcmd\",\n+        \"wcsnicmp\",\n+        \"wcstoutfdup\",\n+        \"wdeltaenv\",\n+        \"wdir\",\n+        \"wenv\",\n+        \"wenvblk\",\n+        \"wenvcmp\",\n+        \"wenviron\",\n+        \"wenvpos\",\n+        \"wenvsz\",\n+        \"wfile\",\n+        \"wfilename\",\n+        \"wfopen\",\n+        \"wfreopen\",\n+        \"wfullpath\",\n+        \"which'll\",\n+        \"wlink\",\n+        \"wmain\",\n+        \"wmkdir\",\n+        \"wmktemp\",\n+        \"wnewpath\",\n+        \"wotype\",\n+        \"wpath\",\n+        \"wpathname\",\n+        \"wpgmptr\",\n+        \"wpnew\",\n+        \"wpointer\",\n+        \"wpold\",\n+        \"wpos\",\n+        \"wputenv\",\n+        \"wrmdir\",\n+        \"wship\",\n+        \"wtarget\",\n+        \"wtemplate\",\n+        \"wunlink\",\n+        \"xcalloc\",\n+        \"xgetcwd\",\n+        \"xmallocz\",\n+        \"xmemdupz\",\n+        \"xmmap\",\n+        \"xopts\",\n+        \"xrealloc\",\n+        \"xsnprintf\",\n+        \"xutftowcs\",\n+        \"xutftowcsn\",\n+        \"xwcstoutf\"\n+    ],\n+    \"cSpell.ignoreRegExpList\": [\n+        \"\\\\\\\"(DIRC|FSMN|REUC|UNTR)\\\\\\\"\",\n+        \"\\\\\\\\u[0-9a-fA-Fx]{4}\\\\b\",\n+        \"\\\\b(filfre|frotz|xyzzy)\\\\b\",\n+        \"\\\\bCMIT_FMT_DEFAULT\\\\b\",\n+        \"\\\\bde-munge\\\\b\",\n+        \"\\\\bGET_OID_DISAMBIGUATORS\\\\b\",\n+        \"\\\\bHASH_RENORMALIZE\\\\b\",\n+        \"\\\\bTREESAMEness\\\\b\",\n+        \"\\\\bUSE_STDEV\\\\b\",\n+        \"\\\\Wchar *\\\\*\\\\W*utfs\\\\W\",\n+        \"cURL's\",\n+        \"nedmalloc'ed\",\n+        \"ntifs\\\\.h\",\n+    ],\n }\n EOF\n die \"Could not write settings.json\"\n-- \ngitgitgadget\n\n"},{"id":"353361","messageId":"4c2aa015a444e87db7242a436b99f02bf3d331f4.1532353966.git.gitgitgadget@gmail.com","threadId":"48942","inReplyTo":"pull.2.git.gitgitgadget@gmail.com","subject":"[PATCH 9/9] vscode: let cSpell work on commit messages, too","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2018-07-23T13:53:00Z","receivedAt":"2018-07-23T13:53:03Z","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\nBy default, the cSpell extension ignores all files under .git/. That\nincludes, unfortunately, COMMIT_EDITMSG, i.e. commit messages. However,\nspell checking is *quite* useful when writing commit messages... And\nsince the user hardly ever opens any file inside .git (apart from commit\nmessages, the config, and sometimes interactive rebase's todo lists),\nthere is really not much harm in *not* ignoring .git/.\n\nThe default also ignores `node_modules/`, but that does not apply to\nGit, so let's skip ignoring that, too.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n contrib/vscode/init.sh | 2 ++\n 1 file changed, 2 insertions(+)\n\ndiff --git a/contrib/vscode/init.sh b/contrib/vscode/init.sh\nindex a134cb4c5..27de94994 100755\n--- a/contrib/vscode/init.sh\n+++ b/contrib/vscode/init.sh\n@@ -33,6 +33,8 @@ cat >.vscode/settings.json.new <<\\EOF ||\n         \"*.h\": \"c\",\n         \"*.c\": \"c\"\n     },\n+    \"cSpell.ignorePaths\": [\n+    ],\n     \"cSpell.words\": [\n         \"DATAW\",\n         \"DBCACHED\",\n-- \ngitgitgadget\n"},{"id":"353362","messageId":"2e880b6f1c6d37d0f94598db408511e0e216a51f.1532353966.git.gitgitgadget@gmail.com","threadId":"48942","inReplyTo":"pull.2.git.gitgitgadget@gmail.com","subject":"[PATCH 7/9] vscode: use 8-space tabs, no trailing ws, etc for Git's source code","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2018-07-23T13:52:57Z","receivedAt":"2018-07-23T13:53:05Z","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 adds a couple settings for the .c/.h files so that it is easier to\nconform to Git's conventions while editing the source code.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n contrib/vscode/init.sh | 8 ++++++++\n 1 file changed, 8 insertions(+)\n\ndiff --git a/contrib/vscode/init.sh b/contrib/vscode/init.sh\nindex face115e8..29f2a729d 100755\n--- a/contrib/vscode/init.sh\n+++ b/contrib/vscode/init.sh\n@@ -21,6 +21,14 @@ cat >.vscode/settings.json.new <<\\EOF ||\n         \"editor.wordWrap\": \"wordWrapColumn\",\n         \"editor.wordWrapColumn\": 72\n     },\n+    \"[c]\": {\n+        \"editor.detectIndentation\": false,\n+        \"editor.insertSpaces\": false,\n+        \"editor.tabSize\": 8,\n+        \"editor.wordWrap\": \"wordWrapColumn\",\n+        \"editor.wordWrapColumn\": 80,\n+        \"files.trimTrailingWhitespace\": true\n+    },\n     \"files.associations\": {\n         \"*.h\": \"c\",\n         \"*.c\": \"c\"\n-- \ngitgitgadget\n\n"},{"id":"353376","messageId":"20180723165719.GA16420@aiede.svl.corp.google.com","threadId":"48942","inReplyTo":"e2e449a00385531d326d6811a871dde59624b818.1532353966.git.gitgitgadget@gmail.com","subject":"Re: [PATCH 1/9] contrib: add a script to initialize VS Code configuration","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2018-07-23T16:57:19Z","receivedAt":"2018-07-23T16:57:27Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Hi,\n\nThanks for working on this.\n\nJohannes Schindelin via GitGitGadget wrote:\n\n> From: Johannes Schindelin <johannes.schindelin@gmx.de>\n>\n> VS Code is a lightweight but powerful source code editor which runs on\n> your desktop and is available for Windows, macOS and Linux. Among other\n> languages, it has support for C/C++ via an extension.\n\nThis doesn't really seem relevant to the change.  The relevant bits\nare that (1) VS Code is a popular source code editor, and that (2)\nit's one worth recommending to newcomers.\n\n> To start developing Git with VS Code, simply run the Unix shell script\n> contrib/vscode/init.sh, which creates the configuration files in\n> .vscode/ that VS Code consumes.\n>\n> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nThis doesn't tell me what the patch will actually do.\n\nVSCode is an editor.  Is the idea that this will help configure the\neditor to do the right thing with whitespace or something?  Or does it\nconfigure IDE features to build git?\n\nThanks,\nJonathan\n"},{"id":"353379","messageId":"20180723174108.GA9285@aiede.svl.corp.google.com","threadId":"48942","inReplyTo":"3770bd855c6f3e69acfe418ea7fe5b40454e4dfb.1532353966.git.gitgitgadget@gmail.com","subject":"Re: [PATCH 2/9] vscode: hard-code a couple defines","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2018-07-23T17:41:08Z","receivedAt":"2018-07-23T17:41:16Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Hi,\n\nJohannes Schindelin via GitGitGadget wrote:\n\n> From: Johannes Schindelin <johannes.schindelin@gmx.de>\n>\n> Sadly, we do not get all of the definitions via ALL_CFLAGS. Some defines\n> are passed to GCC *only* when compiling specific files, such as git.o.\n>\n> Let's just hard-code them into the script for the time being.\n\nCould we move these to ALL_CFLAGS?  Is there any downside other than\nincreased rebuilds when options change?\n\nThanks,\nJonathan\n"},{"id":"353410","messageId":"xmqq1sbt68ec.fsf@gitster-ct.c.googlers.com","threadId":"48942","inReplyTo":"e2e449a00385531d326d6811a871dde59624b818.1532353966.git.gitgitgadget@gmail.com","subject":"Re: [PATCH 1/9] contrib: add a script to initialize VS Code configuration","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-07-23T19:48:11Z","receivedAt":"2018-07-23T19:48:15Z","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> diff --git a/contrib/vscode/init.sh b/contrib/vscode/init.sh\n> new file mode 100755\n> index 000000000..3cc93243f\n> --- /dev/null\n> +++ b/contrib/vscode/init.sh\n> @@ -0,0 +1,165 @@\n> +#!/bin/sh\n\nThis is caued by our usual \"git apply --whitespace=warn\" as it\ncontains lines indented by spaces not tabs (perhaps the json\nliterals?)  Can we have contrib/vscode/.gitattributes to tweak the\nwhitespace breakage checking rules so that this file is excempt?\n\nI'll just shut my eyes while applying this series for today, though\n;-)\n"},{"id":"353424","messageId":"xmqqd0vd4osi.fsf@gitster-ct.c.googlers.com","threadId":"48942","inReplyTo":"xmqq1sbt68ec.fsf@gitster-ct.c.googlers.com","subject":"Re: [PATCH 1/9] contrib: add a script to initialize VS Code configuration","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-07-23T21:37:01Z","receivedAt":"2018-07-23T21:37:05Z","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 via GitGitGadget\" <gitgitgadget@gmail.com>\n> writes:\n>\n>> diff --git a/contrib/vscode/init.sh b/contrib/vscode/init.sh\n>> new file mode 100755\n>> index 000000000..3cc93243f\n>> --- /dev/null\n>> +++ b/contrib/vscode/init.sh\n>> @@ -0,0 +1,165 @@\n>> +#!/bin/sh\n>\n> This is caued by our usual \"git apply --whitespace=warn\" as it\n\n\"caught\"; sorry for a typo.\n"},{"id":"353548","messageId":"88952ba5-9de4-9b32-2129-1cc83999db78@kdbg.org","threadId":"48942","inReplyTo":"2e880b6f1c6d37d0f94598db408511e0e216a51f.1532353966.git.gitgitgadget@gmail.com","subject":"Re: [PATCH 7/9] vscode: use 8-space tabs, no trailing ws, etc for Git's source code","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2018-07-25T07:32:01Z","receivedAt":"2018-07-25T07:32:18Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 23.07.2018 um 15:52 schrieb Johannes Schindelin via GitGitGadget:\n> From: Johannes Schindelin <johannes.schindelin@gmx.de>\n> \n> This adds a couple settings for the .c/.h files so that it is easier to\n> conform to Git's conventions while editing the source code.\n> \n> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> ---\n>   contrib/vscode/init.sh | 8 ++++++++\n>   1 file changed, 8 insertions(+)\n> \n> diff --git a/contrib/vscode/init.sh b/contrib/vscode/init.sh\n> index face115e8..29f2a729d 100755\n> --- a/contrib/vscode/init.sh\n> +++ b/contrib/vscode/init.sh\n> @@ -21,6 +21,14 @@ cat >.vscode/settings.json.new <<\\EOF ||\n>           \"editor.wordWrap\": \"wordWrapColumn\",\n>           \"editor.wordWrapColumn\": 72\n>       },\n> +    \"[c]\": {\n> +        \"editor.detectIndentation\": false,\n> +        \"editor.insertSpaces\": false,\n> +        \"editor.tabSize\": 8,\n> +        \"editor.wordWrap\": \"wordWrapColumn\",\n> +        \"editor.wordWrapColumn\": 80,\n> +        \"files.trimTrailingWhitespace\": true\n> +    },\n\nI am a VS Code user, but I haven't used these settings before.\n\nWith these settings, does the editor break lines while I am typing? Or \ndoes it just insert a visual cue that tells where I should insert a line \nbreak? If the former, it would basically make the editor unusable for my \ntaste. I want to have total control over the code I write. The 80 column \nlimit is just a recommendation, not a hard requirement.\n\n>       \"files.associations\": {\n>           \"*.h\": \"c\",\n>           \"*.c\": \"c\"\n> \n\n-- Hannes\n"},{"id":"353875","messageId":"nycvar.QRO.7.76.6.1807301626150.10478@tvgsbejvaqbjf.bet","threadId":"48942","inReplyTo":"20180723165719.GA16420@aiede.svl.corp.google.com","subject":"Re: [PATCH 1/9] contrib: add a script to initialize VS Code configuration","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2018-07-30T14:28:46Z","receivedAt":"2018-07-30T14:28:55Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Jonathan,\n\nOn Mon, 23 Jul 2018, Jonathan Nieder wrote:\n\n> Johannes Schindelin via GitGitGadget wrote:\n> \n> > From: Johannes Schindelin <johannes.schindelin@gmx.de>\n> >\n> > VS Code is a lightweight but powerful source code editor which runs on\n> > your desktop and is available for Windows, macOS and Linux. Among other\n> > languages, it has support for C/C++ via an extension.\n> \n> This doesn't really seem relevant to the change.  The relevant bits\n> are that (1) VS Code is a popular source code editor, and that (2)\n> it's one worth recommending to newcomers.\n\nTo the contrary. This paragraph describes the motivation of the patch.\n\nIt is, if you want, the most important part of the entire patch series.\n\n> > To start developing Git with VS Code, simply run the Unix shell script\n> > contrib/vscode/init.sh, which creates the configuration files in\n> > .vscode/ that VS Code consumes.\n> >\n> > Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> \n> This doesn't tell me what the patch will actually do.\n\nTrue. Will add a paragraph.\n\n> VSCode is an editor.  Is the idea that this will help configure the\n> editor to do the right thing with whitespace or something?  Or does it\n> configure IDE features to build git?\n\nIt is a start of all of the above. Ideally, I will be eventually be able\nto consistently use VS Code for Git development, whether I have to work on\na Linux, a macOS or a Windows machine.\n\nAnd I am not happy until the same ease is also available to others. Hence\nmy contribution.\n\nCiao,\nDscho\n"},{"id":"353877","messageId":"nycvar.QRO.7.76.6.1807301635020.10478@tvgsbejvaqbjf.bet","threadId":"48942","inReplyTo":"xmqq1sbt68ec.fsf@gitster-ct.c.googlers.com","subject":"Re: [PATCH 1/9] contrib: add a script to initialize VS Code configuration","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2018-07-30T14:42:53Z","receivedAt":"2018-07-30T14:43:01Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Junio,\n\nOn Mon, 23 Jul 2018, Junio C Hamano wrote:\n\n> \"Johannes Schindelin via GitGitGadget\" <gitgitgadget@gmail.com>\n> writes:\n> \n> > diff --git a/contrib/vscode/init.sh b/contrib/vscode/init.sh\n> > new file mode 100755\n> > index 000000000..3cc93243f\n> > --- /dev/null\n> > +++ b/contrib/vscode/init.sh\n> > @@ -0,0 +1,165 @@\n> > +#!/bin/sh\n> \n> This is caued by our usual \"git apply --whitespace=warn\" as it\n> contains lines indented by spaces not tabs (perhaps the json\n> literals?)\n\nA `git diff --check` does not show any red flag.\n\n> Can we have contrib/vscode/.gitattributes to tweak the whitespace\n> breakage checking rules so that this file is excempt?\n\nI would have appreciated quite a bit more clear a message, including how I\ncan trigger this, and what is the appropriate setting.\n\nAs it is, I cannot reproduce your problem with a `git show`, so I assume\nthat the main problem is that this commit *does* add that .gitattributes,\nbut of course your `git apply` ran before that file existed.\n\nFor your own pleasure, here is the link to the .gitattributes file in the\ncommit that you applied yourself:\n\nhttps://github.com/gitster/git/commit/44559f0388a4e256bea3eb2f57b92a2b9e3d06f9#diff-046ba41c5a21694c62b8dc5e93d7f0c2R1\n\nI assume that this is good enough for you, and your comment is moot?\n\nCiao,\nDscho\n"},{"id":"353878","messageId":"nycvar.QRO.7.76.6.1807301643200.10478@tvgsbejvaqbjf.bet","threadId":"48942","inReplyTo":"20180723174108.GA9285@aiede.svl.corp.google.com","subject":"Re: [PATCH 2/9] vscode: hard-code a couple defines","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2018-07-30T14:46:01Z","receivedAt":"2018-07-30T14:46:08Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Jonathan,\n\nOn Mon, 23 Jul 2018, Jonathan Nieder wrote:\n\n> Johannes Schindelin via GitGitGadget wrote:\n> \n> > From: Johannes Schindelin <johannes.schindelin@gmx.de>\n> >\n> > Sadly, we do not get all of the definitions via ALL_CFLAGS. Some defines\n> > are passed to GCC *only* when compiling specific files, such as git.o.\n> >\n> > Let's just hard-code them into the script for the time being.\n> \n> Could we move these to ALL_CFLAGS?  Is there any downside other than\n> increased rebuilds when options change?\n\nI assumed that it gives us a bit more liberty at using names for constants\nthat might otherwise be too general.\n\nI did not even consider the rebuild time, but that's a good point.\n\nThe idea to move those definitions to ALL_CFLAGS sounds good to me, yet I\nam loathe to introduce this into a patch series that is not about\nfar-reaching design decisions at all, but merely about making a decent\ntool available to the finger tips of all Git contributors.\n\nRead: I think this would make for a pretty good micro-project, maybe in next\nyear's GSoC (assuming that it happens and that we're accepted again).\n\nCiao,\nDscho\n"},{"id":"353880","messageId":"nycvar.QRO.7.76.6.1807301646360.10478@tvgsbejvaqbjf.bet","threadId":"48942","inReplyTo":"88952ba5-9de4-9b32-2129-1cc83999db78@kdbg.org","subject":"Re: [PATCH 7/9] vscode: use 8-space tabs, no trailing ws, etc for Git's source code","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2018-07-30T14:48:07Z","receivedAt":"2018-07-30T14:48:15Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Hannes,\n\nOn Wed, 25 Jul 2018, Johannes Sixt wrote:\n\n> Am 23.07.2018 um 15:52 schrieb Johannes Schindelin via GitGitGadget:\n> > From: Johannes Schindelin <johannes.schindelin@gmx.de>\n> > \n> > This adds a couple settings for the .c/.h files so that it is easier to\n> > conform to Git's conventions while editing the source code.\n> > \n> > Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> > ---\n> >   contrib/vscode/init.sh | 8 ++++++++\n> >   1 file changed, 8 insertions(+)\n> > \n> > diff --git a/contrib/vscode/init.sh b/contrib/vscode/init.sh\n> > index face115e8..29f2a729d 100755\n> > --- a/contrib/vscode/init.sh\n> > +++ b/contrib/vscode/init.sh\n> > @@ -21,6 +21,14 @@ cat >.vscode/settings.json.new <<\\EOF ||\n> >           \"editor.wordWrap\": \"wordWrapColumn\",\n> >           \"editor.wordWrapColumn\": 72\n> >       },\n> > +    \"[c]\": {\n> > +        \"editor.detectIndentation\": false,\n> > +        \"editor.insertSpaces\": false,\n> > +        \"editor.tabSize\": 8,\n> > +        \"editor.wordWrap\": \"wordWrapColumn\",\n> > +        \"editor.wordWrapColumn\": 80,\n> > +        \"files.trimTrailingWhitespace\": true\n> > +    },\n> \n> I am a VS Code user, but I haven't used these settings before.\n> \n> With these settings, does the editor break lines while I am typing? Or does it\n> just insert a visual cue that tells where I should insert a line break? If the\n> former, it would basically make the editor unusable for my taste. I want to\n> have total control over the code I write. The 80 column limit is just a\n> recommendation, not a hard requirement.\n\nFear not. It is giving you a very clear visual cue, but that's all. It\ndoes show the line wrapped, but the line number column quite clearly shows\nthat it did not insert a new-line.\n\nCiao,\nDscho\n\n> \n> >       \"files.associations\": {\n> >           \"*.h\": \"c\",\n> >           \"*.c\": \"c\"\n> > \n> \n> -- Hannes\n> \n> \n"},{"id":"353889","messageId":"pull.2.v2.git.gitgitgadget@gmail.com","threadId":"48942","inReplyTo":"pull.2.git.gitgitgadget@gmail.com","subject":"[PATCH v2 0/9] Add support to develop Git in Visual Studio Code","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2018-07-30T15:42:45Z","receivedAt":"2018-07-30T15:42:49Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"[Visual Studio Code](https://code.visualstudio.com/) (nickname \"VS Code\") is a light-weight, cross-platform, Open Source development environment, with an increasingly powerful extension to support C/C++ development. In particular the intellisense support as well as all the other niceties developers might have come to expect from Integrated Development Environments will help accelerate development.\n\nDue to the way Git's source code and build process is structured, it can be quite challenging to use VS Code effectively for developing Git. Which is a shame, as developing with vim and the command-line causes unnecessary churn, and it is quite understandable that most Git developers simply do not want to fight with a modern development environment just to try whether they like developing Git with it.\n\nThis topic branch makes it easy to get started using VS Code to develop Git.\n\nSimply run the script `./contrib/vscode/init.sh`. This will initialize the `.vscode/` directory and some files in that directory. After that, just open Git's top-level directory as \"folder\" in VS Code.\n\nThe files have to be generated because of the curious way Git determines what flags to pass to the C compiler, in particular which constants are defined, because they change the compile flow in rather dramatic ways (determining, e.g. which SHA-1 backend to use).\n\nChanges since v1:\n\n- Clarified commit message of the first commit.\n\nJohannes Schindelin (9):\n  contrib: add a script to initialize VS Code configuration\n  vscode: hard-code a couple defines\n  cache.h: extract enum declaration from inside a struct declaration\n  mingw: define WIN32 explicitly\n  vscode: only overwrite C/C++ settings\n  vscode: wrap commit messages at column 72 by default\n  vscode: use 8-space tabs, no trailing ws, etc for Git's source code\n  vscode: add a dictionary for cSpell\n  vscode: let cSpell work on commit messages, too\n\n .gitignore                    |   1 +\n cache.h                       |  24 ++-\n config.mak.uname              |   2 +-\n contrib/vscode/.gitattributes |   1 +\n contrib/vscode/README.md      |  14 ++\n contrib/vscode/init.sh        | 375 ++++++++++++++++++++++++++++++++++\n 6 files changed, 405 insertions(+), 12 deletions(-)\n create mode 100644 contrib/vscode/.gitattributes\n create mode 100644 contrib/vscode/README.md\n create mode 100755 contrib/vscode/init.sh\n\n\nbase-commit: 53f9a3e157dbbc901a02ac2c73346d375e24978c\nPublished-As: https://github.com/gitgitgadget/git/releases/tags/pr-2%2Fdscho%2Fvscode-v2\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-2/dscho/vscode-v2\nPull-Request: https://github.com/gitgitgadget/git/pull/2\n\nRange-diff vs v1:\n\n  1:  e2e449a00 !  1:  bbf13e40a contrib: add a script to initialize VS Code configuration\n     @@ -4,11 +4,14 @@\n      \n          VS Code is a lightweight but powerful source code editor which runs on\n          your desktop and is available for Windows, macOS and Linux. Among other\n     -    languages, it has support for C/C++ via an extension.\n     +    languages, it has support for C/C++ via an extension, which offers to\n     +    not only build and debug the code, but also Intellisense, i.e.\n     +    code-aware completion and similar niceties.\n      \n     -    To start developing Git with VS Code, simply run the Unix shell script\n     -    contrib/vscode/init.sh, which creates the configuration files in\n     -    .vscode/ that VS Code consumes.\n     +    This patch adds a script that helps set up the environment to work\n     +    effectively with VS Code: simply run the Unix shell script\n     +    contrib/vscode/init.sh, which creates the relevant files, and open the\n     +    top level folder of Git's source code in VS Code.\n      \n          Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n      \n  2:  3770bd855 =  2:  6c8b5a4f2 vscode: hard-code a couple defines\n  3:  de49c4bf2 =  3:  105b50c62 cache.h: extract enum declaration from inside a struct declaration\n  4:  b3ce2ccf4 =  4:  4b95b1e2a mingw: define WIN32 explicitly\n  5:  06dcf6d97 =  5:  3dd53c04c vscode: only overwrite C/C++ settings\n  6:  08212c57e =  6:  384b08836 vscode: wrap commit messages at column 72 by default\n  7:  2e880b6f1 =  7:  ba78af756 vscode: use 8-space tabs, no trailing ws, etc for Git's source code\n  8:  ce216cf43 =  8:  358f38d3a vscode: add a dictionary for cSpell\n  9:  4c2aa015a =  9:  b9c628b88 vscode: let cSpell work on commit messages, too\n\n-- \ngitgitgadget\n"},{"id":"353890","messageId":"6c8b5a4f2234e1340859cafe29bb49b846ca140d.1532965363.git.gitgitgadget@gmail.com","threadId":"48942","inReplyTo":"pull.2.v2.git.gitgitgadget@gmail.com","subject":"[PATCH v2 2/9] vscode: hard-code a couple defines","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2018-07-30T15:42:48Z","receivedAt":"2018-07-30T15:42:52Z","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\nSadly, we do not get all of the definitions via ALL_CFLAGS. Some defines\nare passed to GCC *only* when compiling specific files, such as git.o.\n\nLet's just hard-code them into the script for the time being.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n contrib/vscode/init.sh | 14 +++++++++++++-\n 1 file changed, 13 insertions(+), 1 deletion(-)\n\ndiff --git a/contrib/vscode/init.sh b/contrib/vscode/init.sh\nindex 3cc93243f..494a51ac5 100755\n--- a/contrib/vscode/init.sh\n+++ b/contrib/vscode/init.sh\n@@ -115,7 +115,19 @@ include Makefile\n vscode-init:\n \t@mkdir -p .vscode && \\\n \tincs= && defs= && \\\n-\tfor e in $(ALL_CFLAGS); do \\\n+\tfor e in $(ALL_CFLAGS) \\\n+\t\t\t'-DGIT_EXEC_PATH=\"$(gitexecdir_SQ)\"' \\\n+\t\t\t'-DGIT_LOCALE_PATH=\"$(localedir_relative_SQ)\"' \\\n+\t\t\t'-DBINDIR=\"$(bindir_relative_SQ)\"' \\\n+\t\t\t'-DFALLBACK_RUNTIME_PREFIX=\"$(prefix_SQ)\"' \\\n+\t\t\t'-DDEFAULT_GIT_TEMPLATE_DIR=\"$(template_dir_SQ)\"' \\\n+\t\t\t'-DETC_GITCONFIG=\"$(ETC_GITCONFIG_SQ)\"' \\\n+\t\t\t'-DETC_GITATTRIBUTES=\"$(ETC_GITATTRIBUTES_SQ)\"' \\\n+\t\t\t'-DGIT_LOCALE_PATH=\"$(localedir_relative_SQ)\"' \\\n+\t\t\t'-DCURL_DISABLE_TYPECHECK', \\\n+\t\t\t'-DGIT_HTML_PATH=\"$(htmldir_relative_SQ)\"' \\\n+\t\t\t'-DGIT_MAN_PATH=\"$(mandir_relative_SQ)\"' \\\n+\t\t\t'-DGIT_INFO_PATH=\"$(infodir_relative_SQ)\"'; do \\\n \t\tcase \"$$e\" in \\\n \t\t-I.) \\\n \t\t\tincs=\"$$(printf '% 16s\"$${workspaceRoot}\",\\n%s' \\\n-- \ngitgitgadget\n\n"},{"id":"353891","messageId":"105b50c62667640d0ed45cba1cf730bc3f2237da.1532965363.git.gitgitgadget@gmail.com","threadId":"48942","inReplyTo":"pull.2.v2.git.gitgitgadget@gmail.com","subject":"[PATCH v2 3/9] cache.h: extract enum declaration from inside a struct declaration","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2018-07-30T15:42:49Z","receivedAt":"2018-07-30T15:42:53Z","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\nWhile it is technically possible, it is confusing. Not only the user,\nbut also VS Code's intellisense.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n cache.h | 24 +++++++++++++-----------\n 1 file changed, 13 insertions(+), 11 deletions(-)\n\ndiff --git a/cache.h b/cache.h\nindex 89a107a7f..2380136f6 100644\n--- a/cache.h\n+++ b/cache.h\n@@ -1425,18 +1425,20 @@ extern void *read_object_with_reference(const struct object_id *oid,\n extern struct object *peel_to_type(const char *name, int namelen,\n \t\t\t\t   struct object *o, enum object_type);\n \n+enum date_mode_type {\n+\tDATE_NORMAL = 0,\n+\tDATE_RELATIVE,\n+\tDATE_SHORT,\n+\tDATE_ISO8601,\n+\tDATE_ISO8601_STRICT,\n+\tDATE_RFC2822,\n+\tDATE_STRFTIME,\n+\tDATE_RAW,\n+\tDATE_UNIX\n+};\n+\n struct date_mode {\n-\tenum date_mode_type {\n-\t\tDATE_NORMAL = 0,\n-\t\tDATE_RELATIVE,\n-\t\tDATE_SHORT,\n-\t\tDATE_ISO8601,\n-\t\tDATE_ISO8601_STRICT,\n-\t\tDATE_RFC2822,\n-\t\tDATE_STRFTIME,\n-\t\tDATE_RAW,\n-\t\tDATE_UNIX\n-\t} type;\n+\tenum date_mode_type type;\n \tconst char *strftime_fmt;\n \tint local;\n };\n-- \ngitgitgadget\n\n"},{"id":"353892","messageId":"bbf13e40a501b6d46766cbf69fd6022b9c0b47b3.1532965363.git.gitgitgadget@gmail.com","threadId":"48942","inReplyTo":"pull.2.v2.git.gitgitgadget@gmail.com","subject":"[PATCH v2 1/9] contrib: add a script to initialize VS Code configuration","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2018-07-30T15:42:46Z","receivedAt":"2018-07-30T15:42:54Z","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\nVS Code is a lightweight but powerful source code editor which runs on\nyour desktop and is available for Windows, macOS and Linux. Among other\nlanguages, it has support for C/C++ via an extension, which offers to\nnot only build and debug the code, but also Intellisense, i.e.\ncode-aware completion and similar niceties.\n\nThis patch adds a script that helps set up the environment to work\neffectively with VS Code: simply run the Unix shell script\ncontrib/vscode/init.sh, which creates the relevant files, and open the\ntop level folder of Git's source code in VS Code.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n .gitignore                    |   1 +\n contrib/vscode/.gitattributes |   1 +\n contrib/vscode/README.md      |  14 +++\n contrib/vscode/init.sh        | 165 ++++++++++++++++++++++++++++++++++\n 4 files changed, 181 insertions(+)\n create mode 100644 contrib/vscode/.gitattributes\n create mode 100644 contrib/vscode/README.md\n create mode 100755 contrib/vscode/init.sh\n\ndiff --git a/.gitignore b/.gitignore\nindex 388cc4bee..592e8f879 100644\n--- a/.gitignore\n+++ b/.gitignore\n@@ -206,6 +206,7 @@\n /config.mak.autogen\n /config.mak.append\n /configure\n+/.vscode/\n /tags\n /TAGS\n /cscope*\ndiff --git a/contrib/vscode/.gitattributes b/contrib/vscode/.gitattributes\nnew file mode 100644\nindex 000000000..e89f2236e\n--- /dev/null\n+++ b/contrib/vscode/.gitattributes\n@@ -0,0 +1 @@\n+init.sh whitespace=-indent-with-non-tab\ndiff --git a/contrib/vscode/README.md b/contrib/vscode/README.md\nnew file mode 100644\nindex 000000000..8202d6203\n--- /dev/null\n+++ b/contrib/vscode/README.md\n@@ -0,0 +1,14 @@\n+Configuration for VS Code\n+=========================\n+\n+[VS Code](https://code.visualstudio.com/) is a lightweight but powerful source\n+code editor which runs on your desktop and is available for\n+[Windows](https://code.visualstudio.com/docs/setup/windows),\n+[macOS](https://code.visualstudio.com/docs/setup/mac) and\n+[Linux](https://code.visualstudio.com/docs/setup/linux). Among other languages,\n+it has [support for C/C++ via an extension](https://github.com/Microsoft/vscode-cpptools).\n+\n+To start developing Git with VS Code, simply run the Unix shell script called\n+`init.sh` in this directory, which creates the configuration files in\n+`.vscode/` that VS Code consumes. `init.sh` needs access to `make` and `gcc`,\n+so run the script in a Git SDK shell if you are using Windows.\ndiff --git a/contrib/vscode/init.sh b/contrib/vscode/init.sh\nnew file mode 100755\nindex 000000000..3cc93243f\n--- /dev/null\n+++ b/contrib/vscode/init.sh\n@@ -0,0 +1,165 @@\n+#!/bin/sh\n+\n+die () {\n+\techo \"$*\" >&2\n+\texit 1\n+}\n+\n+cd \"$(dirname \"$0\")\"/../.. ||\n+die \"Could not cd to top-level directory\"\n+\n+mkdir -p .vscode ||\n+die \"Could not create .vscode/\"\n+\n+# General settings\n+\n+cat >.vscode/settings.json <<\\EOF ||\n+{\n+    \"C_Cpp.intelliSenseEngine\": \"Default\",\n+    \"C_Cpp.intelliSenseEngineFallback\": \"Disabled\",\n+    \"files.associations\": {\n+        \"*.h\": \"c\",\n+        \"*.c\": \"c\"\n+    }\n+}\n+EOF\n+die \"Could not write settings.json\"\n+\n+# Infer some setup-specific locations/names\n+\n+GCCPATH=\"$(which gcc)\"\n+GDBPATH=\"$(which gdb)\"\n+MAKECOMMAND=\"make -j5 DEVELOPER=1\"\n+OSNAME=\n+X=\n+case \"$(uname -s)\" in\n+MINGW*)\n+\tGCCPATH=\"$(cygpath -am \"$GCCPATH\")\"\n+\tGDBPATH=\"$(cygpath -am \"$GDBPATH\")\"\n+\tMAKE_BASH=\"$(cygpath -am /git-cmd.exe) --command=usr\\\\\\\\bin\\\\\\\\bash.exe\"\n+\tMAKECOMMAND=\"$MAKE_BASH -lc \\\\\\\"$MAKECOMMAND\\\\\\\"\"\n+\tOSNAME=Win32\n+\tX=.exe\n+\t;;\n+Linux)\n+\tOSNAME=Linux\n+\t;;\n+Darwin)\n+\tOSNAME=macOS\n+\t;;\n+esac\n+\n+# Default build task\n+\n+cat >.vscode/tasks.json <<EOF ||\n+{\n+    // See https://go.microsoft.com/fwlink/?LinkId=733558\n+    // for the documentation about the tasks.json format\n+    \"version\": \"2.0.0\",\n+    \"tasks\": [\n+        {\n+            \"label\": \"make\",\n+            \"type\": \"shell\",\n+            \"command\": \"$MAKECOMMAND\",\n+            \"group\": {\n+                \"kind\": \"build\",\n+                \"isDefault\": true\n+            }\n+        }\n+    ]\n+}\n+EOF\n+die \"Could not install default build task\"\n+\n+# Debugger settings\n+\n+cat >.vscode/launch.json <<EOF ||\n+{\n+    // Use IntelliSense to learn about possible attributes.\n+    // Hover to view descriptions of existing attributes.\n+    // For more information, visit:\n+    // https://go.microsoft.com/fwlink/?linkid=830387\n+    \"version\": \"0.2.0\",\n+    \"configurations\": [\n+        {\n+            \"name\": \"(gdb) Launch\",\n+            \"type\": \"cppdbg\",\n+            \"request\": \"launch\",\n+            \"program\": \"\\${workspaceFolder}/git$X\",\n+            \"args\": [],\n+            \"stopAtEntry\": false,\n+            \"cwd\": \"\\${workspaceFolder}\",\n+            \"environment\": [],\n+            \"externalConsole\": true,\n+            \"MIMode\": \"gdb\",\n+            \"miDebuggerPath\": \"$GDBPATH\",\n+            \"setupCommands\": [\n+                {\n+                    \"description\": \"Enable pretty-printing for gdb\",\n+                    \"text\": \"-enable-pretty-printing\",\n+                    \"ignoreFailures\": true\n+                }\n+            ]\n+        }\n+    ]\n+}\n+EOF\n+die \"Could not write launch configuration\"\n+\n+# C/C++ extension settings\n+\n+make -f - OSNAME=$OSNAME GCCPATH=\"$GCCPATH\" vscode-init \\\n+\t>.vscode/c_cpp_properties.json <<\\EOF ||\n+include Makefile\n+\n+vscode-init:\n+\t@mkdir -p .vscode && \\\n+\tincs= && defs= && \\\n+\tfor e in $(ALL_CFLAGS); do \\\n+\t\tcase \"$$e\" in \\\n+\t\t-I.) \\\n+\t\t\tincs=\"$$(printf '% 16s\"$${workspaceRoot}\",\\n%s' \\\n+\t\t\t\t\"\" \"$$incs\")\" \\\n+\t\t\t;; \\\n+\t\t-I/*) \\\n+\t\t\tincs=\"$$(printf '% 16s\"%s\",\\n%s' \\\n+\t\t\t\t\"\" \"$${e#-I}\" \"$$incs\")\" \\\n+\t\t\t;; \\\n+\t\t-I*) \\\n+\t\t\tincs=\"$$(printf '% 16s\"$${workspaceRoot}/%s\",\\n%s' \\\n+\t\t\t\t\"\" \"$${e#-I}\" \"$$incs\")\" \\\n+\t\t\t;; \\\n+\t\t-D*) \\\n+\t\t\tdefs=\"$$(printf '% 16s\"%s\",\\n%s' \\\n+\t\t\t\t\"\" \"$$(echo \"$${e#-D}\" | sed 's/\"/\\\\&/g')\" \\\n+\t\t\t\t\"$$defs\")\" \\\n+\t\t\t;; \\\n+\t\tesac; \\\n+\tdone && \\\n+\techo '{' && \\\n+\techo '    \"configurations\": [' && \\\n+\techo '        {' && \\\n+\techo '            \"name\": \"$(OSNAME)\",' && \\\n+\techo '            \"intelliSenseMode\": \"clang-x64\",' && \\\n+\techo '            \"includePath\": [' && \\\n+\techo \"$$incs\" | sort | sed '$$s/,$$//' && \\\n+\techo '            ],' && \\\n+\techo '            \"defines\": [' && \\\n+\techo \"$$defs\" | sort | sed '$$s/,$$//' && \\\n+\techo '            ],' && \\\n+\techo '            \"browse\": {' && \\\n+\techo '                \"limitSymbolsToIncludedHeaders\": true,' && \\\n+\techo '                \"databaseFilename\": \"\",' && \\\n+\techo '                \"path\": [' && \\\n+\techo '                    \"$${workspaceRoot}\"' && \\\n+\techo '                ]' && \\\n+\techo '            },' && \\\n+\techo '            \"cStandard\": \"c11\",' && \\\n+\techo '            \"cppStandard\": \"c++17\",' && \\\n+\techo '            \"compilerPath\": \"$(GCCPATH)\"' && \\\n+\techo '        }' && \\\n+\techo '    ],' && \\\n+\techo '    \"version\": 4' && \\\n+\techo '}'\n+EOF\n+die \"Could not write settings for the C/C++ extension\"\n-- \ngitgitgadget\n\n"},{"id":"353893","messageId":"3dd53c04c4e10d0ec8ce2e6b04558824ab61eb67.1532965363.git.gitgitgadget@gmail.com","threadId":"48942","inReplyTo":"pull.2.v2.git.gitgitgadget@gmail.com","subject":"[PATCH v2 5/9] vscode: only overwrite C/C++ settings","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2018-07-30T15:42:52Z","receivedAt":"2018-07-30T15:42:56Z","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 C/C++ settings are special, as they are the only generated VS Code\nconfigurations that *will* change over the course of Git's development,\ne.g. when a new constant is defined.\n\nTherefore, let's only update the C/C++ settings, also to prevent user\nmodifications from being overwritten.\n\nIdeally, we would keep user modifications in the C/C++ settings, but\nthat would require parsing JSON, a task for which a Unix shell script is\ndistinctly unsuited. So we write out .new files instead, and warn the\nuser if they may want to reconcile their changes.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n contrib/vscode/init.sh | 23 ++++++++++++++++++++---\n 1 file changed, 20 insertions(+), 3 deletions(-)\n\ndiff --git a/contrib/vscode/init.sh b/contrib/vscode/init.sh\nindex 494a51ac5..ba9469226 100755\n--- a/contrib/vscode/init.sh\n+++ b/contrib/vscode/init.sh\n@@ -13,7 +13,7 @@ die \"Could not create .vscode/\"\n \n # General settings\n \n-cat >.vscode/settings.json <<\\EOF ||\n+cat >.vscode/settings.json.new <<\\EOF ||\n {\n     \"C_Cpp.intelliSenseEngine\": \"Default\",\n     \"C_Cpp.intelliSenseEngineFallback\": \"Disabled\",\n@@ -51,7 +51,7 @@ esac\n \n # Default build task\n \n-cat >.vscode/tasks.json <<EOF ||\n+cat >.vscode/tasks.json.new <<EOF ||\n {\n     // See https://go.microsoft.com/fwlink/?LinkId=733558\n     // for the documentation about the tasks.json format\n@@ -73,7 +73,7 @@ die \"Could not install default build task\"\n \n # Debugger settings\n \n-cat >.vscode/launch.json <<EOF ||\n+cat >.vscode/launch.json.new <<EOF ||\n {\n     // Use IntelliSense to learn about possible attributes.\n     // Hover to view descriptions of existing attributes.\n@@ -175,3 +175,20 @@ vscode-init:\n \techo '}'\n EOF\n die \"Could not write settings for the C/C++ extension\"\n+\n+for file in .vscode/settings.json .vscode/tasks.json .vscode/launch.json\n+do\n+\tif test -f $file\n+\tthen\n+\t\tif git diff --no-index --quiet --exit-code $file $file.new\n+\t\tthen\n+\t\t\trm $file.new\n+\t\telse\n+\t\t\tprintf \"The file $file.new has these changes:\\n\\n\"\n+\t\t\tgit --no-pager diff --no-index $file $file.new\n+\t\t\tprintf \"\\n\\nMaybe \\`mv $file.new $file\\`?\\n\\n\"\n+\t\tfi\n+\telse\n+\t\tmv $file.new $file\n+\tfi\n+done\n-- \ngitgitgadget\n\n"},{"id":"353894","messageId":"384b08836390e32e71842d6d547c13500b963d0d.1532965363.git.gitgitgadget@gmail.com","threadId":"48942","inReplyTo":"pull.2.v2.git.gitgitgadget@gmail.com","subject":"[PATCH v2 6/9] vscode: wrap commit messages at column 72 by default","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2018-07-30T15:42:54Z","receivedAt":"2018-07-30T15:42:56Z","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 configuring VS Code as core.editor (via `code --wait`), we really\nwant to adhere to the Git conventions of wrapping commit messages.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n contrib/vscode/init.sh | 4 ++++\n 1 file changed, 4 insertions(+)\n\ndiff --git a/contrib/vscode/init.sh b/contrib/vscode/init.sh\nindex ba9469226..face115e8 100755\n--- a/contrib/vscode/init.sh\n+++ b/contrib/vscode/init.sh\n@@ -17,6 +17,10 @@ cat >.vscode/settings.json.new <<\\EOF ||\n {\n     \"C_Cpp.intelliSenseEngine\": \"Default\",\n     \"C_Cpp.intelliSenseEngineFallback\": \"Disabled\",\n+    \"[git-commit]\": {\n+        \"editor.wordWrap\": \"wordWrapColumn\",\n+        \"editor.wordWrapColumn\": 72\n+    },\n     \"files.associations\": {\n         \"*.h\": \"c\",\n         \"*.c\": \"c\"\n-- \ngitgitgadget\n\n"},{"id":"353895","messageId":"4b95b1e2a3eb3d3c26dc3fdc5cd880792a5f048e.1532965363.git.gitgitgadget@gmail.com","threadId":"48942","inReplyTo":"pull.2.v2.git.gitgitgadget@gmail.com","subject":"[PATCH v2 4/9] mingw: define WIN32 explicitly","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2018-07-30T15:42:51Z","receivedAt":"2018-07-30T15:42:58Z","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 helps VS Code's intellisense to figure out that we want to include\nwindows.h, and that we want to define the minimum target Windows version\nas Windows Vista/2008R2.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n config.mak.uname | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/config.mak.uname b/config.mak.uname\nindex 684fc5bf0..2be2f1981 100644\n--- a/config.mak.uname\n+++ b/config.mak.uname\n@@ -528,7 +528,7 @@ ifneq (,$(findstring MINGW,$(uname_S)))\n \tCOMPAT_OBJS += compat/mingw.o compat/winansi.o \\\n \t\tcompat/win32/pthread.o compat/win32/syslog.o \\\n \t\tcompat/win32/dirent.o\n-\tBASIC_CFLAGS += -DPROTECT_NTFS_DEFAULT=1\n+\tBASIC_CFLAGS += -DWIN32 -DPROTECT_NTFS_DEFAULT=1\n \tEXTLIBS += -lws2_32\n \tGITLIBS += git.res\n \tPTHREAD_LIBS =\n-- \ngitgitgadget\n\n"},{"id":"353898","messageId":"ba78af756bac56d2c4436a1de924fc72e6887a47.1532965363.git.gitgitgadget@gmail.com","threadId":"48942","inReplyTo":"pull.2.v2.git.gitgitgadget@gmail.com","subject":"[PATCH v2 7/9] vscode: use 8-space tabs, no trailing ws, etc for Git's source code","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2018-07-30T15:42:55Z","receivedAt":"2018-07-30T15:42:59Z","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 adds a couple settings for the .c/.h files so that it is easier to\nconform to Git's conventions while editing the source code.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n contrib/vscode/init.sh | 8 ++++++++\n 1 file changed, 8 insertions(+)\n\ndiff --git a/contrib/vscode/init.sh b/contrib/vscode/init.sh\nindex face115e8..29f2a729d 100755\n--- a/contrib/vscode/init.sh\n+++ b/contrib/vscode/init.sh\n@@ -21,6 +21,14 @@ cat >.vscode/settings.json.new <<\\EOF ||\n         \"editor.wordWrap\": \"wordWrapColumn\",\n         \"editor.wordWrapColumn\": 72\n     },\n+    \"[c]\": {\n+        \"editor.detectIndentation\": false,\n+        \"editor.insertSpaces\": false,\n+        \"editor.tabSize\": 8,\n+        \"editor.wordWrap\": \"wordWrapColumn\",\n+        \"editor.wordWrapColumn\": 80,\n+        \"files.trimTrailingWhitespace\": true\n+    },\n     \"files.associations\": {\n         \"*.h\": \"c\",\n         \"*.c\": \"c\"\n-- \ngitgitgadget\n\n"},{"id":"353897","messageId":"358f38d3aa058bb9399f4a8fab71027e2e7a6289.1532965363.git.gitgitgadget@gmail.com","threadId":"48942","inReplyTo":"pull.2.v2.git.gitgitgadget@gmail.com","subject":"[PATCH v2 8/9] vscode: add a dictionary for cSpell","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2018-07-30T15:42:57Z","receivedAt":"2018-07-30T15:43:00Z","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 quite useful cSpell extension allows VS Code to have \"squiggly\"\nlines under spelling mistakes. By default, this would add too much\nclutter, though, because so much of Git's source code uses words that\nwould trigger cSpell.\n\nLet's add a few words to make the spell checking more useful by reducing\nthe number of false positives.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n contrib/vscode/init.sh | 169 ++++++++++++++++++++++++++++++++++++++++-\n 1 file changed, 168 insertions(+), 1 deletion(-)\n\ndiff --git a/contrib/vscode/init.sh b/contrib/vscode/init.sh\nindex 29f2a729d..a134cb4c5 100755\n--- a/contrib/vscode/init.sh\n+++ b/contrib/vscode/init.sh\n@@ -32,7 +32,174 @@ cat >.vscode/settings.json.new <<\\EOF ||\n     \"files.associations\": {\n         \"*.h\": \"c\",\n         \"*.c\": \"c\"\n-    }\n+    },\n+    \"cSpell.words\": [\n+        \"DATAW\",\n+        \"DBCACHED\",\n+        \"DFCHECK\",\n+        \"DTYPE\",\n+        \"Hamano\",\n+        \"HCAST\",\n+        \"HEXSZ\",\n+        \"HKEY\",\n+        \"HKLM\",\n+        \"IFGITLINK\",\n+        \"IFINVALID\",\n+        \"ISBROKEN\",\n+        \"ISGITLINK\",\n+        \"ISSYMREF\",\n+        \"Junio\",\n+        \"LPDWORD\",\n+        \"LPPROC\",\n+        \"LPWSTR\",\n+        \"MSVCRT\",\n+        \"NOARG\",\n+        \"NOCOMPLETE\",\n+        \"NOINHERIT\",\n+        \"RENORMALIZE\",\n+        \"STARTF\",\n+        \"STARTUPINFOEXW\",\n+        \"Schindelin\",\n+        \"UCRT\",\n+        \"YESNO\",\n+        \"argcp\",\n+        \"beginthreadex\",\n+        \"committish\",\n+        \"contentp\",\n+        \"cpath\",\n+        \"cpidx\",\n+        \"ctim\",\n+        \"dequote\",\n+        \"envw\",\n+        \"ewah\",\n+        \"fdata\",\n+        \"fherr\",\n+        \"fhin\",\n+        \"fhout\",\n+        \"fragp\",\n+        \"fsmonitor\",\n+        \"hnsec\",\n+        \"idents\",\n+        \"includeif\",\n+        \"interpr\",\n+        \"iprog\",\n+        \"isexe\",\n+        \"iskeychar\",\n+        \"kompare\",\n+        \"mksnpath\",\n+        \"mktag\",\n+        \"mktree\",\n+        \"mmblob\",\n+        \"mmbuffer\",\n+        \"mmfile\",\n+        \"noenv\",\n+        \"nparents\",\n+        \"ntpath\",\n+        \"ondisk\",\n+        \"ooid\",\n+        \"oplen\",\n+        \"osdl\",\n+        \"pnew\",\n+        \"pold\",\n+        \"ppinfo\",\n+        \"pushf\",\n+        \"pushv\",\n+        \"rawsz\",\n+        \"rebasing\",\n+        \"reencode\",\n+        \"repo\",\n+        \"rerere\",\n+        \"scld\",\n+        \"sharedrepo\",\n+        \"spawnv\",\n+        \"spawnve\",\n+        \"spawnvpe\",\n+        \"strdup'ing\",\n+        \"submodule\",\n+        \"submodules\",\n+        \"topath\",\n+        \"topo\",\n+        \"tpatch\",\n+        \"unexecutable\",\n+        \"unhide\",\n+        \"unkc\",\n+        \"unkv\",\n+        \"unmark\",\n+        \"unmatch\",\n+        \"unsets\",\n+        \"unshown\",\n+        \"untracked\",\n+        \"untrackedcache\",\n+        \"unuse\",\n+        \"upos\",\n+        \"uval\",\n+        \"vreportf\",\n+        \"wargs\",\n+        \"wargv\",\n+        \"wbuffer\",\n+        \"wcmd\",\n+        \"wcsnicmp\",\n+        \"wcstoutfdup\",\n+        \"wdeltaenv\",\n+        \"wdir\",\n+        \"wenv\",\n+        \"wenvblk\",\n+        \"wenvcmp\",\n+        \"wenviron\",\n+        \"wenvpos\",\n+        \"wenvsz\",\n+        \"wfile\",\n+        \"wfilename\",\n+        \"wfopen\",\n+        \"wfreopen\",\n+        \"wfullpath\",\n+        \"which'll\",\n+        \"wlink\",\n+        \"wmain\",\n+        \"wmkdir\",\n+        \"wmktemp\",\n+        \"wnewpath\",\n+        \"wotype\",\n+        \"wpath\",\n+        \"wpathname\",\n+        \"wpgmptr\",\n+        \"wpnew\",\n+        \"wpointer\",\n+        \"wpold\",\n+        \"wpos\",\n+        \"wputenv\",\n+        \"wrmdir\",\n+        \"wship\",\n+        \"wtarget\",\n+        \"wtemplate\",\n+        \"wunlink\",\n+        \"xcalloc\",\n+        \"xgetcwd\",\n+        \"xmallocz\",\n+        \"xmemdupz\",\n+        \"xmmap\",\n+        \"xopts\",\n+        \"xrealloc\",\n+        \"xsnprintf\",\n+        \"xutftowcs\",\n+        \"xutftowcsn\",\n+        \"xwcstoutf\"\n+    ],\n+    \"cSpell.ignoreRegExpList\": [\n+        \"\\\\\\\"(DIRC|FSMN|REUC|UNTR)\\\\\\\"\",\n+        \"\\\\\\\\u[0-9a-fA-Fx]{4}\\\\b\",\n+        \"\\\\b(filfre|frotz|xyzzy)\\\\b\",\n+        \"\\\\bCMIT_FMT_DEFAULT\\\\b\",\n+        \"\\\\bde-munge\\\\b\",\n+        \"\\\\bGET_OID_DISAMBIGUATORS\\\\b\",\n+        \"\\\\bHASH_RENORMALIZE\\\\b\",\n+        \"\\\\bTREESAMEness\\\\b\",\n+        \"\\\\bUSE_STDEV\\\\b\",\n+        \"\\\\Wchar *\\\\*\\\\W*utfs\\\\W\",\n+        \"cURL's\",\n+        \"nedmalloc'ed\",\n+        \"ntifs\\\\.h\",\n+    ],\n }\n EOF\n die \"Could not write settings.json\"\n-- \ngitgitgadget\n\n"},{"id":"353896","messageId":"b9c628b8812abb265c4f48f846dc3d3e170649e6.1532965363.git.gitgitgadget@gmail.com","threadId":"48942","inReplyTo":"pull.2.v2.git.gitgitgadget@gmail.com","subject":"[PATCH v2 9/9] vscode: let cSpell work on commit messages, too","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2018-07-30T15:42:58Z","receivedAt":"2018-07-30T15:43:01Z","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\nBy default, the cSpell extension ignores all files under .git/. That\nincludes, unfortunately, COMMIT_EDITMSG, i.e. commit messages. However,\nspell checking is *quite* useful when writing commit messages... And\nsince the user hardly ever opens any file inside .git (apart from commit\nmessages, the config, and sometimes interactive rebase's todo lists),\nthere is really not much harm in *not* ignoring .git/.\n\nThe default also ignores `node_modules/`, but that does not apply to\nGit, so let's skip ignoring that, too.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n contrib/vscode/init.sh | 2 ++\n 1 file changed, 2 insertions(+)\n\ndiff --git a/contrib/vscode/init.sh b/contrib/vscode/init.sh\nindex a134cb4c5..27de94994 100755\n--- a/contrib/vscode/init.sh\n+++ b/contrib/vscode/init.sh\n@@ -33,6 +33,8 @@ cat >.vscode/settings.json.new <<\\EOF ||\n         \"*.h\": \"c\",\n         \"*.c\": \"c\"\n     },\n+    \"cSpell.ignorePaths\": [\n+    ],\n     \"cSpell.words\": [\n         \"DATAW\",\n         \"DBCACHED\",\n-- \ngitgitgadget\n"}]}