Closed danmetzler closed 2 years ago
One way to check if the issue exists on a system:
$log = git --no-pager log -q --grep '^AU: ' --date iso --all | out-string
$all_commits = $log | Select-String 'commit(.|\n)+?(?=\ncommit )' -AllMatches
$ind = 0
foreach ($commit in $all_commits.Matches.Value) {
$commit = $commit -split '\n'
$date = $commit[2].Replace('Date:','').Trim()
"Index: $ind, Date: $date"
$ind++
}
If a non-date shows up for the date, the issue is there.
On further investigation this happens with a merge commit. In that scenario, the next line after the commit line is of the format Merge: <ref> <ref>
. Then author and date are shifted down one to the 3rd and 4th lines. This is because I did some work in another branch, and then merged into the main branch.
Ah, that must be it, we don't have merges with described AppVeyor system so that setup was never taken into consideration.
It seems to me there are a couple of approaches we could take to fix:
If we want to do the second option, I think we could look at the commit line that normally contains "Date:" and if it doesn't contain "Date:" then assume it is a merge commit and don't include it.
Any thoughts?
Lets just add --no-merges
param to git log
and call it a day.
Lets just add
--no-merges
param togit log
and call it a day.
Perfect!
I'm using Git version 2.34.1, and seem to be getting errors in the History plugin.
Appears the issue is [here](https://github.com/majkinetor/au/blob/master/AU/Plugins/History.ps1#:~:text=%24date%20%20%20%20%20%3D%20%24commit%5B2%5D.Replace(%27Date%3A%27%2C%27%27).Trim()). (line 35)
For me the date is at index 3 instead of index 2.
Since my setup is new, I'm not sure if this is an issue specific to my git config, or more tied to the version of Git, or something that is more widely experienced. (I think it has never worked for me, but maybe others have different experience?)