-
Notifications
You must be signed in to change notification settings - Fork 349
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
HEAD@git gets misplaced when the first non-root commit is edited in a colocated repo #1495
Comments
I think this is a limitation in Git. See the comment here: |
I think an alternative might be to create a placeholder branch when we export to git from this state. |
ilyagr
changed the title
Colocated repos misplace HEAD@git when the first non-root commit is edited
HEAD@git gets misplaced when the first non-root commit is edited in a colocated repo
Apr 7, 2023
yuja
added a commit
to yuja/jj
that referenced
this issue
Oct 3, 2023
I'll add a workaround for the root parent issue jj-vcs#1495 there. We can pass in the wc parent id instead of the wc_commit object, but we might want to use wc_commit.id() to generate a unique placeholder ref name.
yuja
added a commit
that referenced
this issue
Oct 3, 2023
I'll add a workaround for the root parent issue #1495 there. We can pass in the wc parent id instead of the wc_commit object, but we might want to use wc_commit.id() to generate a unique placeholder ref name.
yuja
added a commit
to yuja/jj
that referenced
this issue
Oct 4, 2023
I considered using the working-copy commit id to generate a unique ref, but the placeholder ref can be "born" by committing changes by git, and the ref name can conflict later by editing the original (hidden) commit. So I think it's better to generate a random name instead. Fixes jj-vcs#1495
4 tasks
yuja
added a commit
to yuja/jj
that referenced
this issue
Oct 4, 2023
As we can set HEAD to an arbitrary ref by using .reference_symbolic(), we don't have to manage a ref that can also be valid as a branch name. Fixes jj-vcs#1495
yuja
added a commit
to yuja/jj
that referenced
this issue
Oct 4, 2023
As we can set HEAD to an arbitrary ref by using .reference_symbolic(), we don't have to manage a ref that can also be valid as a branch name. Fixes jj-vcs#1495
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Let's say I do the following in an empty repo:
At this point, things are OK.
jj log
looks likeand
git status
reports "no commits yet". There isn't yet a HEAD.If I then do
jj co t && jj edit q
, I end up in this bad state:Note how HEAD is in the wrong place.
The text was updated successfully, but these errors were encountered: