Closed carlfriedrich closed 1 year ago
And another fix for git-forgit
. @wren I am quite sure that this is an undeliberate bug, can you please confirm?
@carlfriedrich The current code replaces the first underscore with ::
to match the function names. This doesn't count forgit::
, though (since that's hardcoded). So, forgit::stash:show
and forgit::reset::head
should both already work (I have ss = forgit stash_show
as an alias in my own config).
When git-forgit
was merged, there weren't any functions that had more than that many colons, so it covered all the use cases at the time (but was admittedly not very future-proof).
The only function I see now that has more colons is forgit::cherry::pick::from::branch
(which looks to have been merged afterward). So, this fix should work to update git-forgit
to work with newer functions like forgit::cherry::pick::from::branch
.
Good find!
The only function I see now that has more colons is
forgit::cherry::pick::from::branch
(which looks to have been merged afterward). So, this fix should work to updategit-forgit
to work with newer functions likeforgit::cherry::pick::from::branch
.
@wren You're totally right. I actually even noticed the error on forgit::cherry::pick::from::branch
, but then I just chose different functions for the bug report without checking those, forgetting about the hard-coded forgit::
extraction.
Thanks for your quick reply!
From the standalone forgit command we call the according forgit function by replacing a
_
with::
. Since we have more complex function names likeforgit::cherry::pick::from::branch
we have to replace ALL instances of_
instead of just the first one.Check list
Description
Type of change
Test environment