Preserve +/- information on cherry pick

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.
This commit is contained in:
carlfriedrich 2022-07-12 15:47:28 +02:00
parent 52d79009d1
commit 1b7db0fb6e
2 changed files with 4 additions and 4 deletions

View file

@ -344,8 +344,8 @@ function forgit::cherry::pick -d "git cherry-picking" --argument-names 'target'
"
echo $base
echo $target
git cherry "$base" "$target" --abbrev -v | cut -d ' ' -f2- |
env FZF_DEFAULT_OPTS="$opts" fzf | cut -d' ' -f1 |
git cherry "$base" "$target" --abbrev -v |
env FZF_DEFAULT_OPTS="$opts" fzf | cut -d' ' -f2 |
xargs -I% git cherry-pick %
end

View file

@ -159,8 +159,8 @@ forgit::cherry::pick() {
-m -0 --tiebreak=index
$FORGIT_CHERRY_PICK_FZF_OPTS
"
git cherry "$base" "$target" --abbrev -v | cut -d ' ' -f2- |
FZF_DEFAULT_OPTS="$opts" fzf | cut -d' ' -f1 |
git cherry "$base" "$target" --abbrev -v |
FZF_DEFAULT_OPTS="$opts" fzf | cut -d' ' -f2 |
xargs -I% git cherry-pick %
}