wfxr / forgit

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

Preview a single file diff #242

Closed nkh closed 1 year ago

nkh commented 1 year ago

Check list

Environment info

Problem / Steps to reproduce

running fgl -- some/file displays all the commit where some/file was somewhat involved. git log -p some/file displays the diff for that file only but fgl -p some/file puts the diff in the list of commit rather than showing only that file's diff.

carlfriedrich commented 1 year ago

I can reproduce this:

grafik

If fgl -- some/file works, though, why do you need fgl -p some/file to work?

I'm not sure if we actually support optional git command line arguments on forgit. @wfxr @cjappl Do we?

wfxr commented 1 year ago

@carlfriedrich We don't fully support this. forgit::log only accept files to filter commits.

https://github.com/wfxr/forgit/blob/2872548075e63bc83a0b960e2813b16571998563/forgit.plugin.zsh#L37-L42

nkh commented 1 year ago

@carlfriedrich I'd need it so i can go from one commit to the other and see the diff for just that commit

carlfriedrich commented 1 year ago

@nkh But that already works with fgl -- some/file as you said?

nkh commented 1 year ago

it was part of a script that used git options, now I have the answer, I'll see if it can be changed.