-
Notifications
You must be signed in to change notification settings - Fork 154
Improve cherry-pick #216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve cherry-pick #216
Conversation
The gcp (git cherry pick) command was the only command which did not have a variable to set command-specific fzf options. Add the according variable to source code and documentation.
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.
The output of 'git cherry' which is used to build the fzf input list for forgit::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.
|
Love the improvements, just want to understand if we can replicate what |
|
How about |
|
@carlfriedrich Unfortunately gnu ❯ seq 10 | tail -r
tail: invalid option -- 'r'
Try 'tail --help' for more information. |
8e67971 to
929bee4
Compare
Git log displays the newest commits on top of the list, while git cherry pick displays the newest commits at the bottom. Reverse the order of git cherry pick so that it has the same order like git log.
929bee4 to
fe5c4d9
Compare
|
Hi @cjappl and @wfxr, thanks for your feedback. I have replaced The alternative would be using |
|
Looks reasonable enough to me! will leave it to @wfxr to approve officially. Thanks for the adjustment |
wfxr
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@carlfriedrich LGTM.
Thank you!
This PR improves
gcp(cherry-pick) with the following features:Add FORGIT_CHERRY_PICK_FZF_OPTS
The
gcpcommand was the only command which did not have a variable to set command-specificfzfoptions. Add the according variable to source code and documentation.Preserve commit order on cherry pick
When using a
fzffind string which maches multiple lines, the commits could appear in a wrong order. Add--tiebreak=indexto ensure that the correct commit order is preserved.Preserve +/- information on cherry pick
The output of
git cherrywhich is used to build thefzfinput list forforgit::cherry::pickusually 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
glodisplays the newest commits on top of the list, whilegcpdisplays the newest commits at the bottom. Reverse the order ofgcpso that it has the same order likeglo.Check list
Description
Type of change
Test environment