Created
May 17, 2019 05:05
-
-
Save thnk2wn/a00d0089d2d521d353c834fa05aa1374 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[CmdletBinding()] | |
param( | |
[Parameter(Mandatory=$false)] | |
[ValidateRange(1, 180)] | |
[int]$daysBack = 7, | |
[Parameter(Mandatory=$false)] | |
[string]$author, | |
[Parameter(Mandatory=$false)] | |
[switch]$mine | |
) | |
if ($mine) { | |
$author = git config user.name | |
} | |
$command = "git --no-pager log --after=""$($daysBack) days ago"" --pretty=format:""%h - %an, %ar : %s""" | |
if ($author) { | |
$command = "$command --author=""$author""" | |
} | |
Write-Host $command -ForegroundColor Yellow | |
$command = "`$output = $command" | |
Get-ChildItem -Recurse -Depth 2 -Force | | |
Where-Object { $_.Mode -match "h" -and $_.FullName -like "*\.git" } | | |
ForEach-Object { | |
$dir = Get-Item (Join-Path $_.FullName "../") | |
Push-Location $dir | |
Invoke-Expression $command | |
if ($output) { | |
Write-Host "`n$($dir.Name):" -ForegroundColor Cyan | |
$output | |
} | |
Pop-Location | |
} | |
Pop-Location |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment