diff options
| author | Thomas Vanbesien <tvanbesi@proton.me> | 2026-06-02 16:18:00 +0200 |
|---|---|---|
| committer | Thomas Vanbesien <tvanbesi@proton.me> | 2026-06-02 16:18:00 +0200 |
| commit | dfc87de59305ee03c673a64de8db25a4d7c7482a (patch) | |
| tree | d5f73d7f5ad443a8d31335e5e1930273fed79ff9 /scripts/git_blame.bash | |
| parent | 5ee6dfab36b38f31e13a1910a8117589bdd82df9 (diff) | |
| download | nvim-config-dfc87de59305ee03c673a64de8db25a4d7c7482a.tar.gz nvim-config-dfc87de59305ee03c673a64de8db25a4d7c7482a.zip | |
misc(nvim): GitBlame displays in a floating window
Diffstat (limited to 'scripts/git_blame.bash')
| -rwxr-xr-x | scripts/git_blame.bash | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/scripts/git_blame.bash b/scripts/git_blame.bash new file mode 100755 index 0000000..b197081 --- /dev/null +++ b/scripts/git_blame.bash @@ -0,0 +1,10 @@ +#!/usr/bin/bash +set -euo pipefail + +line="${1:?line argument missing}" +file="${2:?file argument missing}" +sha=$(git blame -L "$line,$line" --porcelain -- "$file" | + head -1 | + grep -Eo '[[:xdigit:]]+' | + head -1) +git log -1 "$sha" |
