From e430237cd9deee7e7ec04ea012d8e215214872b8 Mon Sep 17 00:00:00 2001 From: Joel Timothy Oh Date: Sun, 26 May 2024 02:44:42 +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..8067379 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" | % { $_.Trim() } | ? { $_ } $releaseBody = & { @" ## Changes "@ -$commitHistory -split "`n" | % { $_.Trim() } | ? { $_ } | % { +$commitHistoryCollection | % { @" * $_ "@ diff --git a/src/PSRepositoryReleaseManager/generate/variants/Changes-HashSubject-NoMerges-Categorized.ps1 b/src/PSRepositoryReleaseManager/generate/variants/Changes-HashSubject-NoMerges-Categorized.ps1 index 50a5295..6bdd98d 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" | % { $_.Trim() } | ? { $_ } $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..6ef6eea 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" | % { $_.Trim() } | ? { $_ } $releaseBody = & { @" ## Changes "@ -$commitHistory -split "`n" | % { $_.Trim() } | ? { $_ } | % { +$commitHistoryCollection | % { @" * $_ "@ diff --git a/src/PSRepositoryReleaseManager/generate/variants/Changes-HashSubject.ps1 b/src/PSRepositoryReleaseManager/generate/variants/Changes-HashSubject.ps1 index d37d7df..f628ac9 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" | % { $_.Trim() } | ? { $_ } $releaseBody = & { @" ## Changes "@ -$commitHistory -split "`n" | % { $_.Trim() } | ? { $_ } | % { +$commitHistoryCollection | % { @" * $_ "@ diff --git a/src/PSRepositoryReleaseManager/generate/variants/Changes-HashSubjectAuthor-NoMerges-Categorized.ps1 b/src/PSRepositoryReleaseManager/generate/variants/Changes-HashSubjectAuthor-NoMerges-Categorized.ps1 index 7380ea6..96566ae 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" | % { $_.Trim() } | ? { $_ } $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..1ee84b8 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" | % { $_.Trim() } | ? { $_ } $releaseBody = & { @" ## $TagName ($(Get-Date -UFormat '%Y-%m-%d')) "@ -$commitHistory -split "`n" | % { $_.Trim() } | ? { $_ } | % { +$commitHistoryCollection | % { @" * $_ "@ diff --git a/src/PSRepositoryReleaseManager/generate/variants/VersionDate-HashSubject-NoMerges-Categorized.ps1 b/src/PSRepositoryReleaseManager/generate/variants/VersionDate-HashSubject-NoMerges-Categorized.ps1 index aa45b17..28c33ca 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" | % { $_.Trim() } | ? { $_ } $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..dd4e823 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" | % { $_.Trim() } | ? { $_ } $releaseBody = & { @" ## $TagName ($(Get-Date -UFormat '%Y-%m-%d')) "@ -$commitHistory -split "`n" | % { $_.Trim() } | ? { $_ } | % { +$commitHistoryCollection | % { @" * $_ "@ diff --git a/src/PSRepositoryReleaseManager/generate/variants/VersionDate-HashSubject.ps1 b/src/PSRepositoryReleaseManager/generate/variants/VersionDate-HashSubject.ps1 index 5fa9f44..97dcc2b 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" | % { $_.Trim() } | ? { $_ } $releaseBody = & { @" ## $TagName ($(Get-Date -UFormat '%Y-%m-%d')) "@ -$commitHistory -split "`n" | % { $_.Trim() } | ? { $_ } | % { +$commitHistoryCollection | % { @" * $_ "@ diff --git a/src/PSRepositoryReleaseManager/generate/variants/VersionDate-HashSubjectAuthor-NoMerges-Categorized.ps1 b/src/PSRepositoryReleaseManager/generate/variants/VersionDate-HashSubjectAuthor-NoMerges-Categorized.ps1 index 77d46bf..1a8691f 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" | % { $_.Trim() } | ? { $_ } $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..5919cce 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" | % { $_.Trim() } | ? { $_ } $releaseBody = & { @" ## $TagName ($(Get-Date -UFormat '%Y-%m-%d')) "@ -$commitHistory -split "`n" | % { $_.Trim() } | ? { $_ } | % { +$commitHistoryCollection | % { @" * $_ "@ diff --git a/src/PSRepositoryReleaseManager/generate/variants/VersionDate-Subject-NoMerges-Categorized.ps1 b/src/PSRepositoryReleaseManager/generate/variants/VersionDate-Subject-NoMerges-Categorized.ps1 index 0d6ddb9..93019ac 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" | % { $_.Trim() } | ? { $_ } $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..d4a8a75 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" | % { $_.Trim() } | ? { $_ } $releaseBody = & { @" ## $TagName ($(Get-Date -UFormat '%Y-%m-%d')) "@ -$commitHistory -split "`n" | % { $_.Trim() } | ? { $_ } | % { +$commitHistoryCollection | % { @" * $_ "@ diff --git a/src/PSRepositoryReleaseManager/generate/variants/VersionDate-Subject.ps1 b/src/PSRepositoryReleaseManager/generate/variants/VersionDate-Subject.ps1 index 2147464..d1395cf 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" | % { $_.Trim() } | ? { $_ } $releaseBody = & { @" ## $TagName ($(Get-Date -UFormat '%Y-%m-%d')) "@ -$commitHistory -split "`n" | % { $_.Trim() } | ? { $_ } | % { +$commitHistoryCollection | % { @" * $_ "@ diff --git a/src/PSRepositoryReleaseManager/generate/variants/VersionDate-SubjectAuthor-NoMerges-Categorized.ps1 b/src/PSRepositoryReleaseManager/generate/variants/VersionDate-SubjectAuthor-NoMerges-Categorized.ps1 index 93edd59..b957048 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" | % { $_.Trim() } | ? { $_ } $commitCategory = @( @{ Name = 'Feature'