jj icon indicating copy to clipboard operation
jj copied to clipboard

Add command for recovering from sibling operation in working copy

Open martinvonz opened this issue 2 weeks ago • 5 comments

Checklist

If applicable:

  • [ ] I have updated CHANGELOG.md
  • [ ] I have updated the documentation (README.md, docs/, demos/)
  • [ ] I have updated the config schema (cli/src/config-schema.json)
  • [ ] I have added/updated tests to cover my changes

martinvonz avatar Dec 12 '25 17:12 martinvonz

If we call the flag --no-publish-operation, then jj op publish would make more sense. Plus, it avoids using the word "commit" which might be confusing (someone might ask, "What is a 'commit transaction'?").

jennings avatar Dec 12 '25 18:12 jennings

If we call the flag --no-publish-operation, then jj op publish would make more sense.

Just to clarify, you're implicitly saying that you would not like --no-integrate-operation as much, right?

martinvonz avatar Dec 12 '25 19:12 martinvonz

Yeah, my immediate thought was that it should be jj op commit because I think in terms of transactions, but that obviously has confusion with eg git commits. I dislike both jj op integrate and --no-integrate-operation because "integrate" is a brand new term for something that doesn't feel like it needs a new term (jj probably needs something new, but it can adopt something from another terminology like that of transactions). "integrate" also makes me wonder what all it's doing. "incorporate" is a little better, but sounds worse.

Put my vote down for jj op publish and --no-publish-operation. It's not a perfect fit, so I'd also go for jj op merge and --no-merge-operation, or "graft". (Both "merge" and "graft" are new terms, but at least they're borrowing from VCS terminology.)

To be fair, "integrate" isn't awful either.

hotsphink avatar Dec 12 '25 20:12 hotsphink

The idea is that the command integrates/adopts the changes in the given operation (and any ancestors that were not already integrated) into the operation log. I'm of course also fine with "publish". I think it makes sense to say that publish the operation in the operation log.

martinvonz avatar Dec 12 '25 21:12 martinvonz

I'll rename it jj op publish in a day or so if I don't hear anything more.

martinvonz avatar Dec 13 '25 01:12 martinvonz

Just to clarify, you're implicitly saying that you would not like --no-integrate-operation as much, right?

Hmm, that's probably good too, as long as they match.

@jennings: It looks like you replied to me by editing my comment. I've made the same mistake before :) Just highlighting it here so your reply doesn't go unnoticed.

martinvonz avatar Dec 15 '25 07:12 martinvonz

@jennings: It looks like you replied to me by editing my comment. I've made the same mistake before :) Just highlighting it here so your reply doesn't go unnoticed.

Oops, sorry and thanks! 🐑

jennings avatar Dec 15 '25 14:12 jennings

The idea is that the command integrates/adopts the changes in the given operation (and any ancestors that were not already integrated) into the operation log. I'm of course also fine with "publish". I think it makes sense to say that publish the operation in the operation log.

Right, I understand. To me, this is more like a "merge" action. "Publish" is ok and matches the code, but implies only "make it visible" to me. I'd half expect to end up with multiple visible op heads that live in parallel until you do something else.

"Merge" captures the idea that the effects of the operation and its unmerged ancestors will now be incorporated/integrated into the surviving op head, same as a merge in the commit graph. (But perhaps jj avoids that term in order to make multi-parented commits feel less special?)

hotsphink avatar Dec 15 '25 23:12 hotsphink

I'll rename it jj op publish in a day or so if I don't hear anything more.

I haven't done that yet because it's unclear if that's the preference. It sounds like it's a toss-up. I'll wait a bit more to see if we hear other opinions and/or arguments.

martinvonz avatar Dec 17 '25 00:12 martinvonz

Both the PR title and the command name give no clues as to what this is for, or what it does (at least to a user with limited experience).

joyously avatar Dec 17 '25 01:12 joyously

Both the PR title and the command name give no clues as to what this is for, or what it does (at least to a user with limited experience).

We review commit by commit in this project, so we often don't include much in the PR description. See the first commit description in this case.

martinvonz avatar Dec 17 '25 01:12 martinvonz

The --no-commit-transaction feature mentioned in the first commit is #2562

martinvonz avatar Dec 17 '25 01:12 martinvonz

I'll rename it jj op publish in a day or so if I don't hear anything more.

I haven't done that yet because it's unclear if that's the preference. It sounds like it's a toss-up. I'll wait a bit more to see if we hear other opinions and/or arguments.

I personally vastly prefer jj op publish over op integrate because that was what we used in previous conversations about this feature.

PhilipMetzger avatar Dec 17 '25 16:12 PhilipMetzger