fix(slash_cmds): merge additive-overlay files (e.g. .gitignore) on /update#679
Open
shenhao-stu wants to merge 1 commit into
Open
fix(slash_cmds): merge additive-overlay files (e.g. .gitignore) on /update#679shenhao-stu wants to merge 1 commit into
shenhao-stu wants to merge 1 commit into
Conversation
…ompt The /update prompt reconciles the working tree "upstream-first" file by file. That silently drops fork-local additions to files BOTH sides edit — most painfully .gitignore, whose local ignore rules vanish, so a fork's private dirs resurface as untracked noise (and can get committed by accident). Treat files carrying a `Fork-only local overlay` marker (e.g. .gitignore) as a MERGE: take upstream as the base, then re-append everything under the marker verbatim, and verify the marker survived. Along the way, tighten both the EN and ZH prompts (75 -> 58 lines) without dropping any operative step.
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.
Problem
build_update_prompttells the agent to reconcile the working tree upstream-first, file by file. For files that both upstream and a fork edit, this silently takes upstream — and the most common casualty is.gitignore: a fork's local ignore rules get dropped, so its private directories resurface as untracked noise and can be committed by accident. Becausegit reset --mixed/git mergeonly move history and the index, the reverted.gitignoreis easy to miss.Fix
Treat files carrying a
Fork-only local overlaymarker comment (e.g..gitignore) as a merge, not a take-one-side choice:This makes personalizing a fork (the whole point of GenericAgent) survive
/update, while still keeping upstream authoritative for real code.Also
Tightened both the EN and ZH prompts (75 → 58 lines) — dropped the repetitive framing, kept every operative instruction. Verified both languages still render with the full step list + the closing message.
No behavior change beyond the prompt text;
build_update_promptremains a pure single-arg function.