While git-blame and counting number of lines changed by an author within a git repository are helpful, is there a command that can list all of the pathnames modified in a repo a
Display the commit count of the specified author for each file in the current working tree.
$author = 'shaun';
dir -r | % { New-Object PSObject -Property `
@{ `
Count = git rev-list HEAD --count --author=$author -- $_.Name; `
FileName = $_.Name; `
}} `
| sort Count | % { $_.Count + ' -- ' + $_.FileName + ' -- ' + $author; }
$author = 'shaun'; `
Get-ChildItem -recurse | ForEach-Object `
{ `
New-Object PSObject -Property `
@{ `
Count = git rev-list HEAD --count --author=$author -- $_.Name; `
FileName = $_.Name; `
} `
} | `
Sort-Object Count | ForEach-Object `
{ `
$_.Count + ' -- ' + $_.FileName + ' -- ' + $author; `
}
`
means continue the command on a new line.|
means pipe the resultant objects to the next command.$_.SomeProperty
accesses a property from the piped in object.`
marks indicate a new line.filter-branch
to also track previously deletes files and other branches.git log --format='%aN' | sort -u
to iterate through all project authors0 -- blame.txt~ -- shaun
0 -- .blame.txt.un~ -- shaun
1 -- GitBook-GitTools-06-RewritingHistory.asc -- shaun
1 -- GitBook-GitTools-05-Searching.asc -- shaun
1 -- GitBook-GitTools-03-StashingAndCleaning.asc -- shaun
1 -- GitBook-GitTools-07-ResetDemystified.asc -- shaun
1 -- README.md -- shaun
1 -- LICENSE -- shaun
1 -- GitBook-GitTools-09-Rerere.asc -- shaun
1 -- GitBook-GitBranching-Rebasing.asc -- shaun
1 -- blame2.txt -- shaun
1 -- GitBook-GettingStarted-FirstTimeSetup.asc -- shaun
1 -- GitBook-GitTools-02-InteractiveStaging.asc -- shaun
1 -- GitBook-GitTools-01-RevisionSelection.asc -- shaun
1 -- GitBook-GitInternals-Maintenance.asc -- shaun
2 -- goals.asc -- shaun
2 -- GitBook-GitTools-10-Debugging.asc -- shaun
3 -- blame.txt -- shaun
6 -- GitBook-GitTools-08-AdvancedMerging.asc -- shaun