Skip to content

Commit ad24ebe

Browse files
committed
Enforce git commands being run inside git folder
1 parent 72ceb16 commit ad24ebe

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

bin/git-authors.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
#!/bin/sh
22

3+
# Enforce being in a git repository
4+
git rev-parse --is-inside-work-tree >/dev/null || exit $?
5+
36
# save as i.e.: git-authors and set the executable flag
47
git ls-tree -r -z --name-only HEAD -- "${1}" \
58
| xargs -0 -n1 git blame --line-porcelain HEAD \
69
| grep "^author " \
710
| sort \
811
| uniq -c \
912
| sort -nr
10-

0 commit comments

Comments
 (0)