devops: fetch origin before sync-moxygen's containment check - #646
Conversation
|
The change is correct and worth landing. Two things I'd ask for: 1. The silent failure discards the diagnostic. 2. Credential prompt / hang on the hook path. The file header explicitly supports a post-checkout hook caller ( Two smaller notes: 3. 4. The description slightly undersells the cost. "not per-goto traffic" is true — the Optionally: ten lines of comment for one line of code, and much of it is "not before / Not fatal / not per-goto". Since the house standard is saying what the code does rather than what it isn't, it could compress to about three. Low priority and consistent with the file's existing voice, so take it or leave it. |
gmarzot
left a comment
There was a problem hiding this comment.
@gmarzot reviewed 1 file and all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on afrind).
The containment check only reads local refs, so a moxygen checkout sitting on a commit that has since been pushed upstream is named by nothing locally and the detach is refused even though it would cost nothing -- the common shape right after moxygen work lands and the pin moves on with it. Fetch origin first, so the check sees the remote refs that do name it. Best effort: a failed fetch warns and the checks fall back to local refs, which is the conservative answer they gave before. It runs after the dirty and in-progress checks, which refuse without touching the network, so it costs one fetch per goto that actually moves the checkout -- including the moves that needed no network before, when the pin was already local. GIT_TERMINAL_PROMPT=0 on both fetches, the new one and the pin fetch below it, because the hook caller described in the file header runs unattended: a fetch that stopped to ask for credentials would hang every checkout. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
8a01ed5 to
e8b78bb
Compare
The containment check only reads local refs, so a moxygen checkout sitting on a commit that has since been pushed upstream is named by nothing locally and the detach is refused even though it would cost nothing -- the common shape right after moxygen work lands and the pin moves on with it. Fetch origin first, so the check sees the remote refs that do name it.
Best effort and non-fatal: it runs after the dirty/in-progress checks (which refuse without touching the network) and only on a goto that actually moves the checkout, since the HEAD == pin fast path returns earlier.
This change is