Merged
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.
cjappl
reviewed
Jul 12, 2022
Collaborator
|
Love the improvements, just want to understand if we can replicate what |
Collaborator
|
How about |
Owner
|
@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
Collaborator
Author
|
Hi @cjappl and @wfxr, thanks for your feedback. I have replaced The alternative would be using |
Collaborator
|
Looks reasonable enough to me! will leave it to @wfxr to approve officially. Thanks for the adjustment |
wfxr
approved these changes
Jul 14, 2022
15 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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