diff --git a/tools/ReleaseEngineering/New-TerminalStackedChangelog.ps1 b/tools/ReleaseEngineering/New-TerminalStackedChangelog.ps1 index 3620fb9abef..7f442f2ccf7 100644 --- a/tools/ReleaseEngineering/New-TerminalStackedChangelog.ps1 +++ b/tools/ReleaseEngineering/New-TerminalStackedChangelog.ps1 @@ -34,12 +34,12 @@ Function Test-MicrosoftPerson($email) { Function Generate-Thanks($Entry) { # We don't need to thank ourselves for doing our jobs - If ($_.Microsoft) { + If ($Entry.Microsoft) { "" - } ElseIf (-Not [string]::IsNullOrEmpty($_.PossibleUsername)) { - " (thanks @{0}!)" -f $_.PossibleUsername + } ElseIf (-Not [string]::IsNullOrEmpty($Entry.PossibleUsername)) { + " (thanks @{0}!)" -f $Entry.PossibleUsername } Else { - " (thanks @<{0}>!)" -f $_.Email + " (thanks @<{0}>!)" -f $Entry.Email } } @@ -54,6 +54,7 @@ Function Get-PossibleUserName($email) { $Entries = @() +$i = 0 ForEach ($RevisionRange in $RevisionRanges) { # --pretty=format notes: # - %an: author name @@ -70,15 +71,23 @@ ForEach ($RevisionRange in $RevisionRanges) { Subject = $_.Subject; Microsoft = (Test-MicrosoftPerson $_.Email); PossibleUsername = (Get-PossibleUserName $_.Email); + RevRangeID = $i; } } + $i++ } -$Unique = $Entries | Group-Object Subject | %{ $_.Group[0] | Add-Member Count $_.Count -Force -PassThru } +For($c = 0; $c -Lt $i; $c++) { + " " + ("|" * $c) + "/ " + $RevisionRanges[$c] +} + +$Unique = $Entries | Group-Object Subject $Unique | % { - $c = "" - If ($_.Count -Gt 1) { - $c = "[{0}] " -f $_.Count + $en = $_.Group[0] + $revSpec = (" " * $i) + $_.Group | % { + $revSpec = $revSpec.remove($_.RevRangeID, 1).insert($_.RevRangeID, "X") } - "* {0}{1}{2}" -f ($c, $_.Subject, (Generate-Thanks $_)) + $c = "[{0}] " -f $revSpec + "* {0}{1}{2}" -f ($c, $en.Subject, (Generate-Thanks $en)) }