Skip to content

Instantly share code, notes, and snippets.

@ToQoz
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ToQoz/393ae89009dc5827dfbb to your computer and use it in GitHub Desktop.
Save ToQoz/393ae89009dc5827dfbb to your computer and use it in GitHub Desktop.
BEGIN {
FS = "\n";
"whoami" | getline user
}
{
if (system("test -d \"" $1 "/.git\"") != 0) {
next
}
skip = 1
# Give rev `HEAD` explicitly to prevent reading from stdin
# https://github.com/git/git/blob/ad524f834a9acaaaceeb846d00ea609f79333a3d/builtin/shortlog.c#L274
while ("git -C " $1 " --no-pager shortlog -nes HEAD" | getline cinfo) {
if (tolower(cinfo) ~ user) {
skip = 0
break
}
}
}
!skip {
print $1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment