From 67ff3a8c7fbd588ec7ba7d8069504e1c59eb57bf Mon Sep 17 00:00:00 2001 From: Ed_ Date: Fri, 18 Oct 2024 16:33:27 -0400 Subject: [PATCH] sigh 3 --- scripts/clean_shit_up.ps1 | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/scripts/clean_shit_up.ps1 b/scripts/clean_shit_up.ps1 index 48968e0..f5aa8ff 100644 --- a/scripts/clean_shit_up.ps1 +++ b/scripts/clean_shit_up.ps1 @@ -73,20 +73,21 @@ function Remove-ContentFromGitHistory { Write-Verbose "Relative content path: $path_content_relative" Write-Verbose "Removing Content directory from Git history..." - + # Construct and execute filter-branch command $filter_command = "git rm -r --cached --ignore-unmatch `"$path_content_relative`"" $filter_branch_cmd = "git $cgit_filter_branch $fgit_force $fgit_index_filter '$filter_command' $fgit_prune_empty $fgit_tag_name_filter $fgit_filter_concat $fgit_filter_separate $fgit_all" Write-Verbose "Executing command: $filter_branch_cmd" - $job = Start-Job -ScriptBlock { Invoke-Expression $args[0] } -ArgumentList $filter_branch_cmd - Wait-Job $job -Timeout 3600 # Wait for 1 hour max - if ($job.State -eq 'Running') { - Stop-Job $job - throw "Filter-branch operation timed out after 1 hour" - } else { - Receive-Job $job + $output = Invoke-Expression $filter_branch_cmd 2>&1 + $output | ForEach-Object { + if ($_ -match "WARNING:") { + Write-Warning $_ + } elseif ($_ -match "fatal:") { + throw $_ + } else { + Write-Verbose $_ + } } - Remove-Job $job Write-Verbose "Cleaning up refs..." # Clean up refs using git directly