-
Notifications
You must be signed in to change notification settings - Fork 346
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: Allow users to see and address git repo refs as @git
branches
#1666
Comments
Update: actually, this plan will not resolve @arxanas's issue. For that to be address, we'd probably need to address accessing remote-tracking branches in the local git repo, which is a step beyond this issue. |
This doesn't change the way @git branches are stored in `git_refs` as opposed to inside `BranchTarget` like normal remote-tracking branches. There are subtle differences in behavior with e.g. `jj branch forget` and I'm not sure how easy it is to rewrite `jj git import/export` to support a different way of storage. I've decided to call these "local-git tracking branches" since they track branches in the local git repository. "local git-tracking" branches sounds a bit more natural, but these could be confused with there are no remote git-tracking branches. If one had the idea these might exist, they would be confused with remote-tracking branches in the local git repo. This addresses a portion of #1666
@git
branches@git
branches
I added the question of what to do with refs tracking the local git repo's remote-tracking branches. E.g., we could refer to them as I was previously hoping to remove them entirely, but I now think they are necessary in colocated repos. We need them for the same reason as the refs tracking the local git branches: we to differentiate between A) the situation when |
I now believe that jj will need to store git-tracking refs for both local and remote-tracking branches of the git repo for the long term. See jj-vcs#1666 (comment) More refactoring will likely happen when that bug is fixed.
I now believe that jj will need to store git-tracking refs for both local and remote-tracking branches of the git repo for the long term. See jj-vcs#1666 (comment) More refactoring will likely happen when that bug is fixed.
I now believe that jj will need to store git-tracking refs for both local and remote-tracking branches of the git repo for the long term. See jj-vcs#1666 (comment) More refactoring will likely happen when that bug is fixed.
I now believe that jj will need to store git-tracking refs for both local and remote-tracking branches of the git repo for the long term. See jj-vcs#1666 (comment) More refactoring will likely happen when that bug is fixed.
I now believe that jj will need to store git-tracking refs for both local and remote-tracking branches of the git repo for the long term. See jj-vcs#1666 (comment) More refactoring will likely happen when that bug is fixed.
I now believe that jj will need to store git-tracking refs for both local and remote-tracking branches of the git repo for the long term. See jj-vcs#1666 (comment) More refactoring will likely happen when that bug is fixed.
I now believe that jj will need to store git-tracking refs for both local and remote-tracking branches of the git repo for the long term. See jj-vcs#1666 (comment) More refactoring will likely happen when that bug is fixed.
I now believe that jj will need to store git-tracking refs for both local and remote-tracking branches of the git repo for the long term. See jj-vcs#1666 (comment) More refactoring will likely happen when that bug is fixed.
I now believe that jj will need to store git-tracking refs for both local and remote-tracking branches of the git repo for the long term. See jj-vcs#1666 (comment) More refactoring will likely happen when that bug is fixed.
I now believe that jj will need to store git-tracking refs for both local and remote-tracking branches of the git repo for the long term. See jj-vcs#1666 (comment) More refactoring will likely happen when that bug is fixed.
I now believe that jj will need to store git-tracking refs for both local and remote-tracking branches of the git repo for the long term. See jj-vcs#1666 (comment) More refactoring will likely happen when that bug is fixed.
I now believe that jj will need to store git-tracking refs for both local and remote-tracking branches of the git repo for the long term. See #1666 (comment) More refactoring will likely happen when that bug is fixed.
I think this one is settled, so closing the issue. We couldn't remove |
This will present the refs tracking the local git repo branches similarly to remote-tracking branches. This would affect:
jj log
via thebranches()
function in the templaterjj branch list
output@remote@git
. I was previously hoping to remove them entirely, but I now think they are necessary (see comment below).(might add more to the list above once I think of it)
The
@git
branch should only be shown if it differs from the local branch. The user should see this rarely. Especially in a colocated repository, if@git
ref does not match the local branch, something weird is going on. For example, the local branch might be conflicted or missing.I'm not necessarily proposing changing the way
git_refs
are stored in the view option. From the perspective ofgit_refs
, we would only display the local git branches; this is similar how we currently display tags and have the revision parser understand tags.There will still be some important user-visible differences in the way the
git
"remote" is treated compared to normal remotes.jj branch forget
should not remove the git remote ref.This would be easily observed by users, and should be documented.
In spite of the potential confusion, I think this is the best option we have. Otherwise, we'd have two choices I can think of:
Delete the git branch and git remote-tracking branch on
jj branch forget
. This would bethe only case jj does something like that outside
jj git export
. We'd also have to decidehow
jj op restore
can work when restoring past such an operation.Also, it's important to note that, currently (with git remote refs preserved),
jj branch forget && jj git export
has exactly this effect without having to do anything exceptional.Not touch them as normal. This would mean that the local branch to be immediately recreated on the next
jj git import
if either the local branch or a remote-tracking branch for it exists in the git repo.The user would have a hard time getting rid of the branch. If they delete it on the git side, it would be recreated by the next
jj git export
.jj undo
will treat it differently, at least in colocated repositoriesSee #922 and the discussion in #1541
(might add more to this list once I think of it)
Update: I previously mentined a bug report by @arxanas here, but it's not relevant. See #1714 for that.
The text was updated successfully, but these errors were encountered: