-
Notifications
You must be signed in to change notification settings - Fork 319
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
FR: preserve current Git branch in co-located repo when possible #2210
Labels
colocated
enhancement
New feature or request
good first issue
Good for newcomers
polish🪒🐃
Make existing features more convenient and more consistent
Comments
4 tasks
ilyagr
added
good first issue
Good for newcomers
polish🪒🐃
Make existing features more convenient and more consistent
labels
Sep 6, 2023
Hi, there, could this be assigned to me and @wmrmrx? |
Commenting so I can be assigned @wmrmrx |
isinyaaa
added a commit
to isinyaaa/jj
that referenced
this issue
Oct 4, 2023
yuja
added a commit
to yuja/jj
that referenced
this issue
Oct 7, 2023
Otherwise, undone HEAD wouldn't be exported if we tried to preserve the symbolic HEAD target (martinvonz#2210). Unborn branch already has this problem.
yuja
added a commit
that referenced
this issue
Oct 7, 2023
Otherwise, undone HEAD wouldn't be exported if we tried to preserve the symbolic HEAD target (#2210). Unborn branch already has this problem.
isinyaaa
added a commit
to isinyaaa/jj
that referenced
this issue
Oct 29, 2023
isinyaaa
added a commit
to isinyaaa/jj
that referenced
this issue
Oct 29, 2023
isinyaaa
added a commit
to isinyaaa/jj
that referenced
this issue
Oct 30, 2023
isinyaaa
added a commit
to isinyaaa/jj
that referenced
this issue
Oct 31, 2023
isinyaaa
added a commit
that referenced
this issue
Nov 1, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
colocated
enhancement
New feature or request
good first issue
Good for newcomers
polish🪒🐃
Make existing features more convenient and more consistent
This report stems from the discussion starting with #2183 (comment).
In a co-located repo,
jj
generally puts the git repo in a "detached HEAD" state sincejj
does not have a concept of the current branch. In general, I don't propose we change that.However, after a
git switch branch
, we could make more effort to preservebranch
as a current branch when possible.jj
already makes some effort here. For exampletouch qq && jj log
keeps Git's current branch atbranch
. This is good.However,
jj describe -m qq
currently switches to a detached HEAD state, even though it doesn't modify the@-
commit wherebranch
is at. This is undesired.jj new @-
also currently switches to a detached HEAD state. Arguably, it shouldn't for the same reason: if the user just didgit switch branch
, they probably mainly care about whether the@-
commit (wherebranch
is at) changed.For reference, the situation
git switch branch
brings us to (after the subsequent automaticjj git import
) is:The text was updated successfully, but these errors were encountered: