Closed carlfriedrich closed 1 year ago
Love the improvements, just want to understand if we can replicate what tac
does in a command that is available on both linux and mac!
How about tail -r
instead? Seems to work on my machine.
$ echo "hi
hello
world" | tail -r
world
hello
hi
$ echo "hi
hello
world" | /bin/cat
hi
hello
world
@carlfriedrich Unfortunately gnu tail
(on linux) doesn't support -r
option.
❯ seq 10 | tail -r
tail: invalid option -- 'r'
Try 'tail --help' for more information.
Hi @cjappl and @wfxr, thanks for your feedback. I have replaced tac
with a combination of tac
and tail -r
, like proposed in this StackOverflow answer. Tested with bash and fish. Are you okay with that?
The alternative would be using sed
or awk
, but both would be significantly slower, which might make a difference on huge repos.
Looks reasonable enough to me! will leave it to @wfxr to approve officially. Thanks for the adjustment
This PR improves
gcp
(cherry-pick) with the following features:Add FORGIT_CHERRY_PICK_FZF_OPTS The
gcp
command was the only command which did not have a variable to set command-specificfzf
options. Add the according variable to source code and documentation.Preserve commit order on cherry pick When using a
fzf
find string which maches multiple lines, the commits could appear in a wrong order. Add--tiebreak=index
to ensure that the correct commit order is preserved.Preserve +/- information on cherry pick The output of
git cherry
which is used to build thefzf
input list forforgit::cherry::pick
usually prefixes every line with a '-' for commits that have an equivalent in the target branch, and a '+' for commits that do not. Previously forgit removed this information from the list. However, for the actual cherry-picking process this information is relevant, so we should keep it.Reverse order on cherry pick
glo
displays the newest commits on top of the list, whilegcp
displays the newest commits at the bottom. Reverse the order ofgcp
so that it has the same order likeglo
.Check list
Description
Type of change
Test environment