Compare commits

...

1 Commits

Author SHA1 Message Date
Dustin L. Howett
88af41395c **HAX** Integrate with clogs json files 2025-02-06 18:37:33 -06:00

View File

@@ -25,7 +25,8 @@
[CmdletBinding()]
Param(
[string[]]$RevisionRanges
[string[]]$RevisionRanges,
[string]$Clog
)
Function Test-MicrosoftPerson($email) {
@@ -52,6 +53,9 @@ Function Get-PossibleUserName($email) {
return $null
}
$cll=gc $Clog | convertfrom-json -depth 99
$prr=[regex]::new('\(#(\d+)\)$')
$Entries = @()
$i = 0
@@ -62,17 +66,47 @@ ForEach ($RevisionRange in $RevisionRanges) {
# - %ae: author email
# - %x1C: another FS
# - %s: subject, the title of the commit
$NewEntries = & git log $RevisionRange --first-parent "--pretty=format:%an%x1C%ae%x1C%s" |
ConvertFrom-CSV -Delimiter "`u{001C}" -Header Author,Email,Subject
$NewEntries = & git log $RevisionRange --first-parent "--pretty=format:%H%x1C%an%x1C%ae%x1C%s" |
ConvertFrom-CSV -Delimiter "`u{001C}" -Header SHA,Author,Email,Subject
$Entries += $NewEntries | % { [PSCustomObject]@{
Author = $_.Author;
Email = $_.Email;
Subject = $_.Subject;
Microsoft = (Test-MicrosoftPerson $_.Email);
PossibleUsername = (Get-PossibleUserName $_.Email);
RevRangeID = $i;
} }
$Entries += $NewEntries | % {
$id = $_.SHA
$maa=$prr.Match($_.Subject)
$pr = ""
if ($maa.Success) {
$id = "pr-"+$maa.Groups[1].Value
$pr = " (#$($maa.Groups[1].Value))"
}
$cle = $cll.$id
if ($null -ne $cle) {
if ($cle.Ignore) {
return
}
$slug = switch($cle.Type) {
1 { "b" }
2 { "c" }
3 { "f" }
default { "x" }
}
if ($cle.Priority -gt 0) {
$slug += ("{0}" -f $cle.Priority)
}
$_.Subject = $slug + " " + $cle.Title + $pr
} Else {
$_.Subject = "%%% "+$_.Subject
}
[PSCustomObject]@{
ID = $_.ID;
Author = $_.Author;
Email = $_.Email;
Subject = $_.Subject;
Microsoft = (Test-MicrosoftPerson $_.Email);
PossibleUsername = (Get-PossibleUserName $_.Email);
RevRangeID = $i;
}
}
$i++
}