)]}'
{
  "commit": "4b1b7a4e95af51c87e023fd96d9da0d4719e33bd",
  "tree": "8dce6344964b0ba8e878b2662340de5988b7d1d1",
  "parents": [
    "a039ee6757c19b7f341e9796564ea7c93faca6b5"
  ],
  "author": {
    "name": "Junio C Hamano",
    "email": "gitster@pobox.com",
    "time": "Wed Aug 12 09:25:50 2026 -0700"
  },
  "committer": {
    "name": "Junio C Hamano",
    "email": "gitster@pobox.com",
    "time": "Wed Aug 12 10:14:42 2026 -0700"
  },
  "message": "completion: complete tracked paths for \u0027git diff\u0027\n\nWhen completing arguments for \u0027git diff\u0027, _git_diff() delegates to\n__git_complete_revlist_file(), which only completes revision\nreferences.  This is good [*], as mixing both revisions and paths in a\nsingle list for the user to pick from is simply too confusing.\n\nIf no reference matches, or if \u0027--\u0027 is given, however, _git_diff()\nleaves COMPREPLY empty.  Bash then falls back to default filename\ncompletion in $PWD.  This fails when \u0027git -C \u003cpath\u003e\u0027 is used because\n$PWD is not the target repository.\n\nUpdate _git_diff() to use __git_complete_index_file() when \u0027--\u0027 is\npresent, or when revision reference completion yields no matching\ncandidates, so that tracked paths are offered as candidates.\n\nThis changes behavior even in the case where \u0027-C \u003cthere\u003e\u0027 is not\nused.  The new behavior omits untracked paths from suggestions when\nno revs match the prefix but matching tracked paths exist, which is\nmore useful in the context of \u0027git diff\u0027.\n\nWhen run outside the working tree of a repository, or when nothing\nmatches from revisions or tracked paths, Bash still falls back to\ndefault filename completion in $PWD, so such a use case would be\njust like completing paths for any \u0027diff\u0027 command, rather than for\n\u0027git diff\u0027.\n\n[Footnote]\n * In https://lore.kernel.org/git/al%2Fw2qgBfhe9qMg6@szeder.dev/\n   SZEDER made the same argument for \"git send-email 0\u003cTAB\u003e\".\n\nSigned-off-by: Junio C Hamano \u003cgitster@pobox.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "a61b6ed59a2a9de4c4b1d35f9238588b72fea3f2",
      "old_mode": 33188,
      "old_path": "contrib/completion/git-completion.bash",
      "new_id": "76181e8714aa896586cbbf4722e5a40596be15e9",
      "new_mode": 33188,
      "new_path": "contrib/completion/git-completion.bash"
    },
    {
      "type": "modify",
      "old_id": "55dc9eabfc42fe6f95dd9362d2e602221682dc07",
      "old_mode": 33261,
      "old_path": "t/t9902-completion.sh",
      "new_id": "32e5d484c714b1fcc6c1758754b2220ef93b96ed",
      "new_mode": 33261,
      "new_path": "t/t9902-completion.sh"
    }
  ]
}
