jesseduffield / jesseduffield/lazygit

Filter by path doesn't show diff for moved files

Open
#2,141 3 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Go
Stars
82.4k
Forks
3k
Avg merge
2d 18h
Merged PRs (30d)
19

Description

**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](https://user-images.githubusercontent.com/8898684/187177209-18b8c085-97e2-444e-97c2-02bc7637ba54.png)

Initial commit with **empty diff** on the right side
![image](https://user-images.githubusercontent.com/8898684/187177435-e8887045-9ab0-4e4b-b352-e6060a6720e1.png)

But if we open our initial commit we can see the diff correctly
![image](https://user-images.githubusercontent.com/8898684/187177815-878bdd24-b743-4bbc-a35d-c2a4b440e48f.png)

**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 (:

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.