mirror of
https://github.com/Stunkymonkey/dotfiles.git
synced 2025-09-13 14:02:03 +02:00
Enforce git commands being run inside git folder
This commit is contained in:
parent
72ceb16f5f
commit
ad24ebe4a2
1 changed files with 3 additions and 1 deletions
|
@ -1,5 +1,8 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Enforce being in a git repository
|
||||
git rev-parse --is-inside-work-tree >/dev/null || exit $?
|
||||
|
||||
# save as i.e.: git-authors and set the executable flag
|
||||
git ls-tree -r -z --name-only HEAD -- "${1}" \
|
||||
| xargs -0 -n1 git blame --line-porcelain HEAD \
|
||||
|
@ -7,4 +10,3 @@ git ls-tree -r -z --name-only HEAD -- "${1}" \
|
|||
| sort \
|
||||
| uniq -c \
|
||||
| sort -nr
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue