-
Notifications
You must be signed in to change notification settings - Fork 343
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: Convenient names for changes #3482
Comments
Some initial thoughts:
|
I'm not opposed to changing the name if we can find a good alternative. I personally don't like "name", since I don't think
It would throw an error and say that you can use I don't see a particularly strong use case to justify multiplicity, but if we decided that we did want to support it, IMO the best way would be to have the label, when created, specify whether it supported multiple changes being associated with it. |
This is sometimes annoying for real branches, so it would be nice if we had an option or config knob to abandon commit as well as the associated branches. I'm not sure if we'll need new "alias"/"label" concept. Since jj doesn't have the current/HEAD branch, branches are conceptually bookmarks to changes. Aliases could be considered sticky variant of the branches/bookmarks. |
A CLI option makes sense to me. If we had a config option, I suppose the idea is that it makes sense for some workflows, which sounds reasonable. I think it does make sense for users of the integration at Google.
What do you mean by "sticky variant"? It seems reasonable to model them as a flag attached to a branch to say that the branch should be abandoned if the commit is abandoned. I suspect that's not what you mean by "sticky variant" because it doesn't sound like it's about stickiness. |
Exactly it. Perhaps "sticky" isn't the right word. I used it meaning the bookmark sticks to the change, and will never slide down when abandoned. |
Yet there is a PR for a flag to make branches move, so pushes to Git are easier, and Mercurial has bookmarks.
Maybe the docs should be clarified as to the |
jj is definitely its own VCS. Git is not involved in the integration we have at Google, for example. It's also not used for jj's native backend. Any reason to think it's just an interface for Git? Did our docs indicate that somewhere? We should update them in that case. |
I think Joy is asking the question rhetorically, in order to reframe the discussion in a different light. If jj isn't a wrapper to Git, then why are branches and their behaviors, such as automatic movement — a somewhat uniquely "Git" "idea" — exposed in the top-level UI? We have said multiple times (in Discord, here, elsewhere) that branches are mostly of small utility in the world of anonymous heads, where most operations revolve around the commit graph. We only really have them exposed so much because all our users are Git users, and Git users need branches to do their work. So, today they are used only for Git interop. Yet if they are exposed as a first-class concept in the UX like they are now, this makes other related features awkward to phrase and design around. This FR itself, as far as I can tell, is quite literally just asking for "bookmarks" as Mercurial calls them. The whole feature could be realized and implemented if you could do If they aren't regularly used or intended to be used outside of Git, what's even the point of putting them in the top level? Realistically, this is reminding me of the Just to be clear, I haven't thought about this actual FR very much. I'm thinking out loud and maybe we're all in violent agreement, actually. I would also like some behavior like this, because it would be useful to |
FWIW, I had a chat with a few people who were curious about jj, but were git users, a while ago. They saw value in jj, but one of the things that they really didn't like is that jj's concept of branches doesn't really map to git's concept of branches very well. IMO, @thoughtpolice's idea of turning Alternatively, if we did decide that it's not useful to propogate to the parent, maybe we should just delete branches when jj deletes a change? That might be a bit too radical of a decision though? |
I read a bunch of the docs today. One thing that is in there is that there are two backends: one with Git and a native one that you can't use. All the explanations compare and contrast with Git. I didn't see anything proving that it's a stand-alone VCS.
Not rhetorically, but also not nearly as well said as you put it.
I don't see how that would solve the original question. What you asked for was a tag. The way a |
Sorry, upon rereading it, it seems badly phrased. What I was trying to say was that if we implemented this FR, then I think we should try and imply to the user that they should be using this FR rather than branches, and that |
Just to be clear, Mercurial's bookmark does move backwards if the attached commit get discarded. Maybe it's designed with topic branches in mind? Anyway I don't think the current jj branches are Git thing, but backend agnostic. |
I dislike adding another feature for naming revisions, as we already have a I've noted before that our branches currently are very user-unfriendly (and not what a Git user expects) and would rather move to #3402 for our own equivalent of the named set of commits, which Git branches encompass. |
I don't think branches should slide backwards to begin with. git-branchless deletes the branch, and I'm actually surprised to hear that Mercurial slides it backwards. Sapling also deletes the branch (regardless of whether you address the commit via hash or branch):
|
I think neither are the case for topics, either. @matts1 can you compare/contrast with topics as described there? Do they solve your problem? |
If we changed the behaviour to this, I'd be perfectly happy to close this FR as unnecessary. I'd prefer just changing the behaviour over this FR, actually. I might pull this out into a seperate discussion.
The primary differences between this and topics would be:
|
Another usecase for labels (or any other per-change metadata): I could mark "important" commits with a label. For example, if someone made a commit with a change that I wanted to make, and then went on vacation, I'd like this commit to hang out in my |
Is your feature request related to a problem? Please describe.
There are two related problems here that this FR is designed to solve:
jj new <alias>
Similarly, it'd be nice to be able to write
crrev.com/c/5439098
Describe the solution you'd like
I'd like to add a command
jj alias
. This would be almost the same command asjj branch
- it would have the following subcommands:jj alias add <revision> <alias> --force
--force
would move the alias to here even if it was previously defined elsewherejj alias remove <alias>
Aliases would be associated with a change, and thus would persist across rewrites. The main distinction between aliases and branches are that:
Similar to branches, you could write
jj alias add @- foo
, then later runjj new foo
Describe alternatives you've considered
Branches
When I asked about this earlier, branches are the currently recommended solution for such an approach. However, the problem is that a branch is not associated with a particular change. Consider:
If I were to write
jj abandon foo
, then the branchfoo
would instead move tomain
. The same thing would happen if I were to submit foo, then later runjj rebase --skip-empty
.Tags:
I considered just using git tags for this, and just calling them tags, but @martinvonz pointed out that might be confusing since tags are associated with a commit, rather than a change.
Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: