-
Notifications
You must be signed in to change notification settings - Fork 42
🤖 fix: ignore stale origin/HEAD in git status scripts #1410
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
8e59c66 to
9fdf9a6
Compare
|
@codex review Addressed feedback:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
4f30163 to
f99c924
Compare
51a1dde to
7b186e8
Compare
#1414 unified the review base with git status, but fallback branch detection still trusted refs/remotes/origin/HEAD. Workspaces created from bundles can inherit a stale origin/HEAD (e.g. pointing at a feature branch), causing ahead/behind to be computed against the wrong remote ref. This follow-up: - Treats origin/HEAD as "auto-detect" even if configured as the base ref - Makes generateGitStatusScript() ignore suspicious origin/HEAD values and prefer origin/main or origin/master - Adds main↔master fallback when a configured origin/<branch> does not exist - Updates GIT_FETCH_SCRIPT to derive the remote default branch via `git ls-remote --symref origin HEAD` - Updates Sidebar story mocks to detect the status script via output markers - Adds unit tests for parseGitShowBranchForStatus
7b186e8 to
6935f0e
Compare
Context
#1414 (merged) unified the review-base selector with the git status indicator so the diff view and divergence numbers use the same base.
However, mux workspaces can be created from git bundles, and those clones can inherit a stale
refs/remotes/origin/HEAD(e.g. pointing at a feature branch). If we useorigin/HEADas the base (explicitly or implicitly), ahead/behind can be computed against the wrong remote ref.What this PR changes (follow-up)
generateGitStatusScript()origin/HEADas auto-detect even if configured as the base reforigin/<branch>when present (with main↔master fallback if the ref doesn't exist locally)origin/HEADvalues and prefersorigin/mainororigin/masterGIT_FETCH_SCRIPTgit ls-remote --symref origin HEAD(instead of localorigin/HEAD)parseGitShowBranchForStatusRegression risk
origin/mainororigin/mastermay fall back differently than before.GIT_FETCH_SCRIPTnow depends ongit ls-remote --symref origin HEAD; if the remote is unreachable/slow, fetch will be skipped and statuses may remain stale until a later refresh/manual fetch.origin/HEADas a base ref, it will now be treated as auto-detect (by design) to avoid stale/incorrect divergence.Testing
make static-checkGenerated with
mux• Model:openai:gpt-5.2• Thinking:xhigh