Autoloop: fast-forward long-running branch to main when ahead=0#179
Merged
Autoloop: fast-forward long-running branch to main when ahead=0#179
Conversation
Agent-Logs-Url: https://github.com/githubnext/tsessebe/sessions/fd8b9575-c039-4e3a-ad47-adf60b149480 Co-authored-by: mrjf <180956+mrjf@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix autoloop fast-forward for long-running branch
Autoloop: fast-forward long-running branch to main when ahead=0
Apr 22, 2026
This was referenced Apr 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A stale
autoloop/{program-name}branch that isahead=0, behind>0versusmainwas being brought up to date with an unconditionalgit merge origin/main. The resulting merge commit's patch re-exposes every historical file, producing 1400+ file diffs that trip gh-aw's hard-codedMAX_FILES=100and fail new PR creation withE003.Changes
.github/workflows/autoloop.md(Step 3 prompt): Replace the unconditional merge withgit rev-list --countbased ahead/behind detection. Whenahead=0, behind>0, do a lossless fast-forward (git checkout -B ... origin/main+git push --force-with-lease) instead of a merge. Only merge when truly diverged (ahead>0, behind>0)..github/workflows/sync-branches.md: Same ahead/behind logic in the per-branch sync loop. Added explicitreturncodechecks ongit rev-listso a failed call is never silently coerced toahead=0(which would otherwise risk an incorrect destructive force-push)..github/workflows/sync-branches.lock.yml: Regenerated the verbatim-embedded pythonrun:value to matchsync-branches.md.Sketch of the new branch-update logic
Notes
--force-with-leaseis safe here precisely becauseahead=0proves no commits are lost.sync-branchesruns against the new default-branch HEAD, currently-stale canonical branches (e.g.autoloop/perf-comparison) will be fast-forwarded back toahead=0, behind=0, eliminating the per-iteration noise that was causing E003.MAX_FILESdiscussion — small, focused PRs are desirable on their own merits.