From b4f0efdecafb207b7f3847bf5aeeb629e8756c46 Mon Sep 17 00:00:00 2001 From: Christopher Apple Date: Mon, 20 Apr 2020 15:44:02 -0700 Subject: [PATCH] added glo slice to fish, warning about fish 3.1 --- README.md | 2 +- forgit.plugin.fish | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9156147..bb42451 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ Run the following command in your shell to try `forgit` without installing: ``` bash source <(curl -Ss https://raw.githubusercontent.com/wfxr/forgit/master/forgit.plugin.zsh) ``` -##### Fish +##### Fish 3.0 (NOTE: 3.1 is not currently supported) ``` fish source (curl -Ss https://raw.githubusercontent.com/wfxr/forgit/master/forgit.plugin.fish | psub) ``` diff --git a/forgit.plugin.fish b/forgit.plugin.fish index f67e4a3..66c906f 100755 --- a/forgit.plugin.fish +++ b/forgit.plugin.fish @@ -27,7 +27,9 @@ type -q emojify >/dev/null 2>&1 && set forgit_emojify '|emojify' # git commit viewer function forgit::log forgit::inside_work_tree || return 1 - set cmd "echo {} |grep -Eo '[a-f0-9]+' |head -1 |xargs -I% git show --color=always % $argv | $forgit_pager" + + set files (echo $argv | sed -nE 's/.* -- (.*)/\1/p') + set cmd "echo {} |grep -Eo '[a-f0-9]+' |head -1 |xargs -I% git show --color=always % -- $files | $forgit_pager" if test -n "$FORGIT_COPY_CMD" set copy_cmd $FORGIT_COPY_CMD