gitgitk

gitk do not show the diff anymore. (Local changes checked in to index but not committed)


I can use the gitk tool to view the current changes that have do not committed yet.

But when I update the git from 2.29.2.windows.3 to 2.33.0.windows.2

diff is gone. only show

Local changes checked in to index but not committed

enter image description here


I don't know what happened. I tried to read the release note but couldn't find the answer.


I'm not sure if this is related to the following changes

last commit: 2020/09/11: gitk: replace tabs tith spaces


I don't want to use any replacement tools (like using git gui to view changes); I want gitk to work as well as it used to.


Solution

  • As j6t noted in a comment, this is a bug in the current versions of Git, scheduled to be fixed in an upcoming release.

    Technically, the issue has to do with gitk using the --cc option every time. This used to work for git diff-index, with the --cc being ignored when the index is not in conflicted state, and the --cc producing a combined diff when the index is in a conflicted state (i.e., when you have an unresolved merge). Now git diff-index --cc produces an error message and quits, and gitk thinks that this means there are no unstaged changes.

    (The --cc option to git diff-index was never documented and was accidentally removed, instead of becoming documented. This shows why it's dangerous to depend on undocumented behavior: you can't tell if it was intended. It probably was, in this case, but the person who improved git diff handling for merges didn't know this.)