@@ -101,7 +101,7 @@ function Get-IgnoredNamesList($IgnoredNamesPath, $AkaContributors)
101101 }
102102 }
103103
104- $IgnoredNamesPath = Get-ConfigFilePath - configFilePath $IgnoredNamesPath - defaultConfigFilePath " $PSScriptRoot /.stravaig/list-contributor-ignore-names.txt" - friendlyName " list of ignored names" ;
104+ $IgnoredNamesPath = Get-ConfigFilePath - configFilePath $IgnoredNamesPath - defaultConfigFilePath " $PSScriptRoot /.stravaig/list-contributor-ignore-names.txt" - friendlyName " list of ignored names" ;
105105 if ($null -ne $IgnoredNamesPath )
106106 {
107107 $ignoredNames = Get-Content - Path $IgnoredNamesPath ;
@@ -156,8 +156,8 @@ function Get-InitialContributors($AkaFilePath)
156156 }
157157 catch
158158 {
159- # For some reason it isn't stopping the script when erroring with
160- # -ErrorAction Stop in the ConvertFrom-Json
159+ # For some reason it isn't stopping the script when erroring with
160+ # -ErrorAction Stop in the ConvertFrom-Json
161161 throw $_
162162 }
163163
@@ -218,7 +218,7 @@ function Get-InitialContributors($AkaFilePath)
218218$contributors = Get-InitialContributors - AkaFilePath $AkaFilePath ;
219219$ignoredNamesList = Get-IgnoredNamesList - IgnoredNamesPath $IgnoredNamesPath - AkaContributors $contributors
220220$ignoredEmailsList = Get-IgnoredEmailsList - IgnoredEmailsPath $IgnoredEmailsPath - AkaContributors $contributors
221- & git log -- format= " \ `" %ai\ `" ,\ `" %an\ `" ,\ `" %ae\ `" ,\ `" %H\ `" " > raw- contributors.csv
221+ & git log -- format= " `" %ai`" ,`" %an`" ,`" %ae`" ,`" %H`" " > raw- contributors.csv
222222$commits = Import-Csv raw- contributors.csv - Header Time, Name, Email, Hash | Sort-Object Time;
223223Remove-Item .\raw- contributors.csv
224224
@@ -241,9 +241,9 @@ for($i = 0; $i -lt $totalCommits; $i++)
241241 $contributor = New-Object - TypeName PSObject - Property @ {
242242 Names = @ ($nextCommit.Name );
243243 PrimaryName = $nextCommit.Name ;
244- Emails = @ ($nextCommit.Email );
245- FirstCommit = $commitTime ;
246- LastCommit = $commitTime ;
244+ Emails = @ ($nextCommit.Email );
245+ FirstCommit = $commitTime ;
246+ LastCommit = $commitTime ;
247247 CommitCount = 1
248248 };
249249 $contributors += $contributor ;
@@ -252,13 +252,13 @@ for($i = 0; $i -lt $totalCommits; $i++)
252252 }
253253 else
254254 {
255- if ((-not (Test-IgnoredItem - Item $nextCommit.Email - IgnoredItemsList $ignoredEmailsList )) -and
255+ if ((-not (Test-IgnoredItem - Item $nextCommit.Email - IgnoredItemsList $ignoredEmailsList )) -and
256256 (-not (Test-Email - Contributor $contributor - CommitterEmail $nextCommit.Email )))
257257 {
258258 Write-Verbose " Adding email `" $ ( $nextCommit.Email ) `" to $ ( $contributor.PrimaryName ) from commit $ ( $nextCommit.Hash ) ."
259259 $contributor.Emails += $nextCommit.Email ;
260260 }
261- if ((-not (Test-IgnoredItem - Item $nextCommit.Name - IgnoredItemsList $ignoredNamesList )) -and
261+ if ((-not (Test-IgnoredItem - Item $nextCommit.Name - IgnoredItemsList $ignoredNamesList )) -and
262262 (-not (Test-Name - Contributor $contributor - CommitterName $nextCommit.Name )))
263263 {
264264 Write-Verbose " Adding name `" $ ( $nextCommit.Name ) `" to $ ( $contributor.PrimaryName ) from commit $ ( $nextCommit.Hash ) ."
@@ -282,20 +282,20 @@ $contributors = $contributors | Where-Object CommitCount -gt 0
282282$isDescending = $SortDirection -eq " Descending" ;
283283Switch ($SortOrder )
284284{
285- " Name" {
285+ " Name" {
286286 $contributors = $contributors | Sort-Object PrimaryName - Descending:$isDescending ;
287287 $textOrderBy = " contributor name" ;
288288 }
289289 " FirstCommit" {
290- $contributors = $contributors | Sort-Object FirstCommit - Descending:$isDescending ;
290+ $contributors = $contributors | Sort-Object FirstCommit - Descending:$isDescending ;
291291 $textOrderBy = " first commit date" ;
292292 }
293293 " LastCommit" {
294- $contributors = $contributors | Sort-Object LastCommit - Descending:$isDescending ;
294+ $contributors = $contributors | Sort-Object LastCommit - Descending:$isDescending ;
295295 $textOrderBy = " last commit date" ;
296296 }
297297 " CommitCount" {
298- $contributors = $contributors | Sort-Object CommitCount - Descending:$isDescending ;
298+ $contributors = $contributors | Sort-Object CommitCount - Descending:$isDescending ;
299299 $textOrderBy = " number of commits" ;
300300 }
301301}
@@ -331,14 +331,14 @@ foreach($contributor in $contributors)
331331 $end = $contributor.LastCommit.ToString ($TimeFormat );
332332 }
333333 else {
334- $end = $contributor.LastCommit.ToString ($DateTimeFormat );
334+ $end = $contributor.LastCommit.ToString ($DateTimeFormat );
335335 }
336336 " **$name **$aka contributed $numCommits $commitMsg " | Out-File $OutputFile - Append - Encoding utf8 - NoNewline
337337 if ($numCommits -eq 1 )
338338 {
339339 " on $start ." | Out-File $OutputFile - Append - Encoding utf8
340340 }
341- else
341+ else
342342 {
343343 " from $start to $end ." | Out-File $OutputFile - Append - Encoding utf8
344344 }
@@ -348,42 +348,13 @@ foreach($contributor in $contributors)
348348" " | Out-File $OutputFile - Append - Encoding utf8
349349
350350$firstCommit = $commits [0 ];
351- $firstCommitMsg = [DateTime ]::ParseExact($firstCommit.Time , " yyyy-MM-dd HH:mm:ss zzz" , [CultureInfo ]::InvariantCulture).ToString($DateTimeFormat );
351+ $firstCommitMsg = [DateTime ]::ParseExact($firstCommit.Time , " yyyy-MM-dd HH:mm:ss zzz" , [CultureInfo ]::InvariantCulture).ToString($DateTimeFormat );
352352$lastCommit = $commits [$totalCommits - 1 ];
353- $lastCommitMsg = [DateTime ]::ParseExact($lastCommit.Time , " yyyy-MM-dd HH:mm:ss zzz" , [CultureInfo ]::InvariantCulture).ToString($DateTimeFormat );
353+ $lastCommitMsg = [DateTime ]::ParseExact($lastCommit.Time , " yyyy-MM-dd HH:mm:ss zzz" , [CultureInfo ]::InvariantCulture).ToString($DateTimeFormat );
354354
355355" :octocat: $totalCommits commits in total." | Out-File $OutputFile - Append - Encoding utf8
356356" " | Out-File $OutputFile - Append - Encoding utf8
357357" :date: From $firstCommitMsg ." | Out-File $OutputFile - Append - Encoding utf8
358358" " | Out-File $OutputFile - Append - Encoding utf8
359359" :date: Until $lastCommitMsg ." | Out-File $OutputFile - Append - Encoding utf8
360360" " | Out-File $OutputFile - Append - Encoding utf8
361-
362- $topCommitters = ($contributors | Sort-Object CommitCount - Descending);
363- $topCommitter = $topCommitters [0 ];
364- $name = $topCommitter.PrimaryName ;
365- $commitCount = $topCommitter.CommitCount ;
366- $percentage = $topCommitter.CommitCount / $totalCommits ;
367-
368- " :1st_place_medal: Gold medal to $name with $commitCount commits which represents " + (" {0:P2}" -f $percentage )+ " of all commits." | Out-File $OutputFile - Append - Encoding utf8
369- " " | Out-File $OutputFile - Append - Encoding utf8
370-
371- $topCommitter = $topCommitters [1 ];
372- if ($null -ne $topCommitter )
373- {
374- $name = $topCommitter.PrimaryName ;
375- $commitCount = $topCommitter.CommitCount ;
376- $percentage = $topCommitter.CommitCount / $totalCommits ;
377- " :2nd_place_medal: Silver medal to $name with $commitCount commits which represents " + (" {0:P2}" -f $percentage )+ " of all commits." | Out-File $OutputFile - Append - Encoding utf8
378- " " | Out-File $OutputFile - Append - Encoding utf8
379- }
380-
381- $topCommitter = $topCommitters [2 ];
382- if ($null -ne $topCommitter )
383- {
384- $name = $topCommitter.PrimaryName ;
385- $commitCount = $topCommitter.CommitCount ;
386- $percentage = $topCommitter.CommitCount / $totalCommits ;
387- " :3rd_place_medal: Bronze medal to $name with $commitCount commits which represents " + (" {0:P2}" -f $percentage )+ " of all commits." | Out-File $OutputFile - Append - Encoding utf8
388- " " | Out-File $OutputFile - Append - Encoding utf8
389- }
0 commit comments