Closed timsu92 closed 2 years ago
Related: #13
Do you think we can just use awk '{print $3}'
?
Something like this:
diff --git a/fzf-git.sh b/fzf-git.sh
index 07ae22f..cfc2263 100644
--- a/fzf-git.sh
+++ b/fzf-git.sh
@@ -177,10 +177,10 @@ _fzf_git_hashes() {
--prompt '🍡 Hashes> ' \
--header $'CTRL-O (open in browser) ╱ CTRL-D (diff) ╱ CTRL-S (toggle sort)\n\n' \
--bind "ctrl-o:execute-silent:bash $__fzf_git commit {}" \
- --bind 'ctrl-d:execute:grep -o "[a-f0-9]\{7,\}" <<< {} | head -n 1 | xargs git diff > /dev/tty' \
+ --bind "ctrl-d:execute:awk '{print \$3}' <<< {} | xargs git diff > /dev/tty" \
--color hl:underline,hl+:underline \
- --preview 'grep -o "[a-f0-9]\{7,\}" <<< {} | head -n 1 | xargs git show --color=always' "$@" |
- grep -o "[a-f0-9]\{7,\}"
+ --preview "awk '{print \$3}' <<< {} | xargs git show --color=always" "$@" |
+ awk '{print $3}'
}
_fzf_git_remotes() {
I'm afraid we can't do that because branches like master of vimspector which (I guess) uses "create merge commit" will be like this:
Sorry I met an urgent chore to do, so I left this in an odd draft😅
I'm using a repo whose titles of commit are
commit <hash>
, andctrl-g
ctrl-h
inserts two hashes.The repo is branch
release
of coc.nvim