-
Notifications
You must be signed in to change notification settings - Fork 356
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
jj prev
moves back by two revisions if @
has no children but is not empty
#3426
Comments
I do not think this is a bug, it may be unexpected as the working copy is not treated as a "finished" commit but that is entirely accurate. It just does a |
I agree, I would not call it a bug; it's working as intended. But our intentions of course change if we think the current behavior is confusing. I know @hooper was also confused about the current behavior. Maybe |
I think that the change I'm proposing would make the default behavior of The current behavior might be consistent, but I think that it reduces usability. Edit: It's not doing |
While a empty working copy is abandoned by other commands operating on the graph, I can't see Here I am actually strongly in favor of keeping consistency.
Define me "normal", it is just a unwritten expectation that the movement should work like
This is purely a user perspective. Please read this Discord thread for the last discussion and my opinion on it. |
I don't understand this point. What do you mean by "adjust the working copy"? I want
Can you expand on this? I usually view |
Fair point.
Why do you not use
I'm just the implementor and a frequent user, which never thought of this use-case until now. I'm sure another user will have a differing perspective, so I'd rather wait until we have conclusive evidence that this won't work longterm. |
I realized something important. Earlier you said:
This is wrong, isn't it? It's actually doing
I mean, why does
I really want to push back on the idea that this is a bad thing. I'm just another user like you said, but to me at least it really does seem like a completely empty Edit: The
|
I am playing around with this and noticed that this text expectation is wrong:
Edit: I opened #3430 to fix this and review the other tests. I'll mail it out when I finish going through them. |
The revset I posted initially was simplified, it actually uses this revset See for yourself here:
But it really isn't, we just cleanup our garbage after moving off empty commits (we'd just have to many empty heads lying around, if it weren't done) and while
I still disagree, they only get garbage collected automatically, which is a UI distinction not one in code or in a backend. |
How they get garbage collected doesn't really matter. My point is that If we set aside philosophical objections about treating discardable commits differently, I think these changes would make the command more useful and consistent:
|
I said it doesn't and pointed you to the code, what more can I do to convince you?
As I've said, it takes time to get used to but is actually quite nice. |
Sorry, I am clearly misunderstanding something. I will take another look. |
I am squinting hard, but doesn't I'm sorry I just don't understand what you mean. Can you give an example or point out exactly what I said that's incorrect? |
Before this change, `jj prev` does this: ``` jj log -T 'separate(" ",change_id.short(), description)' @ umspkqwnpqvx add file2 ◉ nprzlkrnkpuu add file1 ◉ zzzzzzzzzzzz jj prev Working copy now at: otzuvlqz 21a57e68 (empty) (no description set) Parent commit : zzzzzzzz 00000000 (empty) (no description set) Added 0 files, modified 0 files, removed 2 files jj log -T 'separate(" ",change_id.short(),description)' @ otzuvlqzsrxt │ ◉ umspkqwnpqvx add file2 │ ◉ nprzlkrnkpuu add file1 ├─╯ ◉ zzzzzzzzzzzz ``` After, it does this: ``` jj log -T 'separate(" ",change_id.short(), description)' @ okxltnqrlpsr │ ◉ umspkqwnpqvx add file2 ├─╯ ◉ nprzlkrnkpuu add file1 ◉ zzzzzzzzzzzz ``` There is more discussion about this change in #3426. This commit also allows `jj prev` to run when `@` is a merge commit. Previously it refused to do this.
@PhilipMetzger and @martinvonz, when you have time, please take a look at the two pull requests below. I think they will make things clearer and I'm sorry about any confusion I might have caused in the discussion so far. The first one addresses a few issues and inconsistencies in the tests for The second pull request is my suggestion for how we should change this command to make it more useful when |
Before this change, `jj prev` does this: ``` jj log -T 'separate(" ",change_id.short(), description)' @ umspkqwnpqvx add file2 ◉ nprzlkrnkpuu add file1 ◉ zzzzzzzzzzzz jj prev Working copy now at: otzuvlqz 21a57e68 (empty) (no description set) Parent commit : zzzzzzzz 00000000 (empty) (no description set) Added 0 files, modified 0 files, removed 2 files jj log -T 'separate(" ",change_id.short(),description)' @ otzuvlqzsrxt │ ◉ umspkqwnpqvx add file2 │ ◉ nprzlkrnkpuu add file1 ├─╯ ◉ zzzzzzzzzzzz ``` After, it does this: ``` jj log -T 'separate(" ",change_id.short(), description)' @ okxltnqrlpsr │ ◉ umspkqwnpqvx add file2 ├─╯ ◉ nprzlkrnkpuu add file1 ◉ zzzzzzzzzzzz ``` There is more discussion about this change in #3426. This commit also allows `jj prev` to run when `@` is a merge commit. Previously it refused to do this.
Before this change, `jj prev` does this: ``` jj log -T 'separate(" ",change_id.short(), description)' @ umspkqwnpqvx add file2 ◉ nprzlkrnkpuu add file1 ◉ zzzzzzzzzzzz jj prev Working copy now at: otzuvlqz 21a57e68 (empty) (no description set) Parent commit : zzzzzzzz 00000000 (empty) (no description set) Added 0 files, modified 0 files, removed 2 files jj log -T 'separate(" ",change_id.short(),description)' @ otzuvlqzsrxt │ ◉ umspkqwnpqvx add file2 │ ◉ nprzlkrnkpuu add file1 ├─╯ ◉ zzzzzzzzzzzz ``` After, it does this: ``` jj log -T 'separate(" ",change_id.short(), description)' @ okxltnqrlpsr │ ◉ umspkqwnpqvx add file2 ├─╯ ◉ nprzlkrnkpuu add file1 ◉ zzzzzzzzzzzz ``` There is more discussion about this change in #3426. This commit also allows `jj prev` to run when `@` is a merge commit. Previously it refused to do this.
…f `@-` Before this change, `jj prev` does this: ``` jj log -T 'separate(" ",change_id.short(), description)' @ umspkqwnpqvx add file2 ◉ nprzlkrnkpuu add file1 ◉ zzzzzzzzzzzz jj prev jj log -T 'separate(" ",change_id.short(),description)' @ otzuvlqzsrxt │ ◉ umspkqwnpqvx add file2 │ ◉ nprzlkrnkpuu add file1 ├─╯ ◉ zzzzzzzzzzzz ``` After, it does this: ``` jj log -T 'separate(" ",change_id.short(), description)' @ okxltnqrlpsr │ ◉ umspkqwnpqvx add file2 ├─╯ ◉ nprzlkrnkpuu add file1 ◉ zzzzzzzzzzzz ``` And `jj prev 2` does this: ``` jj log -T 'separate(" ",change_id.short(),description)' @ otzuvlqzsrxt │ ◉ umspkqwnpqvx add file2 │ ◉ nprzlkrnkpuu add file1 ├─╯ ◉ zzzzzzzzzzzz ``` Without this change it is impossible to create a new commit on `@-` using `jj prev`. After this change it is still possible to create a new commit on top of `@--` (the previous default behavior) specifying an offset of 2. There is more discussion about this change in #3426. This commit also allows `jj prev` to run when `@` is a merge commit. Previously it refused to do this.
This will hopefully make it clear that `jj prev` does not move by [OFFSET] relative to `@`, which is a misconception that I had and I think others may also have. I am suggesting this change as a result of the vigorous discussion in these two issues: - #3426 - #3445 We should make similar changes to `jj next` as well since it follows similar rules.
Hi everyone, thank you for all the time you've invested in discussing what ultimately seems to be a misunderstanding on my part. I'm going to close this issue and have opened a new one to adjust the documentation to hopefully make things clearer for people like me. Looking forward to your feedback there. Thank you! |
This will hopefully make it clear that `jj prev` does not move by [OFFSET] relative to `@`, which is a misconception that I had and I think others may also have. I am suggesting this change as a result of the vigorous discussion in these two issues: - #3426 - #3445 We should make similar changes to `jj next` as well since it follows similar rules.
This will hopefully make it clear that `jj prev` does not move by [OFFSET] relative to `@`, which is a misconception that I had and I think others may also have. I am suggesting this change as a result of the vigorous discussion in these two issues: - #3426 - #3445 We should make similar changes to `jj next` as well since it follows similar rules.
This will hopefully make it clear that `jj prev` does not move by [OFFSET] relative to `@`, which is a misconception that I had and I think others may also have. I am suggesting this change as a result of the vigorous discussion in these two issues: - #3426 - #3445 We should make similar changes to `jj next` as well since it follows similar rules.
This will hopefully make it clear that `jj prev` does not move by [OFFSET] relative to `@`, which is a misconception that I had and I think others may also have. I am suggesting this change as a result of the vigorous discussion in these two issues: - #3426 - #3445 We should make similar changes to `jj next` as well since it follows similar rules.
This will hopefully make it clear that `jj prev` does not move by [OFFSET] relative to `@`, which is a misconception that I had and I think others may also have. I am suggesting this change as a result of the vigorous discussion in these two issues: - #3426 - #3445 We should make similar changes to `jj next` as well since it follows similar rules.
Description
Here's an example:
Expected Behavior
I expect the state after
jj prev
to be this instead:How to fix
I suppose it works this way because I do expect it to move by two if
@
is empty:I think my expectation is that
jj prev
will move back by one if the@
revision will be abandoned once another revision is checked out (i.e. because it has no description changes). If the@
revision will not be abandoned, thenjj prev
should only move back by one.The text was updated successfully, but these errors were encountered: