)]}'
{
  "commit": "caa5d9eab2b7bf62bfe6196c4c0354f82ab808d7",
  "tree": "2a031b605332f4f7092cdc4d380f97274fc4f9d7",
  "parents": [
    "7904764e294334fdac0bfd2f797b0dac0423da93"
  ],
  "author": {
    "name": "Johannes Schindelin",
    "email": "johannes.schindelin@gmx.de",
    "time": "Thu Sep 10 06:05:26 2026 +0000"
  },
  "committer": {
    "name": "Junio C Hamano",
    "email": "gitster@pobox.com",
    "time": "Thu Sep 10 05:19:43 2026 -0700"
  },
  "message": "mingw: allow `git.exe` to be used instead of the \"Git wrapper\"\n\nGit for Windows wants to add `git.exe` to the users\u0027 `PATH`, without\ncluttering the latter with unnecessary executables such as `wish.exe`.\nTo that end, it invented the concept of its \"Git wrapper\", i.e. a tiny\nexecutable located in `C:\\Program Files\\Git\\cmd\\git.exe` (originally a\nCMD script) whose sole purpose is to set up a couple of environment\nvariables and then spawn the _actual_ `git.exe` (which nowadays lives in\n`C:\\Program Files\\Git\\mingw64\\bin\\git.exe` for 64-bit, and the obvious\nequivalent for 32-bit installations).\n\nCurrently, the following environment variables are set unless already\ninitialized:\n\n- `MSYSTEM`, to make sure that the MSYS2 Bash and the MSYS2 Perl\n  interpreter behave as expected, and\n\n- `PLINK_PROTOCOL`, to force PuTTY\u0027s `plink.exe` to use the SSH\n  protocol instead of Telnet,\n\n- `PATH`, to make sure that the `bin` folder in the user\u0027s home\n  directory, as well as the `/mingw64/bin` and the `/usr/bin`\n  directories are included. The trick here is that the `/mingw64/bin/`\n  and `/usr/bin/` directories are relative to the top-level installation\n  directory of Git for Windows (which the included Bash interprets as\n  `/`, i.e. as the MSYS pseudo root directory).\n\nUsing the absence of `MSYSTEM` as a tell-tale, we can detect in\n`git.exe` whether these environment variables have been initialized\nproperly. Therefore we can call `C:\\Program Files\\Git\\mingw64\\bin\\git`\nin-place after this change, without having to call Git through the Git\nwrapper.\n\nObviously, above-mentioned directories must be _prepended_ to the `PATH`\nvariable, otherwise we risk picking up executables from unrelated Git\ninstallations. We do that by constructing the new `PATH` value from\nscratch, appending `$HOME/bin` (if `HOME` is set), then the MSYS2 system\ndirectories, and then appending the original `PATH`.\n\nSide note: this modification of the `PATH` variable is independent of\nthe modification necessary to reach the executables and scripts in\n`/mingw64/libexec/git-core/`, i.e. the `GIT_EXEC_PATH`. That\nmodification is still performed by Git, elsewhere, long after making the\nchanges described above.\n\nWhile we _still_ cannot simply hard-link `mingw64\\bin\\git.exe` to `cmd`\n(because the former depends on a couple of `.dll` files that are only in\n`mingw64\\bin`, i.e. calling `...\\cmd\\git.exe` would fail to load due to\nmissing dependencies), at least we can now avoid that extra process of\nrunning the Git wrapper (which then has to wait for the spawned\n`git.exe` to finish) by calling `...\\mingw64\\bin\\git.exe` directly, via\nits absolute path.\n\nTesting this is in Git\u0027s test suite tricky: we set up a \"new\" MSYS\npseudo-root and copy the `git.exe` file into the appropriate location,\nthen verify that `MSYSTEM` is set properly, and also that the `PATH` is\nmodified so that scripts can be found in `$HOME/bin`, `/mingw64/bin/`\nand `/usr/bin/`.\n\nThis addresses https://github.com/git-for-windows/git/issues/2283\n\nNote: This keeps the same, hard-coded MSYSTEM platform support for CMake\nas before, and introduces an `msystem\u0027 and `mingw-prefix` knob for Meson\n(read: neither CMake nor Meson will automatically inherit the setting\nfrom the current build environment).\n\nHelped-by: Johannes Sixt \u003cj6t@kdbg.org\u003e\nSigned-off-by: Johannes Schindelin \u003cjohannes.schindelin@gmx.de\u003e\nSigned-off-by: Junio C Hamano \u003cgitster@pobox.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "afdc1ef2db637168dfb07a98b3c34594678c8b34",
      "old_mode": 33188,
      "old_path": "compat/mingw.c",
      "new_id": "563e6299bc30c2f8da9195724a5415c8677928e1",
      "new_mode": 33188,
      "new_path": "compat/mingw.c"
    },
    {
      "type": "modify",
      "old_id": "2f7d445eb3dda6c3020cc56d2883d4580d65ae91",
      "old_mode": 33188,
      "old_path": "config.mak.uname",
      "new_id": "0b63be10b7782ee19a6c5bce1f05876d16225949",
      "new_mode": 33188,
      "new_path": "config.mak.uname"
    },
    {
      "type": "modify",
      "old_id": "a57c4b464fa456e7eeef8a47538eb490495e1d32",
      "old_mode": 33188,
      "old_path": "contrib/buildsystems/CMakeLists.txt",
      "new_id": "7285bd9ac2c890305416fa4ad0132f7570cb7b12",
      "new_mode": 33188,
      "new_path": "contrib/buildsystems/CMakeLists.txt"
    },
    {
      "type": "modify",
      "old_id": "7073d5844d25318e8e3bab43e90381312b0c9f3f",
      "old_mode": 33188,
      "old_path": "meson.build",
      "new_id": "a8aba81e29b4e0f47741d01f001f33c002bd94bf",
      "new_mode": 33188,
      "new_path": "meson.build"
    },
    {
      "type": "modify",
      "old_id": "dc88f130d754a1a0951b7a663927c797eb2accf5",
      "old_mode": 33188,
      "old_path": "meson_options.txt",
      "new_id": "becf4689bf63b111b62a88a1dafb41ade0384582",
      "new_mode": 33188,
      "new_path": "meson_options.txt"
    },
    {
      "type": "modify",
      "old_id": "8545cdfab559b4e247cb2699965e637529fd930a",
      "old_mode": 33261,
      "old_path": "t/t0060-path-utils.sh",
      "new_id": "02906055d390a581c4c12b7a6e61bbdd9c8cd308",
      "new_mode": 33261,
      "new_path": "t/t0060-path-utils.sh"
    }
  ]
}
