Skip to content

Commit

Permalink
💡 (Get-ReleaseDescription.ps1): add logging to indicate the start and…
Browse files Browse the repository at this point in the history
… completion of git commands

♻️ (Get-ReleaseDescription.ps1): comment out the pretty format option in git log command for better readability

Adding logging statements helps in tracking the execution flow and identifying where the script is during its run. Commenting out the pretty format option in the git log command makes the output more readable and easier to debug.
  • Loading branch information
MrHinsh committed Aug 8, 2024
1 parent c4fb8ba commit 741258d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion build/include/Get-ReleaseDescription.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ function Get-ReleaseDescription {
[Parameter(Mandatory=$true)]
[string]$OPEN_AI_KEY
)
Write-Host "========================================="
Write-Host "Azure DevOps Migration Tools (Release) Description"
Write-Host "========================================="
Write-Host "Mode: $mode"
Expand All @@ -44,14 +45,16 @@ function Get-ReleaseDescription {
{
"log" {
Write-Host "Running: git log"
$result = git log --pretty=format:'{\"hash\": \"%H\", \"author\": \"%an\", \"date\": \"%ad\", \"message\": \"%s\"}' "$compairFrom...$compairTo"
$result = git log "$compairFrom...$compairTo" #--pretty=format:'{\"hash\": \"%H\", \"author\": \"%an\", \"date\": \"%ad\", \"message\": \"%s\"}'
Write-Host "Complete: git log"
}
"diff" {
Write-Host "Running: git diff"
$diffOutPut = git diff "$compairFrom...$compairTo"
$joineddiffOutPut = $diffOutPut -join "`n"
$splitdiffOutPut = $joineddiffOutPut -split "diff --git"
$result = $splitdiffOutPut | ConvertTo-Json
Write-Host "Complete: git diff"
}
default {
Write-Host "Invalid mode"
Expand Down

0 comments on commit 741258d

Please sign in to comment.