From bd8fce74a662fd6ed90d942a797531ffd0492ae8 Mon Sep 17 00:00:00 2001 From: Chris Apple Date: Thu, 14 Jul 2022 19:05:09 -0700 Subject: [PATCH] Fish didn't like the tac/tail switch. Also removed some print statements (#220) --- conf.d/forgit.plugin.fish | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/conf.d/forgit.plugin.fish b/conf.d/forgit.plugin.fish index 53385af..3e4ac54 100644 --- a/conf.d/forgit.plugin.fish +++ b/conf.d/forgit.plugin.fish @@ -14,7 +14,11 @@ end function forgit::reverse_lines # tac is not available on OSX, tail -r is not available on Linux, so we use either of them - tac 2> /dev/null || tail -r + if command -v tac &> /dev/null + tac + else + tail -r + end end set -g forgit_pager "$FORGIT_PAGER" @@ -351,8 +355,6 @@ function forgit::cherry::pick -d "git cherry-picking" --argument-names 'target' -m -0 --tiebreak=index $FORGIT_CHERRY_PICK_FZF_OPTS " - echo $base - echo $target git cherry "$base" "$target" --abbrev -v | forgit::reverse_lines | env FZF_DEFAULT_OPTS="$opts" fzf | cut -d' ' -f2 | forgit::reverse_lines | xargs -I% git cherry-pick %