From 52d79009d1b106ffb3aaae88ec924bf83686edcd Mon Sep 17 00:00:00 2001 From: carlfriedrich Date: Tue, 12 Jul 2022 15:43:43 +0200 Subject: [PATCH] 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. --- conf.d/forgit.plugin.fish | 2 +- forgit.plugin.zsh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/conf.d/forgit.plugin.fish b/conf.d/forgit.plugin.fish index ab74abe..266a78e 100644 --- a/conf.d/forgit.plugin.fish +++ b/conf.d/forgit.plugin.fish @@ -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 diff --git a/forgit.plugin.zsh b/forgit.plugin.zsh index 8237d5c..1541895 100755 --- a/forgit.plugin.zsh +++ b/forgit.plugin.zsh @@ -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- |