jesseduffield.lazygit/pkg/commands
Stefan Haller 0f7f1a56df Fix showing diffs for renamed file when filtering by path
When filtering for a file path we use the --follow option for "git log", so it
will follow renames of the file, which is great. However, if you then selected
one of the commits before a rename, you didn't see a diff, because we would pass
the original filter path to the "git show" call.

To fix this, call git log with the --name-status option when filtering by path,
so that each commit reports which file paths are touched in this commit;
remember these in the commit object, so that we can pass them to the "git show"
call later.

Be careful not to store too many such paths unnecessarily. When filtering by
folder rather than file, all these paths will necessarily be inside the original
filter path, so detect this and don't store them in this case.

There is some unfortunate code duplication between loading commits and loading
reflog commits, which I am too lazy to clean up right now.
2025-07-27 12:05:41 +02:00
..
git_commands Fix showing diffs for renamed file when filtering by path 2025-07-27 12:05:41 +02:00
git_config Enable errorlint linter, and fix warnings 2025-06-30 18:30:11 +02:00
hosting_service Enable revive linter, and fix a bunch of warnings 2025-06-30 19:13:20 +02:00
models Fix showing diffs for renamed file when filtering by path 2025-07-27 12:05:41 +02:00
oscommands Remove deprecated edit configs 2025-07-08 16:32:21 +02:00
patch Move to next stageable line after adding a line to a custom patch 2025-07-04 10:14:35 +02:00
testdata Support opening lazygit in a submodule 2019-05-12 17:59:49 +10:00
git.go Use WorkingTreeState instead of RebaseMode in CommitLoader 2025-04-20 15:53:17 +02:00
git_cmd_obj_builder.go Remove ICmdObj interface 2025-05-01 15:21:37 +02:00
git_cmd_obj_runner.go Enable intrange linter, and fix warnings 2025-06-30 18:30:11 +02:00