Skip to content

Instantly share code, notes, and snippets.

@mblanchard
Last active August 17, 2018 14:59
Show Gist options
  • Save mblanchard/7bc14ed8f0414c484490c3697c398f33 to your computer and use it in GitHub Desktop.
Save mblanchard/7bc14ed8f0414c484490c3697c398f33 to your computer and use it in GitHub Desktop.
Finding recent commits for standup
# Finds commits made in the last day by a particular author, using `git log`
# Expects `git` in the path
# Can be run from repo or directory of repos
# Handling of recursion depth and identifying repos could be improved
# See Git docs for '--since' and '--pretty' format: https://git-scm.com/docs/git-log
Param(
[string]$user,
[string]$sinceDate = "yesterday.midnight"
)
Get-ChildItem \*\*\*,\*\*,\* -directory -Hidden .git | % {
$logOutput = (git -C $_.fullname shortlog --date=local --since=$sinceDate --author=$user) | Out-String
if ($logOutput){
echo "`n"$_.fullname;
git -C $_.fullname log --date=local --since=$sinceDate --author=$user --pretty=format:" %C(magenta)%ar %Cgreen%s"
}
} -EA SilentlyContinue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment