fix: open repos when ~/.gitconfig has conflict markers - #188
Merged
Conversation
hewigovens
marked this pull request as ready for review
August 31, 2026 02:54
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
cursor
Bot
force-pushed
the
cursor/gitconfig-conflict-open-3cb6
branch
from
August 31, 2026 02:57
6cf4b77 to
4c0dba5
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6cf4b771f9
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
cursor
Bot
force-pushed
the
cursor/gitconfig-conflict-open-3cb6
branch
4 times, most recently
from
August 31, 2026 05:10
a617b99 to
f2e7c3a
Compare
jj-lib's WorkspaceLoadError Display is only "Cannot read the repo", so a conflicted ~/.gitconfig looked like a missing repository. Join the source chain at load so the gix token error is what the user sees.
cursor
Bot
force-pushed
the
cursor/gitconfig-conflict-open-3cb6
branch
from
August 31, 2026 06:11
f2e7c3a to
faf409b
Compare
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.
Summary
jj-libopens the colocated Git repo with gixstrict_config(true)and the default (non-isolated) config sources. If~/.gitconfigis a symlink into a repo (the hewigovens/dotfilesinstall.shpattern:~/.gitconfig→~/dotfiles/.gitconfig) and that file has conflict markers, jj itself refuses to load the repo:JayJay then showed “Failed to open repository” until the conflict was resolved by hand — which is the chicken-and-egg: you need the repo open to resolve
.gitconfig.Workspace::loadonly displaysCannot read the repo; the gix parse error is on the source chain. Matching that Display string is how the first revision missed the retry.Change
When a path contains
.jjandWorkspace::loadfails, retry withGIT_CONFIG_GLOBALpointed at an empty file. That lets JayJay open the repo so the conflicted.gitconfigcan be resolved in the UI.If the retry also fails, the error keeps the full cause chain and adds a hint about conflict markers / a symlinked
~/.gitconfig. A.jjdirectory that fails to load is reported as an internal error instead of “repository not found.”This is a workaround, not an upstream jj fix. The CLI still fails in the same situation.
Test plan
Repo::open+refresh_working_copysucceed whenGIT_CONFIG_GLOBALcontains jj conflict markers (child process so parallel fixtures are not poisoned)cargo test -p jayjay-core --test repocargo test -p jayjay-core --lib --test working_copy --test conflicts --test workspace_presence