)]}'
{
  "commit": "4478ad37a7d233b8db4d46dd563ece0bc8b00af4",
  "tree": "6f85994bf02463151dfd35f4dfdf82ad7313017f",
  "parents": [
    "e969bc875963a10890d61ba84eab3a460bd9e535"
  ],
  "author": {
    "name": "Johannes Schindelin",
    "email": "johannes.schindelin@gmx.de",
    "time": "Thu Mar 06 10:26:18 2025 +0000"
  },
  "committer": {
    "name": "Junio C Hamano",
    "email": "gitster@pobox.com",
    "time": "Thu Mar 06 08:35:07 2025 -0800"
  },
  "message": "ident: stop assuming that `gw_gecos` is writable\n\nIn 590e081dea7c (ident: add NO_GECOS_IN_PWENT for systems without\npw_gecos in struct passwd, 2011-05-19), code was introduced to iterate\nover the `gw_gecos` field; The loop variable is of type `char *`, which\nassumes that `gw_gecos` is writable.\n\nHowever, it is not necessarily writable (and it is a bad idea to have it\nwritable in the first place), so let\u0027s switch the loop variable type to\n`const char *`.\n\nThis is not a new problem, but what is new is the Meson build. While it\ndoes not trigger in CI builds, imitating the commands of\n`ci/run-build-and-tests.sh` in a regular Git for Windows SDK (`meson\nsetup build . --fatal-meson-warnings --warnlevel 2 --werror --wrap-mode\nnofallback -Dfuzzers\u003dtrue` followed by `meson compile -C build --`\nresults in this beautiful error:\n\n  \"cc\" [...] -o libgit.a.p/ident.c.obj \"-c\" ../ident.c\n  ../ident.c: In function \u0027copy_gecos\u0027:\n  ../ident.c:68:18: error: assignment discards \u0027const\u0027 qualifier from pointer target type [-Werror\u003ddiscarded-qualifiers]\n     68 |         for (src \u003d get_gecos(w); *src \u0026\u0026 *src !\u003d \u0027,\u0027; src++) {\n        |                  ^\n  cc1.exe: all warnings being treated as errors\n\nNow, why does this not trigger in CI? The answer is as simple as it is\npuzzling: The `win+Meson` job completely side-steps Git for Windows\u0027\ndevelopment environment, opting instead to use the GCC that is on the\n`PATH` in GitHub-hosted `windows-latest` runners. That GCC is pinned to\nv12.2.0 and targets the UCRT (unlikely to change any time soon, see\nhttps://github.com/actions/runner-images/blob/win25/20250303.1/images/windows/toolsets/toolset-2022.json#L132-L141).\nThat is in stark contrast to Git for Windows, which uses GCC v14.2.0 and\ntargets MSVCRT. Git for Windows\u0027 `Makefile`-based build also obviously\nuses different compiler flags, otherwise this compile error would have\nhad plenty of opportunity in almost 14 years to surface.\n\nIn other words, contrary to my expectations, the `win+Meson` job is\nill-equipped to replace the `win build` job because it exercises a\ncompletely different tool version/compiler flags vector than what Git\nfor Windows needs.\n\nNevertheless, there is currently this huge push, including breaking\nchanges after -rc1 and all, for switching to Meson. Therefore, we need\nto make it work, somehow, even in Git for Windows\u0027 SDK, hence this\npatch, at this point in time.\n\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": "caf41fb2a98f56400764d87244635fd21750c13c",
      "old_mode": 33188,
      "old_path": "ident.c",
      "new_id": "967895d885033da5393a9c0c0c52d51531a64867",
      "new_mode": 33188,
      "new_path": "ident.c"
    }
  ]
}
