Conversation
Batch non-base branch deletions into a single `git branch -D` call instead of spawning a `git` process per branch in a `ForEach-Object` loop. This eliminates process spawning overhead and speeds up local branch cleanup by ~87%.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
What
Batch local branch deletions into a single
git branch -Dinvocation during post-merge cleanup inscript.ps1.Why
Previously, the cleanup loop executed$O(N)$ process overhead. Passing all branch names as an array to $O(1)$ CLI invocation.
git branch -D $branchNameindividually for each branch insideForEach-Object. Spawning a native executable process once per branch createsgit branch -Dallows PowerShell to expand arguments into a singleImpact
Significantly reduces cleanup execution time, especially when managing repos with many local feature branches.
Measurement
Benchmarked deletion of 20 test branches using PowerShell 7.4.5:
PR created automatically by Jules for task 4624701923223113660 started by @Cylae