Skip to content

Commit

Permalink
Merge pull request #97 from theohbrothers/enhancement/generate-remove…
Browse files Browse the repository at this point in the history
…-unnecessary-trimming-of-git-log-lines

Enhancement (generate): Remove unnecessary trimming of git log lines
  • Loading branch information
joeltimothyoh authored May 26, 2024
2 parents 710cd08 + 8e5229f commit c78dad3
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 c78dad3

Please sign in to comment.