Skip to content

Commit

Permalink
Enhancement (generate): Remove unnecessary trimming of git log lines
Browse files Browse the repository at this point in the history
  • Loading branch information
joeltimothyoh committed May 26, 2024
1 parent 710cd08 commit 8e5229f
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function Changes-HashSubject-NoMerges-Categorized {
}
if ($previousRelease) { $funcArgs['SecondRef'] = @($previousRelease)[0] }
$commitHistory = Get-RepositoryCommitHistory @funcArgs
$commitHistoryTrimmed = $commitHistory -split "`n" | % { $_.Trim() } | ? { $_ }
$commitHistoryCollection = $commitHistory -split "`n"
$commitCategory = @(
@{
Name = 'Feature'
Expand Down Expand Up @@ -57,7 +57,7 @@ function Changes-HashSubject-NoMerges-Categorized {
Title = 'Maintenance'
}
)
$commitHistoryUncategorized = $commitHistoryTrimmed | % {
$commitHistoryUncategorized = $commitHistoryCollection | % {
if (!($_ -match "^[0-9a-f]+ (\s*\w+\s*)(\(\s*[a-zA-Z0-9_-]+\s*\)\s*)*:(.+)")) {
$_
}
Expand All @@ -68,7 +68,7 @@ function Changes-HashSubject-NoMerges-Categorized {
"@
foreach ($c in $commitCategory) {
$isTitleOutputted = $false
$commitHistoryTrimmed | % {
$commitHistoryCollection | % {
if ($_ -match "^[0-9a-f]+ (\s*$($c['Name'])\s*)(\(\s*[a-zA-Z0-9_-]+\s*\)\s*)*:(.+)") {
if (!$isTitleOutputted) {
@"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function Changes-HashSubjectAuthor-NoMerges-Categorized {
}
if ($previousRelease) { $funcArgs['SecondRef'] = @($previousRelease)[0] }
$commitHistory = Get-RepositoryCommitHistory @funcArgs
$commitHistoryTrimmed = $commitHistory -split "`n" | % { $_.Trim() } | ? { $_ }
$commitHistoryCollection = $commitHistory -split "`n"
$commitCategory = @(
@{
Name = 'Feature'
Expand Down Expand Up @@ -57,7 +57,7 @@ function Changes-HashSubjectAuthor-NoMerges-Categorized {
Title = 'Maintenance'
}
)
$commitHistoryUncategorized = $commitHistoryTrimmed | % {
$commitHistoryUncategorized = $commitHistoryCollection | % {
if (!($_ -match "^[0-9a-f]+ (\s*\w+\s*)(\(\s*[a-zA-Z0-9_-]+\s*\)\s*)*:(.+)")) {
$_
}
Expand All @@ -68,7 +68,7 @@ function Changes-HashSubjectAuthor-NoMerges-Categorized {
"@
foreach ($c in $commitCategory) {
$isTitleOutputted = $false
$commitHistoryTrimmed | % {
$commitHistoryCollection | % {
if ($_ -match "^[0-9a-f]+ (\s*$($c['Name'])\s*)(\(\s*[a-zA-Z0-9_-]+\s*\)\s*)*:(.+)") {
if (!$isTitleOutputted) {
@"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function VersionDate-HashSubject-NoMerges-Categorized {
}
if ($previousRelease) { $funcArgs['SecondRef'] = @($previousRelease)[0] }
$commitHistory = Get-RepositoryCommitHistory @funcArgs
$commitHistoryTrimmed = $commitHistory -split "`n" | % { $_.Trim() } | ? { $_ }
$commitHistoryCollection = $commitHistory -split "`n"
$commitCategory = @(
@{
Name = 'Feature'
Expand Down Expand Up @@ -57,7 +57,7 @@ function VersionDate-HashSubject-NoMerges-Categorized {
Title = 'Maintenance'
}
)
$commitHistoryUncategorized = $commitHistoryTrimmed | % {
$commitHistoryUncategorized = $commitHistoryCollection | % {
if (!($_ -match "^[0-9a-f]+ (\s*\w+\s*)(\(\s*[a-zA-Z0-9_-]+\s*\)\s*)*:(.+)")) {
$_
}
Expand All @@ -68,7 +68,7 @@ function VersionDate-HashSubject-NoMerges-Categorized {
"@
foreach ($c in $commitCategory) {
$isTitleOutputted = $false
$commitHistoryTrimmed | % {
$commitHistoryCollection | % {
if ($_ -match "^[0-9a-f]+ (\s*$($c['Name'])\s*)(\(\s*[a-zA-Z0-9_-]+\s*\)\s*)*:(.+)") {
if (!$isTitleOutputted) {
@"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function VersionDate-HashSubjectAuthor-NoMerges-Categorized {
}
if ($previousRelease) { $funcArgs['SecondRef'] = @($previousRelease)[0] }
$commitHistory = Get-RepositoryCommitHistory @funcArgs
$commitHistoryTrimmed = $commitHistory -split "`n" | % { $_.Trim() } | ? { $_ }
$commitHistoryCollection = $commitHistory -split "`n"
$commitCategory = @(
@{
Name = 'Feature'
Expand Down Expand Up @@ -57,7 +57,7 @@ function VersionDate-HashSubjectAuthor-NoMerges-Categorized {
Title = 'Maintenance'
}
)
$commitHistoryUncategorized = $commitHistoryTrimmed | % {
$commitHistoryUncategorized = $commitHistoryCollection | % {
if (!($_ -match "^[0-9a-f]+ (\s*\w+\s*)(\(\s*[a-zA-Z0-9_-]+\s*\)\s*)*:(.+)")) {
$_
}
Expand All @@ -68,7 +68,7 @@ function VersionDate-HashSubjectAuthor-NoMerges-Categorized {
"@
foreach ($c in $commitCategory) {
$isTitleOutputted = $false
$commitHistoryTrimmed | % {
$commitHistoryCollection | % {
if ($_ -match "^[0-9a-f]+ (\s*$($c['Name'])\s*)(\(\s*[a-zA-Z0-9_-]+\s*\)\s*)*:(.+)") {
if (!$isTitleOutputted) {
@"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function VersionDate-Subject-NoMerges-Categorized {
}
if ($previousRelease) { $funcArgs['SecondRef'] = @($previousRelease)[0] }
$commitHistory = Get-RepositoryCommitHistory @funcArgs
$commitHistoryTrimmed = $commitHistory -split "`n" | % { $_.Trim() } | ? { $_ }
$commitHistoryCollection = $commitHistory -split "`n"
$commitCategory = @(
@{
Name = 'Feature'
Expand Down Expand Up @@ -57,7 +57,7 @@ function VersionDate-Subject-NoMerges-Categorized {
Title = 'Maintenance'
}
)
$commitHistoryUncategorized = $commitHistoryTrimmed | % {
$commitHistoryUncategorized = $commitHistoryCollection | % {
if (!($_ -match "^(\s*\w+\s*)(\(\s*[a-zA-Z0-9_-]+\s*\)\s*)*:(.+)")) {
$_
}
Expand All @@ -68,7 +68,7 @@ function VersionDate-Subject-NoMerges-Categorized {
"@
foreach ($c in $commitCategory) {
$isTitleOutputted = $false
$commitHistoryTrimmed | % {
$commitHistoryCollection | % {
if ($_ -match "^(\s*$($c['Name'])\s*)(\(\s*[a-zA-Z0-9_-]+\s*\)\s*)*:(.+)") {
if (!$isTitleOutputted) {
@"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function VersionDate-SubjectAuthor-NoMerges-Categorized {
}
if ($previousRelease) { $funcArgs['SecondRef'] = @($previousRelease)[0] }
$commitHistory = Get-RepositoryCommitHistory @funcArgs
$commitHistoryTrimmed = $commitHistory -split "`n" | % { $_.Trim() } | ? { $_ }
$commitHistoryCollection = $commitHistory -split "`n"
$commitCategory = @(
@{
Name = 'Feature'
Expand Down Expand Up @@ -57,7 +57,7 @@ function VersionDate-SubjectAuthor-NoMerges-Categorized {
Title = 'Maintenance'
}
)
$commitHistoryUncategorized = $commitHistoryTrimmed | % {
$commitHistoryUncategorized = $commitHistoryCollection | % {
if (!($_ -match "^(\s*\w+\s*)(\(\s*[a-zA-Z0-9_-]+\s*\)\s*)*:(.+)")) {
$_
}
Expand All @@ -68,7 +68,7 @@ function VersionDate-SubjectAuthor-NoMerges-Categorized {
"@
foreach ($c in $commitCategory) {
$isTitleOutputted = $false
$commitHistoryTrimmed | % {
$commitHistoryCollection | % {
if ($_ -match "^(\s*$($c['Name'])\s*)(\(\s*[a-zA-Z0-9_-]+\s*\)\s*)*:(.+)") {
if (!$isTitleOutputted) {
@"
Expand Down

0 comments on commit 8e5229f

Please sign in to comment.