wfxr / forgit

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

Fix broken _forgit_cherry_pick #286

Closed sandr01d closed 1 year ago

sandr01d commented 1 year ago

Check list

Description

I noticed that cherry-picking was broken for me, git always gave me the error message fatal: bad revision ''. The issue seems to be with the cut -d' ' -f2 command which removes all the commit ids (at least for me). I've refactored the code to use the read commands internal field separation instead. Would be especially courious to know if this works fine on your environment @cjappl, since you implemented the original functionality and I guess there might be some incompatibility between macOS and Linux at play here.

Type of change

Test environment

cjappl commented 1 year ago

Works for me! Thanks for cleaning up my trash.

Will also request a review from @carlfriedrich in case he has time, if not I will merge it next week after I have some time to play with it

wfxr commented 1 year ago

Hi @sandr01d, I tested this patch on linux and found the same error message displayed:

❯ gcp
fatal: bad revision ''
sandr01d commented 1 year ago

Hi @sandr01d, I tested this patch on linux and found the same error message displayed:

❯ gcp
fatal: bad revision ''

That's odd, I'm on Linux too and it works fine for me. Does this only happen for you with my patch or also without it? Also, does this happen regardless of the commit you pick or only on specific ones?

carlfriedrich commented 1 year ago

@sandr01d @wfxr I have created another PR #294 which should also cover this error. Can you check?

sandr01d commented 1 year ago

Closing in favor of #294