Skip to content

Commit 28a1ecb

Browse files
committed
releng: add --first-parent to the scripts that use git log (#16279)
It makes the output less cluttered and more correct (for example: ServicingPipeline no longer tries to service two copies of each commit if there's a merge in the history...) (cherry picked from commit 18b0ecb) Service-Card-Id: 91042450 Service-Version: 1.19
1 parent 4bbfa05 commit 28a1ecb

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

tools/Get-OSSConhostLog.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Function Get-Git2GitIgnoresAsExcludes() {
4343

4444
$Excludes = Get-Git2GitIgnoresAsExcludes
4545
Write-Verbose "IGNORING: $Excludes"
46-
$Entries = & git log $RevisionRange "--pretty=format:%an%x1C%ae%x1C%s" -- $Excludes |
46+
$Entries = & git log $RevisionRange --first-parent "--pretty=format:%an%x1C%ae%x1C%s" -- $Excludes |
4747
ConvertFrom-CSV -Delimiter "`u{001C}" -Header Author,Email,Subject
4848

4949
Write-Verbose ("{0} unfiltered log entries" -f $Entries.Count)

tools/ReleaseEngineering/New-TerminalStackedChangelog.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ ForEach ($RevisionRange in $RevisionRanges) {
6262
# - %ae: author email
6363
# - %x1C: another FS
6464
# - %s: subject, the title of the commit
65-
$NewEntries = & git log $RevisionRange "--pretty=format:%an%x1C%ae%x1C%s" |
65+
$NewEntries = & git log $RevisionRange --first-parent "--pretty=format:%an%x1C%ae%x1C%s" |
6666
ConvertFrom-CSV -Delimiter "`u{001C}" -Header Author,Email,Subject
6767

6868
$Entries += $NewEntries | % { [PSCustomObject]@{

tools/ReleaseEngineering/ServicingPipeline.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ $Cards = Get-GithubProjectCard -ColumnId $ToPickColumn.id
8989

9090
& git fetch --all 2>&1 | Out-Null
9191

92-
$Entries = @(& git log $SourceBranch --grep "(#\($($Cards.Number -Join "\|")\))" "--pretty=format:%H%x1C%s" |
92+
$Entries = @(& git log $SourceBranch --first-parent --grep "(#\($($Cards.Number -Join "\|")\))" "--pretty=format:%H%x1C%s" |
9393
ConvertFrom-CSV -Delimiter "`u{001C}" -Header CommitID,Subject)
9494

9595
[Array]::Reverse($Entries)

0 commit comments

Comments
 (0)