Summary#
Add a tang pr update / tang pr resubmit workflow that appends a new round to an existing pull request record after the source branch changes.
Motivation#
Tangled pull requests are patch snapshots: pr create uploads the current branch diff as a gzipped patch blob and stores it in sh.tangled.repo.pull.rounds[0]. Unlike GitHub, pushing new commits to the source branch does not automatically update the pull request record.
This is easy to miss. In PR #3, a follow-up README commit was pushed to the feature branch after the PR record was created, but pr merge merged only the original patch blob. The later branch commit stayed outside main.
Proposed UX#
tang pr update 3
# alias or alternate spelling:
tang pr resubmit 3
The command should:
- resolve the pull request and its original target/source branches,
- compare the latest source branch against the target branch through the knot,
- upload a new gzipped patch blob to the user's PDS,
- update the existing
sh.tangled.repo.pullrecord with an append-only newrounds[]entry, - preserve title/body/source/target metadata,
- report the new round number.
pr diff, pr checkout, and pr merge should continue to use the latest round.
Follow-ups#
- Consider warning in
pr mergewhen the source branch appears newer than the latest PR round. - Consider
tang pr merge --update-firstoncepr updateis reliable. - Document that Tangled PRs are round-based snapshots rather than live branch refs.