From e9d1f3677d69e527faf852edec40d677f81c613f Mon Sep 17 00:00:00 2001 From: Jake Bolton Date: Tue, 3 Dec 2024 13:15:35 -0600 Subject: [PATCH 1/4] fix: git log ( Fixes #334 ) --- Extensions/Git.Log.UGit.Extension.ps1 | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/Extensions/Git.Log.UGit.Extension.ps1 b/Extensions/Git.Log.UGit.Extension.ps1 index 4129094f..f414aabb 100644 --- a/Extensions/Git.Log.UGit.Extension.ps1 +++ b/Extensions/Git.Log.UGit.Extension.ps1 @@ -40,7 +40,7 @@ param( ) -begin { +begin { $script:LogChangesMerged = $false $Git_Log = [Regex]::new(@' (?m)^commit # Commits start with 'commit' @@ -66,7 +66,7 @@ begin { $lines = [Collections.Generic.List[string]]::new() $StartsWithCommit = [Regex]::new('^commit', 'IgnoreCase') - $gitLogTypeName = + $gitLogTypeName = if ($gitCommand -match '--merges') { 'git.merge.log' } else { @@ -79,7 +79,7 @@ begin { $gitLogMatch = $Git_Log.Match($OutputLines -join [Environment]::NewLine) if (-not $gitLogMatch.Success) { return } - $gitLogOut = [Ordered]@{PSTypeName=$gitLogTypeName;GitCommand=$gitCommand} + $gitLogOut = [Ordered]@{PSTypeName=$gitLogTypeName;GitCommand=$gitCommand} foreach ($group in $gitLogMatch.Groups) { if ($group.Name -as [int] -ne $null) { continue } if (-not $gitLogOut.Contains($group.Name)) { @@ -91,7 +91,7 @@ begin { $gitLogOut.Remove("HexDigits") if ($gitLogOut.CommitDate) { $gitLogOut.CommitDateString = $gitLogOut.CommitDate - $gitLogOut.Remove("CommitDate") + $gitLogOut.Remove("CommitDate") } if ($gitLogOut.CommitMessage) { $gitLogOut.CommitMessage = $gitLogOut.CommitMessage.Trim() @@ -115,7 +115,7 @@ begin { if ($gitLogOut.CommitMessage -match 'into (?.+)$') { $gitLogOut.Destination = $matches.Branch } - } + } if ($GitArgument -contains '--shortstat' -or $GitArgument -contains '--stat') { foreach ($linePart in $OutputLines[-2] -split ',' -replace '[\s\w\(\)-[\d]]') { @@ -140,7 +140,7 @@ begin { if (-not $gitLogOut.Insertions) { $gitLogOut.Insertions = 0 } - } + } $gitLogOut.GitOutputLines = $OutputLines $gitLogOut.Merged = $script:LogChangesMerged @@ -166,8 +166,6 @@ end { $commitStartLine = $lineIndex } } - - OutGitLog $allInput[$commitStartIndex..($allInput.Count - 1)] + OutGitLog $allInput[$commitStartLine..($allInput.Count - 1)] $ExecutionContext.SessionState.PSVariable.Remove('script:LogChangesMerged') } - From 0f31be3fe3404a0e5084316bcdcc95e7530e0063 Mon Sep 17 00:00:00 2001 From: Jake Bolton Date: Tue, 3 Dec 2024 14:02:17 -0600 Subject: [PATCH 2/4] update ugit.psd1 minor version --- ugit.psd1 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ugit.psd1 b/ugit.psd1 index 99430722..0b6c1380 100644 --- a/ugit.psd1 +++ b/ugit.psd1 @@ -1,11 +1,11 @@ @{ - ModuleVersion = '0.4.5' + ModuleVersion = '0.4.5.1' RootModule = 'ugit.psm1' FormatsToProcess = 'ugit.format.ps1xml' TypesToProcess = 'ugit.types.ps1xml' Guid = '32323806-1d4a-485b-a64b-c502b0468847' Author = 'James Brundage' - Copyright = '2022-2024 Start-Automating' + Copyright = '2022-2024 Start-Automating' CompanyName = 'Start-Automating' Description = 'ugit: git, updated with PowerShell' PrivateData = @{ @@ -25,7 +25,7 @@ PrivateData = @{ * git clone -Since improvements (#276) * git clone -Since time period (#277) * `git log` - * git.log.Trailer (#305) + * git.log.Trailer (#305) * git.log.Description (#304) * git.log.Scope (#303) * git.log.CommitType (#301) @@ -62,8 +62,8 @@ PrivateData = @{ * ChangesByIssueNumber example (#294) * ChangesByUserName example (#293) * ChangesByExtension example (#292) - * ReleaseNotes Example (#307) - * TableOfCurrentBranch example (#291) + * ReleaseNotes Example (#307) + * TableOfCurrentBranch example (#291) --- @@ -80,4 +80,4 @@ Additional Changes in [Changelog](https://github.com/StartAutomating/ugit/blob/m ) } } -} \ No newline at end of file +} From 97154b3b1503c0f24a08ee8b9aa5253b1a6dde6c Mon Sep 17 00:00:00 2001 From: Jake Bolton Date: Fri, 6 Dec 2024 18:11:55 -0600 Subject: [PATCH 3/4] Release: updating module version (0.4.5.1) and release notes --- CHANGELOG.md | 10 ++++++ Extensions/Git.Log.UGit.Extension.ps1 | 5 ++- ugit.psd1 | 49 ++------------------------- 3 files changed, 17 insertions(+), 47 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 873cf338..f43168ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ +## ugit 0.4.5.1: + +> Like It? [Star It](https://github.com/StartAutomating/ugit) +> Love It? [Support It](https://github.com/sponsors/StartAutomating) + +* `git log` fix duplicate commit issue ( #334 ) +* Thanks @ninmonkey ! + +--- + ## ugit 0.4.5: > Like It? [Star It](https://github.com/StartAutomating/ugit) diff --git a/Extensions/Git.Log.UGit.Extension.ps1 b/Extensions/Git.Log.UGit.Extension.ps1 index f414aabb..08700038 100644 --- a/Extensions/Git.Log.UGit.Extension.ps1 +++ b/Extensions/Git.Log.UGit.Extension.ps1 @@ -166,6 +166,9 @@ end { $commitStartLine = $lineIndex } } - OutGitLog $allInput[$commitStartLine..($allInput.Count - 1)] + + if ( $commitStartLine -lt $allInput.Count ) { + OutGitLog $allInput[$commitStartLine..($allInput.Count - 1)] + } $ExecutionContext.SessionState.PSVariable.Remove('script:LogChangesMerged') } diff --git a/ugit.psd1 b/ugit.psd1 index 0b6c1380..9354a41f 100644 --- a/ugit.psd1 +++ b/ugit.psd1 @@ -15,56 +15,13 @@ PrivateData = @{ LicenseURI = 'https://github.com/StartAutomating/ugit/blob/main/LICENSE' BuildModule = @('EZOut', 'Piecemeal', 'PipeScript', 'PSSVG') ReleaseNotes = @' -## ugit 0.4.5: +## ugit 0.4.5.1: > Like It? [Star It](https://github.com/StartAutomating/ugit) > Love It? [Support It](https://github.com/sponsors/StartAutomating) -* git improvements - * `git clone` - * git clone -Since improvements (#276) - * git clone -Since time period (#277) - * `git log` - * git.log.Trailer (#305) - * git.log.Description (#304) - * git.log.Scope (#303) - * git.log.CommitType (#301) - * git.log.CommitDate (#309) - * git.log.Change(s) (#306) - * git.log.note(s) (#296) - * git log accumulation improvement (#308) - * git log parsing improvement (#306,#308,#309) - * git.log.JiraTicket(s) (#313) - * git log -TicketNumber(s) (#315) - * `git commit` - * git commit -OnBehalfOf (#275) - * git commit -CoAuthoredBy (#274) - * git commit -SkipCI (#320) -* Container improvements - * Container.init.ps1 (#279,#280) - * Container.start.ps1 (#281) - * Container.stop.ps1 (#282) -* Action improvements - * Refactoring ugit action (#289,#290) - * Testing action in branch (#288) - * New Parameters: - * `ActionScript` (#311) - * `GitHubToken` (#317) - * `NoCommit` (#318) - * `NoPush` (#319) - * `TargetBranch` (#316) -* Workflow improvements - * Fixing ugit workflow PublishTestResults (#287) - * GitPub cleanup (#310) -* New Examples: - * ChangesByCommitType example (#302, #301) - * ChangesByDayOfWeek example (#295) - * ChangesByIssueNumber example (#294) - * ChangesByUserName example (#293) - * ChangesByExtension example (#292) - * ReleaseNotes Example (#307) - * TableOfCurrentBranch example (#291) - +* `git log` fix duplicate commit issue ( #334 ) +* Thanks @ninmonkey ! --- Additional Changes in [Changelog](https://github.com/StartAutomating/ugit/blob/main/CHANGELOG.md) From 84c52d118372f2f4fd9881fb4f5397b4eef0c47c Mon Sep 17 00:00:00 2001 From: ninmonkey Date: Sat, 7 Dec 2024 00:13:40 +0000 Subject: [PATCH 4/4] Release: updating module version (0.4.5.1) and release notes --- docs/CHANGELOG.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 4f05c3ac..274b32d7 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,3 +1,13 @@ +## ugit 0.4.5.1: + +> Like It? [Star It](https://github.com/StartAutomating/ugit) +> Love It? [Support It](https://github.com/sponsors/StartAutomating) + +* `git log` fix duplicate commit issue ( #334 ) +* Thanks @ninmonkey ! + +--- + ## ugit 0.4.5: > Like It? [Star It](https://github.com/StartAutomating/ugit)