)]}'
{
  "commit": "a644ad5f34d95efee08f0b9d18f0b760ed6dc967",
  "tree": "ab97d9c8544f2141e52cdbcbb82317b491860bf8",
  "parents": [
    "6b6d1d56eb21ef4e0c835864cb7280a1509f0c7c"
  ],
  "author": {
    "name": "Mihai Cosma",
    "email": "mcosma@gmail.com",
    "time": "Thu Oct 22 14:44:20 2026 -0400"
  },
  "committer": {
    "name": "Junio C Hamano",
    "email": "gitster@pobox.com",
    "time": "Fri Oct 23 15:14:29 2026 -0700"
  },
  "message": "status: lock the index only to write it\n\nEditors and shell prompts run \"git status\" in the background. Status\ntakes index.lock before collecting and holds it to the end, even when\nit writes nothing, so a \"git add\" or \"git commit\" run meanwhile fails\nwith \"index.lock: File exists\".\n\nThe lock does not need to cover the collection, because\nrepo_update_index_if_able() refuses to write an index that changed\nsince status read it. 226c051adb (status: enable untracked cache,\n2015-03-08) moved the write after wt_status_collect() to save the\nuntracked cache, but left the lock where it was.\n\nAdd repo_lock_and_update_index_if_able(), which takes the lock only if\nthe index has something to write, and call it after collecting. When\nthere is nothing to write, status no longer creates index.lock; when\nthere is, it holds the lock only for the write. In a clean gcc checkout\nwith status running in a loop, 104 of 200 \"git add\" runs failed before\nand none after.\n\nAssisted-by: Claude Opus 5.5, Gemini 4 Argon\nSigned-off-by: Mihai Cosma \u003cmcosma@gmail.com\u003e\nSigned-off-by: Junio C Hamano \u003cgitster@pobox.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "8ffd42681bba842435aa035b41b04159657cb25a",
      "old_mode": 33188,
      "old_path": "builtin/commit.c",
      "new_id": "36e47e18ed2640ced8340395f535e243c85de7dd",
      "new_mode": 33188,
      "new_path": "builtin/commit.c"
    },
    {
      "type": "modify",
      "old_id": "58bae677b852ce8f0d7d88ce362c46aceb0a6abc",
      "old_mode": 33188,
      "old_path": "read-cache.c",
      "new_id": "1d2b97c429748b610beebc6a8372c83df2e7a686",
      "new_mode": 33188,
      "new_path": "read-cache.c"
    },
    {
      "type": "modify",
      "old_id": "91b1f57db7b3bc5701bd5a3977f15a445521c22d",
      "old_mode": 33188,
      "old_path": "repository.h",
      "new_id": "54d28a21088a9235e0c0ed4a89fd4a7df9262d4f",
      "new_mode": 33188,
      "new_path": "repository.h"
    },
    {
      "type": "modify",
      "old_id": "c045a651f880b28c0c0a1a0ab38a49e1daaf82f9",
      "old_mode": 33261,
      "old_path": "t/t7508-status.sh",
      "new_id": "e10c961268c4964845903502b9809500402bc7b9",
      "new_mode": 33261,
      "new_path": "t/t7508-status.sh"
    }
  ]
}
