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

View file

@ -339,7 +339,7 @@ function forgit::cherry::pick -d "git cherry-picking" --argument-names 'target'
set opts "
--preview=\"$preview\"
$FORGIT_FZF_DEFAULT_OPTS
-m -0
-m -0 --tiebreak=index
$FORGIT_CHERRY_PICK_FZF_OPTS
"
echo $base

View file

@ -156,7 +156,7 @@ forgit::cherry::pick() {
opts="
$FORGIT_FZF_DEFAULT_OPTS
--preview=\"$preview\"
-m -0
-m -0 --tiebreak=index
$FORGIT_CHERRY_PICK_FZF_OPTS
"
git cherry "$base" "$target" --abbrev -v | cut -d ' ' -f2- |