Skip to content

Commit ff1e4dd

Browse files
Merge pull request #335 from ninmonkey/main
fix: git log ( Fixes #334 )
2 parents 4a2a585 + 84c52d1 commit ff1e4dd

File tree

4 files changed

+36
-58
lines changed

4 files changed

+36
-58
lines changed

CHANGELOG.md

+10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
## ugit 0.4.5.1:
2+
3+
> Like It? [Star It](https://github.com/StartAutomating/ugit)
4+
> Love It? [Support It](https://github.com/sponsors/StartAutomating)
5+
6+
* `git log` fix duplicate commit issue ( #334 )
7+
* Thanks @ninmonkey !
8+
9+
---
10+
111
## ugit 0.4.5:
212

313
> Like It? [Star It](https://github.com/StartAutomating/ugit)

Extensions/Git.Log.UGit.Extension.ps1

+10-9
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
param(
4141
)
4242

43-
begin {
43+
begin {
4444
$script:LogChangesMerged = $false
4545
$Git_Log = [Regex]::new(@'
4646
(?m)^commit # Commits start with 'commit'
@@ -66,7 +66,7 @@ begin {
6666

6767
$lines = [Collections.Generic.List[string]]::new()
6868
$StartsWithCommit = [Regex]::new('^commit', 'IgnoreCase')
69-
$gitLogTypeName =
69+
$gitLogTypeName =
7070
if ($gitCommand -match '--merges') {
7171
'git.merge.log'
7272
} else {
@@ -79,7 +79,7 @@ begin {
7979
$gitLogMatch = $Git_Log.Match($OutputLines -join [Environment]::NewLine)
8080
if (-not $gitLogMatch.Success) { return }
8181

82-
$gitLogOut = [Ordered]@{PSTypeName=$gitLogTypeName;GitCommand=$gitCommand}
82+
$gitLogOut = [Ordered]@{PSTypeName=$gitLogTypeName;GitCommand=$gitCommand}
8383
foreach ($group in $gitLogMatch.Groups) {
8484
if ($group.Name -as [int] -ne $null) { continue }
8585
if (-not $gitLogOut.Contains($group.Name)) {
@@ -91,7 +91,7 @@ begin {
9191
$gitLogOut.Remove("HexDigits")
9292
if ($gitLogOut.CommitDate) {
9393
$gitLogOut.CommitDateString = $gitLogOut.CommitDate
94-
$gitLogOut.Remove("CommitDate")
94+
$gitLogOut.Remove("CommitDate")
9595
}
9696
if ($gitLogOut.CommitMessage) {
9797
$gitLogOut.CommitMessage = $gitLogOut.CommitMessage.Trim()
@@ -115,7 +115,7 @@ begin {
115115
if ($gitLogOut.CommitMessage -match 'into (?<Branch>.+)$') {
116116
$gitLogOut.Destination = $matches.Branch
117117
}
118-
}
118+
}
119119

120120
if ($GitArgument -contains '--shortstat' -or $GitArgument -contains '--stat') {
121121
foreach ($linePart in $OutputLines[-2] -split ',' -replace '[\s\w\(\)-[\d]]') {
@@ -140,7 +140,7 @@ begin {
140140
if (-not $gitLogOut.Insertions) {
141141
$gitLogOut.Insertions = 0
142142
}
143-
}
143+
}
144144

145145
$gitLogOut.GitOutputLines = $OutputLines
146146
$gitLogOut.Merged = $script:LogChangesMerged
@@ -166,8 +166,9 @@ end {
166166
$commitStartLine = $lineIndex
167167
}
168168
}
169-
170-
OutGitLog $allInput[$commitStartIndex..($allInput.Count - 1)]
169+
170+
if ( $commitStartLine -lt $allInput.Count ) {
171+
OutGitLog $allInput[$commitStartLine..($allInput.Count - 1)]
172+
}
171173
$ExecutionContext.SessionState.PSVariable.Remove('script:LogChangesMerged')
172174
}
173-

docs/CHANGELOG.md

+10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
## ugit 0.4.5.1:
2+
3+
> Like It? [Star It](https://github.com/StartAutomating/ugit)
4+
> Love It? [Support It](https://github.com/sponsors/StartAutomating)
5+
6+
* `git log` fix duplicate commit issue ( #334 )
7+
* Thanks @ninmonkey !
8+
9+
---
10+
111
## ugit 0.4.5:
212

313
> Like It? [Star It](https://github.com/StartAutomating/ugit)

ugit.psd1

+6-49
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
@{
2-
ModuleVersion = '0.4.5'
2+
ModuleVersion = '0.4.5.1'
33
RootModule = 'ugit.psm1'
44
FormatsToProcess = 'ugit.format.ps1xml'
55
TypesToProcess = 'ugit.types.ps1xml'
66
Guid = '32323806-1d4a-485b-a64b-c502b0468847'
77
Author = 'James Brundage'
8-
Copyright = '2022-2024 Start-Automating'
8+
Copyright = '2022-2024 Start-Automating'
99
CompanyName = 'Start-Automating'
1010
Description = 'ugit: git, updated with PowerShell'
1111
PrivateData = @{
@@ -15,56 +15,13 @@ PrivateData = @{
1515
LicenseURI = 'https://github.com/StartAutomating/ugit/blob/main/LICENSE'
1616
BuildModule = @('EZOut', 'Piecemeal', 'PipeScript', 'PSSVG')
1717
ReleaseNotes = @'
18-
## ugit 0.4.5:
18+
## ugit 0.4.5.1:
1919
2020
> Like It? [Star It](https://github.com/StartAutomating/ugit)
2121
> Love It? [Support It](https://github.com/sponsors/StartAutomating)
2222
23-
* git improvements
24-
* `git clone`
25-
* git clone -Since improvements (#276)
26-
* git clone -Since time period (#277)
27-
* `git log`
28-
* git.log.Trailer (#305)
29-
* git.log.Description (#304)
30-
* git.log.Scope (#303)
31-
* git.log.CommitType (#301)
32-
* git.log.CommitDate (#309)
33-
* git.log.Change(s) (#306)
34-
* git.log.note(s) (#296)
35-
* git log accumulation improvement (#308)
36-
* git log parsing improvement (#306,#308,#309)
37-
* git.log.JiraTicket(s) (#313)
38-
* git log -TicketNumber(s) (#315)
39-
* `git commit`
40-
* git commit -OnBehalfOf (#275)
41-
* git commit -CoAuthoredBy (#274)
42-
* git commit -SkipCI (#320)
43-
* Container improvements
44-
* Container.init.ps1 (#279,#280)
45-
* Container.start.ps1 (#281)
46-
* Container.stop.ps1 (#282)
47-
* Action improvements
48-
* Refactoring ugit action (#289,#290)
49-
* Testing action in branch (#288)
50-
* New Parameters:
51-
* `ActionScript` (#311)
52-
* `GitHubToken` (#317)
53-
* `NoCommit` (#318)
54-
* `NoPush` (#319)
55-
* `TargetBranch` (#316)
56-
* Workflow improvements
57-
* Fixing ugit workflow PublishTestResults (#287)
58-
* GitPub cleanup (#310)
59-
* New Examples:
60-
* ChangesByCommitType example (#302, #301)
61-
* ChangesByDayOfWeek example (#295)
62-
* ChangesByIssueNumber example (#294)
63-
* ChangesByUserName example (#293)
64-
* ChangesByExtension example (#292)
65-
* ReleaseNotes Example (#307)
66-
* TableOfCurrentBranch example (#291)
67-
23+
* `git log` fix duplicate commit issue ( #334 )
24+
* Thanks @ninmonkey !
6825
---
6926
7027
Additional Changes in [Changelog](https://github.com/StartAutomating/ugit/blob/main/CHANGELOG.md)
@@ -80,4 +37,4 @@ Additional Changes in [Changelog](https://github.com/StartAutomating/ugit/blob/m
8037
)
8138
}
8239
}
83-
}
40+
}

0 commit comments

Comments
 (0)