From 702c8aad7d16ad122640d0f5dc6a22ee87204dd8 Mon Sep 17 00:00:00 2001 From: Joel Timothy Oh Date: Sun, 26 May 2024 02:13:24 +0000 Subject: [PATCH] Enhancement (generate): Standardize processing of commit history across all variants --- .../generate/variants/Changes-HashSubject-Merges.ps1 | 3 ++- .../variants/Changes-HashSubject-NoMerges-Categorized.ps1 | 2 +- .../generate/variants/Changes-HashSubject-NoMerges.ps1 | 3 ++- .../generate/variants/Changes-HashSubject.ps1 | 3 ++- .../Changes-HashSubjectAuthor-NoMerges-Categorized.ps1 | 2 +- .../generate/variants/VersionDate-HashSubject-Merges.ps1 | 3 ++- .../variants/VersionDate-HashSubject-NoMerges-Categorized.ps1 | 2 +- .../generate/variants/VersionDate-HashSubject-NoMerges.ps1 | 3 ++- .../generate/variants/VersionDate-HashSubject.ps1 | 3 ++- .../VersionDate-HashSubjectAuthor-NoMerges-Categorized.ps1 | 2 +- .../generate/variants/VersionDate-Subject-Merges.ps1 | 3 ++- .../variants/VersionDate-Subject-NoMerges-Categorized.ps1 | 2 +- .../generate/variants/VersionDate-Subject-NoMerges.ps1 | 3 ++- .../generate/variants/VersionDate-Subject.ps1 | 3 ++- .../VersionDate-SubjectAuthor-NoMerges-Categorized.ps1 | 2 +- 15 files changed, 24 insertions(+), 15 deletions(-) diff --git a/src/PSRepositoryReleaseManager/generate/variants/Changes-HashSubject-Merges.ps1 b/src/PSRepositoryReleaseManager/generate/variants/Changes-HashSubject-Merges.ps1 index 9ee2c7e..6b253f0 100644 --- a/src/PSRepositoryReleaseManager/generate/variants/Changes-HashSubject-Merges.ps1 +++ b/src/PSRepositoryReleaseManager/generate/variants/Changes-HashSubject-Merges.ps1 @@ -26,12 +26,13 @@ function Changes-HashSubject-Merges { } if ($previousRelease) { $funcArgs['SecondRef'] = @($previousRelease)[0] } $commitHistory = Get-RepositoryCommitHistory @funcArgs + $commitHistoryCollection = $commitHistory -split "`n" | ? { $_ } $releaseBody = & { @" ## Changes "@ -$commitHistory -split "`n" | % { $_.Trim() } | ? { $_ } | % { +$commitHistoryCollection | % { $_.Trim() } | ? { $_ } | % { @" * $_ "@ diff --git a/src/PSRepositoryReleaseManager/generate/variants/Changes-HashSubject-NoMerges-Categorized.ps1 b/src/PSRepositoryReleaseManager/generate/variants/Changes-HashSubject-NoMerges-Categorized.ps1 index 50a5295..838af98 100644 --- a/src/PSRepositoryReleaseManager/generate/variants/Changes-HashSubject-NoMerges-Categorized.ps1 +++ b/src/PSRepositoryReleaseManager/generate/variants/Changes-HashSubject-NoMerges-Categorized.ps1 @@ -26,7 +26,7 @@ function Changes-HashSubject-NoMerges-Categorized { } if ($previousRelease) { $funcArgs['SecondRef'] = @($previousRelease)[0] } $commitHistory = Get-RepositoryCommitHistory @funcArgs - $commitHistoryCollection = $commitHistory -split "`n" + $commitHistoryCollection = $commitHistory -split "`n" | ? { $_ } $commitCategory = @( @{ Name = 'Feature' diff --git a/src/PSRepositoryReleaseManager/generate/variants/Changes-HashSubject-NoMerges.ps1 b/src/PSRepositoryReleaseManager/generate/variants/Changes-HashSubject-NoMerges.ps1 index 78a3ce4..5d19080 100644 --- a/src/PSRepositoryReleaseManager/generate/variants/Changes-HashSubject-NoMerges.ps1 +++ b/src/PSRepositoryReleaseManager/generate/variants/Changes-HashSubject-NoMerges.ps1 @@ -26,12 +26,13 @@ function Changes-HashSubject-NoMerges { } if ($previousRelease) { $funcArgs['SecondRef'] = @($previousRelease)[0] } $commitHistory = Get-RepositoryCommitHistory @funcArgs + $commitHistoryCollection = $commitHistory -split "`n" | ? { $_ } $releaseBody = & { @" ## Changes "@ -$commitHistory -split "`n" | % { $_.Trim() } | ? { $_ } | % { +$commitHistoryCollection | % { $_.Trim() } | ? { $_ } | % { @" * $_ "@ diff --git a/src/PSRepositoryReleaseManager/generate/variants/Changes-HashSubject.ps1 b/src/PSRepositoryReleaseManager/generate/variants/Changes-HashSubject.ps1 index d37d7df..5b524e3 100644 --- a/src/PSRepositoryReleaseManager/generate/variants/Changes-HashSubject.ps1 +++ b/src/PSRepositoryReleaseManager/generate/variants/Changes-HashSubject.ps1 @@ -25,12 +25,13 @@ function Changes-HashSubject { } if ($previousRelease) { $funcArgs['SecondRef'] = @($previousRelease)[0] } $commitHistory = Get-RepositoryCommitHistory @funcArgs + $commitHistoryCollection = $commitHistory -split "`n" | ? { $_ } $releaseBody = & { @" ## Changes "@ -$commitHistory -split "`n" | % { $_.Trim() } | ? { $_ } | % { +$commitHistoryCollection | % { $_.Trim() } | ? { $_ } | % { @" * $_ "@ diff --git a/src/PSRepositoryReleaseManager/generate/variants/Changes-HashSubjectAuthor-NoMerges-Categorized.ps1 b/src/PSRepositoryReleaseManager/generate/variants/Changes-HashSubjectAuthor-NoMerges-Categorized.ps1 index 7380ea6..1a5c31f 100644 --- a/src/PSRepositoryReleaseManager/generate/variants/Changes-HashSubjectAuthor-NoMerges-Categorized.ps1 +++ b/src/PSRepositoryReleaseManager/generate/variants/Changes-HashSubjectAuthor-NoMerges-Categorized.ps1 @@ -26,7 +26,7 @@ function Changes-HashSubjectAuthor-NoMerges-Categorized { } if ($previousRelease) { $funcArgs['SecondRef'] = @($previousRelease)[0] } $commitHistory = Get-RepositoryCommitHistory @funcArgs - $commitHistoryCollection = $commitHistory -split "`n" + $commitHistoryCollection = $commitHistory -split "`n" | ? { $_ } $commitCategory = @( @{ Name = 'Feature' diff --git a/src/PSRepositoryReleaseManager/generate/variants/VersionDate-HashSubject-Merges.ps1 b/src/PSRepositoryReleaseManager/generate/variants/VersionDate-HashSubject-Merges.ps1 index 8e96964..00a2f09 100644 --- a/src/PSRepositoryReleaseManager/generate/variants/VersionDate-HashSubject-Merges.ps1 +++ b/src/PSRepositoryReleaseManager/generate/variants/VersionDate-HashSubject-Merges.ps1 @@ -26,12 +26,13 @@ function VersionDate-HashSubject-Merges { } if ($previousRelease) { $funcArgs['SecondRef'] = @($previousRelease)[0] } $commitHistory = Get-RepositoryCommitHistory @funcArgs + $commitHistoryCollection = $commitHistory -split "`n" | ? { $_ } $releaseBody = & { @" ## $TagName ($(Get-Date -UFormat '%Y-%m-%d')) "@ -$commitHistory -split "`n" | % { $_.Trim() } | ? { $_ } | % { +$commitHistoryCollection | % { $_.Trim() } | ? { $_ } | % { @" * $_ "@ diff --git a/src/PSRepositoryReleaseManager/generate/variants/VersionDate-HashSubject-NoMerges-Categorized.ps1 b/src/PSRepositoryReleaseManager/generate/variants/VersionDate-HashSubject-NoMerges-Categorized.ps1 index aa45b17..c37ca52 100644 --- a/src/PSRepositoryReleaseManager/generate/variants/VersionDate-HashSubject-NoMerges-Categorized.ps1 +++ b/src/PSRepositoryReleaseManager/generate/variants/VersionDate-HashSubject-NoMerges-Categorized.ps1 @@ -26,7 +26,7 @@ function VersionDate-HashSubject-NoMerges-Categorized { } if ($previousRelease) { $funcArgs['SecondRef'] = @($previousRelease)[0] } $commitHistory = Get-RepositoryCommitHistory @funcArgs - $commitHistoryCollection = $commitHistory -split "`n" + $commitHistoryCollection = $commitHistory -split "`n" | ? { $_ } $commitCategory = @( @{ Name = 'Feature' diff --git a/src/PSRepositoryReleaseManager/generate/variants/VersionDate-HashSubject-NoMerges.ps1 b/src/PSRepositoryReleaseManager/generate/variants/VersionDate-HashSubject-NoMerges.ps1 index aea6353..9c3d2cb 100644 --- a/src/PSRepositoryReleaseManager/generate/variants/VersionDate-HashSubject-NoMerges.ps1 +++ b/src/PSRepositoryReleaseManager/generate/variants/VersionDate-HashSubject-NoMerges.ps1 @@ -26,12 +26,13 @@ function VersionDate-HashSubject-NoMerges { } if ($previousRelease) { $funcArgs['SecondRef'] = @($previousRelease)[0] } $commitHistory = Get-RepositoryCommitHistory @funcArgs + $commitHistoryCollection = $commitHistory -split "`n" | ? { $_ } $releaseBody = & { @" ## $TagName ($(Get-Date -UFormat '%Y-%m-%d')) "@ -$commitHistory -split "`n" | % { $_.Trim() } | ? { $_ } | % { +$commitHistoryCollection | % { $_.Trim() } | ? { $_ } | % { @" * $_ "@ diff --git a/src/PSRepositoryReleaseManager/generate/variants/VersionDate-HashSubject.ps1 b/src/PSRepositoryReleaseManager/generate/variants/VersionDate-HashSubject.ps1 index 5fa9f44..8165d43 100644 --- a/src/PSRepositoryReleaseManager/generate/variants/VersionDate-HashSubject.ps1 +++ b/src/PSRepositoryReleaseManager/generate/variants/VersionDate-HashSubject.ps1 @@ -25,12 +25,13 @@ function VersionDate-HashSubject { } if ($previousRelease) { $funcArgs['SecondRef'] = @($previousRelease)[0] } $commitHistory = Get-RepositoryCommitHistory @funcArgs + $commitHistoryCollection = $commitHistory -split "`n" | ? { $_ } $releaseBody = & { @" ## $TagName ($(Get-Date -UFormat '%Y-%m-%d')) "@ -$commitHistory -split "`n" | % { $_.Trim() } | ? { $_ } | % { +$commitHistoryCollection | % { $_.Trim() } | ? { $_ } | % { @" * $_ "@ diff --git a/src/PSRepositoryReleaseManager/generate/variants/VersionDate-HashSubjectAuthor-NoMerges-Categorized.ps1 b/src/PSRepositoryReleaseManager/generate/variants/VersionDate-HashSubjectAuthor-NoMerges-Categorized.ps1 index 77d46bf..b7e99b8 100644 --- a/src/PSRepositoryReleaseManager/generate/variants/VersionDate-HashSubjectAuthor-NoMerges-Categorized.ps1 +++ b/src/PSRepositoryReleaseManager/generate/variants/VersionDate-HashSubjectAuthor-NoMerges-Categorized.ps1 @@ -26,7 +26,7 @@ function VersionDate-HashSubjectAuthor-NoMerges-Categorized { } if ($previousRelease) { $funcArgs['SecondRef'] = @($previousRelease)[0] } $commitHistory = Get-RepositoryCommitHistory @funcArgs - $commitHistoryCollection = $commitHistory -split "`n" + $commitHistoryCollection = $commitHistory -split "`n" | ? { $_ } $commitCategory = @( @{ Name = 'Feature' diff --git a/src/PSRepositoryReleaseManager/generate/variants/VersionDate-Subject-Merges.ps1 b/src/PSRepositoryReleaseManager/generate/variants/VersionDate-Subject-Merges.ps1 index 236b81a..de68440 100644 --- a/src/PSRepositoryReleaseManager/generate/variants/VersionDate-Subject-Merges.ps1 +++ b/src/PSRepositoryReleaseManager/generate/variants/VersionDate-Subject-Merges.ps1 @@ -26,12 +26,13 @@ function VersionDate-Subject-Merges { } if ($previousRelease) { $funcArgs['SecondRef'] = @($previousRelease)[0] } $commitHistory = Get-RepositoryCommitHistory @funcArgs + $commitHistoryCollection = $commitHistory -split "`n" | ? { $_ } $releaseBody = & { @" ## $TagName ($(Get-Date -UFormat '%Y-%m-%d')) "@ -$commitHistory -split "`n" | % { $_.Trim() } | ? { $_ } | % { +$commitHistoryCollection | % { $_.Trim() } | ? { $_ } | % { @" * $_ "@ diff --git a/src/PSRepositoryReleaseManager/generate/variants/VersionDate-Subject-NoMerges-Categorized.ps1 b/src/PSRepositoryReleaseManager/generate/variants/VersionDate-Subject-NoMerges-Categorized.ps1 index 0d6ddb9..3ffd73d 100644 --- a/src/PSRepositoryReleaseManager/generate/variants/VersionDate-Subject-NoMerges-Categorized.ps1 +++ b/src/PSRepositoryReleaseManager/generate/variants/VersionDate-Subject-NoMerges-Categorized.ps1 @@ -26,7 +26,7 @@ function VersionDate-Subject-NoMerges-Categorized { } if ($previousRelease) { $funcArgs['SecondRef'] = @($previousRelease)[0] } $commitHistory = Get-RepositoryCommitHistory @funcArgs - $commitHistoryCollection = $commitHistory -split "`n" + $commitHistoryCollection = $commitHistory -split "`n" | ? { $_ } $commitCategory = @( @{ Name = 'Feature' diff --git a/src/PSRepositoryReleaseManager/generate/variants/VersionDate-Subject-NoMerges.ps1 b/src/PSRepositoryReleaseManager/generate/variants/VersionDate-Subject-NoMerges.ps1 index 34285ed..bf83a7f 100644 --- a/src/PSRepositoryReleaseManager/generate/variants/VersionDate-Subject-NoMerges.ps1 +++ b/src/PSRepositoryReleaseManager/generate/variants/VersionDate-Subject-NoMerges.ps1 @@ -26,12 +26,13 @@ function VersionDate-Subject-NoMerges { } if ($previousRelease) { $funcArgs['SecondRef'] = @($previousRelease)[0] } $commitHistory = Get-RepositoryCommitHistory @funcArgs + $commitHistoryCollection = $commitHistory -split "`n" | ? { $_ } $releaseBody = & { @" ## $TagName ($(Get-Date -UFormat '%Y-%m-%d')) "@ -$commitHistory -split "`n" | % { $_.Trim() } | ? { $_ } | % { +$commitHistoryCollection | % { $_.Trim() } | ? { $_ } | % { @" * $_ "@ diff --git a/src/PSRepositoryReleaseManager/generate/variants/VersionDate-Subject.ps1 b/src/PSRepositoryReleaseManager/generate/variants/VersionDate-Subject.ps1 index 2147464..785f28c 100644 --- a/src/PSRepositoryReleaseManager/generate/variants/VersionDate-Subject.ps1 +++ b/src/PSRepositoryReleaseManager/generate/variants/VersionDate-Subject.ps1 @@ -25,12 +25,13 @@ function VersionDate-Subject { } if ($previousRelease) { $funcArgs['SecondRef'] = @($previousRelease)[0] } $commitHistory = Get-RepositoryCommitHistory @funcArgs + $commitHistoryCollection = $commitHistory -split "`n" | ? { $_ } $releaseBody = & { @" ## $TagName ($(Get-Date -UFormat '%Y-%m-%d')) "@ -$commitHistory -split "`n" | % { $_.Trim() } | ? { $_ } | % { +$commitHistoryCollection | % { $_.Trim() } | ? { $_ } | % { @" * $_ "@ diff --git a/src/PSRepositoryReleaseManager/generate/variants/VersionDate-SubjectAuthor-NoMerges-Categorized.ps1 b/src/PSRepositoryReleaseManager/generate/variants/VersionDate-SubjectAuthor-NoMerges-Categorized.ps1 index 93edd59..0d34799 100644 --- a/src/PSRepositoryReleaseManager/generate/variants/VersionDate-SubjectAuthor-NoMerges-Categorized.ps1 +++ b/src/PSRepositoryReleaseManager/generate/variants/VersionDate-SubjectAuthor-NoMerges-Categorized.ps1 @@ -26,7 +26,7 @@ function VersionDate-SubjectAuthor-NoMerges-Categorized { } if ($previousRelease) { $funcArgs['SecondRef'] = @($previousRelease)[0] } $commitHistory = Get-RepositoryCommitHistory @funcArgs - $commitHistoryCollection = $commitHistory -split "`n" + $commitHistoryCollection = $commitHistory -split "`n" | ? { $_ } $commitCategory = @( @{ Name = 'Feature'