added glo slice to fish, warning about fish 3.1

This commit is contained in:
Christopher Apple 2020-04-20 15:44:02 -07:00
parent 801e137d71
commit b4f0efdeca
2 changed files with 4 additions and 2 deletions

View file

@ -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)
```

View file

@ -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