lazygit icon indicating copy to clipboard operation
lazygit copied to clipboard

Filter by path doesn't show diff for moved files

Open all500234765 opened this issue 3 years ago • 3 comments

Describe the bug Filter by path doesn't show diff for moved files in quick view (Patch) window.

To Reproduce Steps to reproduce the behavior:

  1. Make a folder A with some file named B.txt inside
  2. Commit both of them
  3. Rename folder 'A' to 'Folder A'
  4. Commit all changes
  5. Go to 'Commits' section
  6. Press Ctrl + S, then Enter
  7. Type B.txt, press Tab, then Enter
  8. Select first commit and you won't see any changes

Expected behavior All commits showing correct diffs for moved files too

Screenshots

Latest commit where we renamed folder image

Initial commit with empty diff on the right side image

But if we open our initial commit we can see the diff correctly image

Version info: Run lazygit --version and paste the result here commit=367b0d331836c90c015bf0c45f88612f3d94d08a, build date=2022-07-20T09:27:56Z, build source=binaryRelease, version=0.35, os=windows, arch=amd64

Run git --version and paste the result here git version 2.23.0.windows.1

Additional context This issue arises quite often for me, as in our code base big chunks of files can be moved to address some issues. My pet project has same issue as opening each commit is not really pleasable thing want to do (:

all500234765 avatar Aug 29 '22 13:08 all500234765

You need to enter a path relative to the Git root directory in filter by path. If nothing is displayed, it is because <root>/B.txt does not exist.

Ryooooooga avatar Aug 30 '22 02:08 Ryooooooga

You need to enter a path relative to the Git root directory in filter by path. If nothing is displayed, it is because <root>/B.txt does not exist.

Yes, that happens because <root>/Folder A/B.txt was previously in <root>/A/B.txt.

p.s. Fixed description a little, since I forgot to fill expected behavior

all500234765 avatar Aug 30 '22 18:08 all500234765

Sorry for the commotion, not used to github's issue commenting system

all500234765 avatar Aug 30 '22 18:08 all500234765