summaryrefslogtreecommitdiff
path: root/git-sleuth
blob: e5f17fd8c1e782d452df4cee21b4499ba2ca3636 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/env bash
set -euo pipefail
SEARCH_DEFAULT_COMMAND="git log --color=always -S {q} --oneline --no-show-signature"
FZF_DEFAULT_COMMAND="git log --color=always -S {q} --oneline --no-show-signature"
fzf \
  --multi \
  --exact \
  --ansi \
  --phony \
  --query="$@" \
  --bind "ctrl-a:select-all" \
  --bind "change:reload:$SEARCH_DEFAULT_COMMAND || true" \
  --preview "git show --stat --color=always {1}" \
  | cut -d' ' -f1
  | tr '\n' ' '
  | xargs git show