wfxr / forgit

:zzz: A utility tool powered by fzf for using git interactively.
MIT License
4.4k stars 137 forks source link

Improve forgit diff #189

Closed carlfriedrich closed 2 years ago

carlfriedrich commented 2 years ago

Check list

Description

Fix two bugs in forgit::diff:

Type of change

Test environment

wfxr commented 2 years ago

LGTM! @carlfriedrich Thanks for your contribution!

cjappl commented 2 years ago

@carlfriedrich Will you post an example with screenshots of how #188 is supposed to work? Trying to move all this functionality over to fish, and I can't seem to get it to work.

What I'm looking for is something like:

git mv README.md README2.md
gd

and posting some screenshots of how it looks on your side? Just want a nice reproducible target to aim for!

cjappl commented 2 years ago

@carlfriedrich Will you post an example with screenshots of how #188 is supposed to work? Trying to move all this functionality over to fish, and I can't seem to get it to work.

What I'm looking for is something like:

git mv README.md README2.md
gd

and posting some screenshots of how it looks on your side? Just want a nice reproducible target to aim for!

carlfriedrich commented 2 years ago

@cjappl Sure, see the minimal example from the the description of #188:

mkdir myrepo
cd myrepo
git init
echo "wow" > foo.txt
git add foo.txt
git commit -m "Commit 1"
git mv foo.txt bar.txt
echo "oh" > baz.txt
git add baz.txt

Calling gd --staged on this repo showed the following before:

grafik

Notice the empty preview window and the wrongly displayed first line of the file list (state not in brackets, two filenames without context).

With #188 merged the preview window works again with the diff showing the rename (this is with diff-so-fancy installed) and the file list displays the corresponding entry correctly:

grafik

cjappl commented 2 years ago

Beautiful!! Thanks for your contribution and this description, very helpful!!