Skip to content
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

Parents are forgotten when moving changes out of a merge commit #2859

Open
thoughtpolice opened this issue Jan 21, 2024 · 20 comments
Open

Parents are forgotten when moving changes out of a merge commit #2859

thoughtpolice opened this issue Jan 21, 2024 · 20 comments
Labels
🐛bug Something isn't working

Comments

@thoughtpolice
Copy link
Collaborator

thoughtpolice commented Jan 21, 2024

@  mq ⇜  <[email protected]> [17 seconds ago] c2907734
│  (empty) (no description set)
◉  mu ⇜  <[email protected]> [12 hours ago] aseipp/push-mupwvrwmxuvm HEAD@git 67ef0949
│  cli: global `--show-heap-stats` argument for EOL heap stats
◉  yrzw ⇜  <[email protected]> [12 hours ago] 06d4d3f4
│  cli: use mimalloc from `jj-cbits` as the default memory allocator
◉  yu ⇜  <[email protected]> [12 hours ago] b3026ea4
│  cbits: implement `MiMalloc` for use with `#[global_allocator]`
◉  rr ⇜  <[email protected]> [12 hours ago] f5a2e5ff
│  cbits: import and build mimalloc v2.1.2
◉  xu ⇜  <[email protected]> [12 hours ago] d2d990d4
│  cbits: initialize new `jj-cbits` library
│ ◉  mzo ⇜  <[email protected]> [11 hours ago] aseipp/push-mzomwyvlpnxp 264e0aff
├─╯  nix: use mold linker on Linux
│ ◉  uyt ⇜  <[email protected]> [14 hours ago] aseipp/push-uytvkxyqyspn 4fb99d43
│ │  cli: basic `jj gerrit mail` implementation
│ ◉  vz ⇜  <[email protected]> [15 hours ago] ea35de20
├─╯  lib: add `footer` module for commit footers
│ ◉  tl ⇜  <[email protected]> [18 hours ago] push-tlpqtmtonpqp 8a03fdd7
├─╯  cargo: specify MSRV in rust-toolchain.toml
◉  unm ⇜  <[email protected]> [19 hours ago] main* 0af1a151
│  cli: move `RepoBranchName(Pattern)` to `crate::cli_utils`

Create a merge:

austin@GANON:~/src/jj$ jj new mu mzo uyt
austin@GANON:~/src/jj$ jj
@      wt ⇜  <[email protected]> [2 seconds ago] 47e60c40
├─┬─╮  (empty) (no description set)
│ │ ◉  uyt ⇜  <[email protected]> [14 hours ago] aseipp/push-uytvkxyqyspn 4fb99d43
│ │ │  cli: basic `jj gerrit mail` implementation
│ │ ◉  vz ⇜  <[email protected]> [15 hours ago] ea35de20
│ │ │  lib: add `footer` module for commit footers
│ ◉ │  mzo ⇜  <[email protected]> [11 hours ago] aseipp/push-mzomwyvlpnxp 264e0aff
│ ├─╯  nix: use mold linker on Linux
◉ │  mu ⇜  <[email protected]> [12 hours ago] aseipp/push-mupwvrwmxuvm HEAD@git 67ef0949
│ │  cli: global `--show-heap-stats` argument for EOL heap stats
◉ │  yrzw ⇜  <[email protected]> [12 hours ago] 06d4d3f4
│ │  cli: use mimalloc from `jj-cbits` as the default memory allocator
◉ │  yu ⇜  <[email protected]> [12 hours ago] b3026ea4
│ │  cbits: implement `MiMalloc` for use with `#[global_allocator]`
◉ │  rr ⇜  <[email protected]> [12 hours ago] f5a2e5ff
│ │  cbits: import and build mimalloc v2.1.2
◉ │  xu ⇜  <[email protected]> [12 hours ago] d2d990d4
├─╯  cbits: initialize new `jj-cbits` library

Now, modify a file, then move the change out:

austin@GANON:~/src/jj$ echo >> README.md
austin@GANON:~/src/jj$ jj move --from @ --to mu

The merge commit gets undone, because a new wcc is created (nuz) without the parents of the original wt:

@  nuz ⇜  <[email protected]> [4 seconds ago] 447e876b
│  (empty) (no description set)
◉  mu ⇜  <[email protected]> [4 seconds ago] aseipp/push-mupwvrwmxuvm* HEAD@git 97ff26dd
│  cli: global `--show-heap-stats` argument for EOL heap stats
◉  yrzw ⇜  <[email protected]> [12 hours ago] 06d4d3f4
│  cli: use mimalloc from `jj-cbits` as the default memory allocator
◉  yu ⇜  <[email protected]> [12 hours ago] b3026ea4
│  cbits: implement `MiMalloc` for use with `#[global_allocator]`
◉  rr ⇜  <[email protected]> [12 hours ago] f5a2e5ff
│  cbits: import and build mimalloc v2.1.2
◉  xu ⇜  <[email protected]> [12 hours ago] d2d990d4
│  cbits: initialize new `jj-cbits` library
│ ◉  mzo ⇜  <[email protected]> [11 hours ago] aseipp/push-mzomwyvlpnxp 264e0aff
├─╯  nix: use mold linker on Linux
│ ◉  uyt ⇜  <[email protected]> [14 hours ago] aseipp/push-uytvkxyqyspn 4fb99d43
│ │  cli: basic `jj gerrit mail` implementation
│ ◉  vz ⇜  <[email protected]> [15 hours ago] ea35de20
├─╯  lib: add `footer` module for commit footers
│ ◉  tl ⇜  <[email protected]> [18 hours ago] push-tlpqtmtonpqp 8a03fdd7
├─╯  cargo: specify MSRV in rust-toolchain.toml
◉  unm ⇜  <[email protected]> [19 hours ago] main* 0af1a151
╷  cli: move `RepoBranchName(Pattern)` to `crate::cli_utils`

As Martin noted on Discord, this also happens with jj abandon, so after getting to the above state, you can do:

austin@GANON:~/src/jj$ jj undo # bring back merge
austin@GANON:~/src/jj$ jj abandon # throw it away

And it will result in the same state as above, i.e. the parents are gone and you end up on the left-most parent.

@thoughtpolice thoughtpolice changed the title Parents are forgotten when moveing out of a merge commit Parents are forgotten when moving changes out of a merge commit Jan 21, 2024
@PhilipMetzger PhilipMetzger added the 🐛bug Something isn't working label Jan 21, 2024
@ilyagr
Copy link
Collaborator

ilyagr commented Jan 21, 2024

This is technically related to the problem with automatically abandoned commits discussed here: #2766 (comment) .

They are still two separate problems, but the solution might lurk in similar parts of the code.

For this specific issue, Martin suggested:

jj/lib/src/rewrite.rs

Lines 461 to 462 in 0af1a15

// We arbitrarily pick a new working-copy commit among the candidates.
self.update_wc_commits(&old_commit_id, &new_commit_ids[0], edit)?;

@ilyagr
Copy link
Collaborator

ilyagr commented Jan 21, 2024

A separate thought: if we fix this, jj abandon will make @ an empty merge commit if @ was a merge commit before. We should probably make sure that a subsequent jj new somewhere_else abandons that empty merge commit. So, it should abandon any empty merge commits with no description.

This is because I'm worried about the use-case of a user doing jj new a b, and then wanting to undo that with jj abandon. Currently, that works, and is one of the more intuitive ways to get rid of the merge commit. With the proposed functionality, jj abandon will be a no-op if the working-copy is an empty commit with no description. If we fix this bug and do nothing else, you'd need to use either jj undo (after fidning the right opid), or jj co somewhere_else && jj abandon merge_commit, which is not nice. However, this might be OK if jj new somewhere_else gets rid of such commits.

@yuja
Copy link
Collaborator

yuja commented Jan 22, 2024

a user doing jj new a b, and then wanting to undo that with jj abandon.

Doesn't it abandon the @ and create new wc commit from one of the merge parents? I don't think we'll need a special case on jj new somewhere_else. If the merge commit is explicitly abandoned, it should be abandoned. If the merge commit is emptied, it shouldn't be abandoned automatically.

@ilyagr
Copy link
Collaborator

ilyagr commented Jan 22, 2024

@yuja, I'm no sure exactly what you mean since there are already so many related issues and behaviors. Here's some of my reasoning:

  • This bug is about jj move --from @ --to somewhere_else where @ is a merge commit. Currently, this leaves @ as a child of one of the merge parents. The goal of this issue, as I understand it, is for @ to become a new empty merge commit instead.
  • For consistency, jj move --from @ --to somewhere_else should result in the same graph shape as jj abandon @. I suppose this is arguable, but this seems very desirable to me.
  • So, while currently jj abandon @ creates a new wc commit from one of the merge parents (as you said), if we fix this bug, we'd want jj abandon @ to create an empty merge commit instead.
  • This behavior could be confusing if @ is already an empty merge commit that the user wants to get rid of.

And a separate chain of logic:

  • Currently, jj new somewhere_else abandons @ if it's an empty commit with one parent and no description.
  • It would be logically consistent for jj new somewhere_else to abandon @ if it's an empty commit with any number of parents and no description.
  • The second behavior seems to make a lot of sense if we change the behavior of jj abandon as I described above. This wouldn't change what I called a "confusing behavior" above, but it would provide a sensible alternative for a user who wants to get rid of a merge commit. The behavior would be completely analogous to what happens if you try to abandon a working copy with one parent with jj abandon. Hopefully, this analogy will make the behavior easy to remember and feel somewhat intuitive.

@yuja
Copy link
Collaborator

yuja commented Jan 22, 2024

  • This bug is about jj move --from @ --to somewhere_else where @ is a merge commit. Currently, this leaves @ as a child of one of the merge parents. The goal of this issue, as I understand it, is for @ to become a new empty merge commit instead.

I expect the resulting empty merge would be rewritten from the @, not created from scratch. IMHO, move has two steps:

  1. move (some of the) source contents to the destination
  2. abandon if the source is discardable.

Because a merge commit isn't discardable, 2 should be skipped.

  • For consistency, jj move --from @ --to somewhere_else should result in the same graph shape as jj abandon @. I suppose this is arguable, but this seems very desirable to me.

If @ is discardable, I agree.

  • So, while currently jj abandon @ creates a new wc commit from one of the merge parents (as you said), if we fix this bug, we'd want jj abandon @ to create an empty merge commit instead.

I expect jj abandon @ will forget the old working-copy commit was previously a merge because I explicitly abandoned @ (including tree and commit metadata.)

And a separate chain of logic:

  • Currently, jj new somewhere_else abandons @ if it's an empty commit with one parent and no description.
  • It would be logically consistent for jj new somewhere_else to abandon @ if it's an empty commit with any number of parents and no description.

I disagree. A merge commit isn't usually noop, so it shouldn't be discarded implicitly. Otherwise, the merged state would be lost by jj new x y && cargo build ... && jj new some_other_branch.

@ilyagr
Copy link
Collaborator

ilyagr commented Jan 22, 2024

Because a merge commit isn't discardable, 2 should be skipped.

Interesting, I think I understand your point of view. It is quite different from my mental model, but seems also self-consistent. I feel slightly less comfortable with it, but probably just because it feels a bit unfamiliar for now.

IIUC, in your language, I was suggesting changing the definition of "discardable" commits to include empty merge commits with no description. You are suggesting keeping the definition as-is, and merely having commands like jj move use this same definition to decide whether to keep this commit.

The main practical difference is this: in my model, jj move --from @ --to somewhere_else will recreate a new empty working copy, changing its change id. On the other hand, in your model, the now-empty working copy is still not "discardable" after the jj move. So, it will be empty, but it will not be abandoned. The change id of the working copy will remain the same.

I feel slightly bothered by the inconsistency between jj move --from @ --to somewhere_else keeping the change id and jj abandon @ changing the change id. But, with your perspective, it makes sense.

OTOH, the benefit of your perspective is that we can use the same notion of "discardable" here as we do in jj rebase --skip-emptied.

In any case, it is a good point that there is a self-consistent model that doesn't require jj move and jj abandon to be quite as analogous as I thought they had to be.

I disagree. A merge commit isn't usually noop, so it shouldn't be discarded implicitly. Otherwise, the merged state would be lost by jj new x y && cargo build ... && jj new some_other_branch.

If you wanted to keep the merge commit, you could just jj new x y -m 'Merge' instead (in my model). I don't feel very strongly that one way or the other is more convenient, I'm mainly worried about which way is less surprising overall (and I don't know).


Overall, I don't see a serious problem with either of our approaches at the moment. We should document whichever approach we choose, as they are subtly different.

@yuja
Copy link
Collaborator

yuja commented Jan 22, 2024

I was suggesting changing the definition of "discardable" commits to include empty merge commits with no description. You are suggesting keeping the definition as-is, and merely having commands like jj move use this same definition to decide whether to keep this commit.

Yes. A merge commit isn't garbage, so keep it. If it were a garbage, we wouldn't have to fix jj move to recreate/preserve the merge.

@ilyagr
Copy link
Collaborator

ilyagr commented Jan 22, 2024

SGTM, let's try the approach that makes more sense to you, it seems just fine to me.

I still find it fascinating that there are two possibilities where I only saw one.

@martinvonz
Copy link
Owner

I use jj abandon all the time start over. It's surprising to me if I can't use that because my current commit has multiple parents.

I've been arguing that jj understands merges well enough that there's no such thing as an "evil merge" and that user can use merge commits just like regular commits. So I think empty merge commits without descriptions are as discardable. I know we consider merge commits not discardable in Commit::is_discardable(). I haven't checked (or thought much about) what the consequences of changing that would be.

@martinvonz
Copy link
Owner

I haven't checked (or thought much about) what the consequences of changing that would be.

Turns out there's no impact on existing tests. I'm a bit surprised by that. I guess we need a bit more test coverage.

@ilyagr
Copy link
Collaborator

ilyagr commented Jan 22, 2024

I use jj abandon all the time start over. It's surprising to me if I can't use that because my current commit has multiple parents.

Actually, on second thought, this does seem like a problem with @yuja 's model. @yuja, what should the result of jj abandon be in your model if @ is an empty merge commit? How does one get rid of such a commit?

I think that in both of our models, as far as I understand them, the result of jj abandon would be an empty merge commit (possibly with a different change id). However, with my suggestion, jj new somewhere_else would get rid of it. With @yuja 's model, you'd have to first do jj new somewhere_else and then do jj abandon old_working_copy (after having to look up its change id). Did I miss a better way?

Another option would be to have jj abandon work as it does now for merge commit -- making the new working copy the child of the first parent -- but that choice seems a little arbitrary.

@thoughtpolice
Copy link
Collaborator Author

thoughtpolice commented Jan 22, 2024

So I will say that after I filed this I "fixed" it by doing simply giving the empty merge commit a description, then new again. So my tree now looks like this:

@  or ⇜  <[email protected]> [now] c00b8b64
│  (empty) (no description set)
◉    pv ⇜  <[email protected]> [now] HEAD@git ef28569f
├─╮  (empty) merge: austin's branch
│ ◉  uyt ⇜  <[email protected]> [17 minutes ago] aseipp/push-uytvkxyqyspn* 5e9cdd70
│ │  cli: basic `jj gerrit mail` implementation
│ ◉  vz ⇜  <[email protected]> [17 minutes ago] 8703d42a
│ │  lib: add `footer` module for commit footers
◉ │  mu ⇜  <[email protected]> [17 minutes ago] aseipp/push-mupwvrwmxuvm* 280fd843
│ │  cli: global `--show-heap-stats` argument for EOL heap stats
◉ │  yrzw ⇜  <[email protected]> [17 minutes ago] 5a4252db
│ │  cli: use mimalloc from `jj-cbits` as the default memory allocator
◉ │  yu ⇜  <[email protected]> [17 minutes ago] e8b462c3
│ │  cbits: implement `MiMalloc` for use with `#[global_allocator]`
◉ │  rr ⇜  <[email protected]> [17 minutes ago] 0d247ae8
│ │  cbits: import and build mimalloc v2.1.2
◉ │  xu ⇜  <[email protected]> [17 minutes ago] e7b024ca
├─╯  cbits: initialize new `jj-cbits` library
◉  wrt ⇜  <[email protected]> [20 minutes ago] main* c8271f76
╷  nix: use mold linker on Linux

This actually allows me to move changes "past" the merge, as I would expect, without the awkward behavior of the original comment.

There's another set of odd interactions here that may be the same symptom. Let's say that @ is set to pv in the above example, so I'm on the merge commit itself, not a wcc on top.

Now, fill the (previously empty) merge commit with a change:

austin@GANON:~/src/jj$ echo >> README.md
austin@GANON:~/src/jj$ jj -r @ --stat
@  pv ⇜  <[email protected]> [6 seconds ago] 6ffb95a4
│  merge: austin's branch
~  README.md | 1 +
   1 file changed, 1 insertion(+), 0 deletions(-)

Now let's create a new commit on top, and then try to unamend from the merge commit to its child, to move the previous change out of the merge:

austin@GANON:~/src/jj$ jj new
Working copy now at: mp ⇜  528ad8a1 (empty) (no description set)
Parent commit      : pv ⇜  6ffb95a4 merge: austin's branch
austin@GANON:~/src/jj$ jj unamend
Working copy now at: mp ⇜  0b8c5028 merge: austin's branch
Parent commit      : mu ⇜  280fd843 aseipp/push-mupwvrwmxuvm* | cli: global `--show-heap-stats` argument for EOL heap stats
Parent commit      : uyt ⇜  5e9cdd70 aseipp/push-uytvkxyqyspn* | cli: basic `jj gerrit mail` implementation

What happened? It looked like a no-op!

austin@GANON:~/src/jj$ jj
@    mp ⇜  <[email protected]> [2 seconds ago] 0b8c5028
├─╮  merge: austin's branch
│ ◉  uyt ⇜  <[email protected]> [21 minutes ago] aseipp/push-uytvkxyqyspn* 5e9cdd70
│ │  cli: basic `jj gerrit mail` implementation
│ ◉  vz ⇜  <[email protected]> [21 minutes ago] 8703d42a
│ │  lib: add `footer` module for commit footers
...

pv was effectively replaced by mp. In this case the logic was that the merge commit was discardable because it was empty; so it was replaced by its fresly created child mp, and it did did inherit the parents. Strange!

It's actually quite awkward to get out of this state now! Because you can't just move it out of the merge directly due to this behavior, you have to create two new working copy commits:

austin@GANON:~/src/jj$ jj new; jj new; jj
@  yy ⇜  <[email protected]> [11 seconds ago] 8d257425
│  (empty) (no description set)
◉  ov ⇜  <[email protected]> [11 seconds ago] HEAD@git bd96679e
│  (empty) (no description set)
◉    mp ⇜  <[email protected]> [4 minutes ago] 0b8c5028
├─╮  merge: austin's branch
...

Then move the change from the merge into @, past the intermediate. This then "collapses" the merge commit and again replaces it with ov, resulting in the state we had before:

austin@GANON:~/src/jj$ jj move --from mp --to @
Working copy now at: yy ⇜  f8f98be3 merge: austin's branch
Parent commit      : ov ⇜  f4d8bf03 (empty) (no description set)
austin@GANON:~/src/jj$ jj
@  yy ⇜  <[email protected]> [1 second ago] f8f98be3
│  merge: austin's branch
◉    ov ⇜  <[email protected]> [1 second ago] HEAD@git f4d8bf03
├─╮  (empty) (no description set)

This all makes perfect sense with the current behavior. But I don't know how sensible it actually is. :)

EDIT: Also I find it rather hilarious that this whole process ended up with merge: austin's branch on top. Like playing a game of musical chairs only for two people to swap places, in the end.

@martinvonz
Copy link
Owner

pv was effectively replaced by mp. In this case the logic was that the merge commit was discardable because it was empty; so it was replaced by its fresly created child mp, and it did did inherit the parents. Strange!

That's actually what I would have expected :) What did you expect?

@yuja
Copy link
Collaborator

yuja commented Jan 22, 2024

I use jj abandon all the time start over. It's surprising to me if I can't use that because my current commit has multiple parents.

Actually, on second thought, this does seem like a problem with @yuja 's model. @yuja, what should the result of jj abandon be in your model if @ is an empty merge commit? How does one get rid of such a commit?

jj abandon @ should just work. It'll abandon the @ (no matter if it has a content, description, multiple parents, etc.) and create new @ on one of the parents.
is_discardable() only applies to the commits that become empty because of jj move/rebase/etc. Does that make sense?

@martinvonz
Copy link
Owner

martinvonz commented Jan 22, 2024

jj abandon @ should just work. It'll abandon the @ (no matter if it has a content, description, multiple parents, etc.) and create new @ on one of the parents.

Right, that's what it currently does, and what I saw (and see) as a bug. I would expect jj abandon to be useful as a git reset --hard/hg revert -a equivalent whether or not the working-copy commit has multiple parents. Oh, I guess the comparison with git and hg was actually not good because I think they both undo the merge operation :) I would want to be able to do jj new x y z; <edit some file>; jj abandon and still have x, y, and z as parents.

@yuja
Copy link
Collaborator

yuja commented Jan 22, 2024

I would want to be able to do jj new x y z; <edit some file>; jj abandon and still have x, y, and z as parents.

Interesting. I've never considered that way. I expect jj abandon resets to the default state, which is in my mental model, a checkout with one parent.

In any case, I wouldn't want my empty merge commit get abandoned by jj new somewhere_else.

@martinvonz
Copy link
Owner

In any case, I wouldn't want my empty merge commit get abandoned by jj new somewhere_else.

If it has no description and no changes, is it still useful? The only information it carries seems to be the set of parents then. I can see that having some value, perhaps as a reminder to yourself that you plan to do something with the merge. Do you think it would be annoying to have to get used to adding a description for merge commits you want to keep (if they're also empty and head commits)?

@yuja
Copy link
Collaborator

yuja commented Jan 22, 2024

In any case, I wouldn't want my empty merge commit get abandoned by jj new somewhere_else.

If it has no description and no changes, is it still useful? The only information it carries seems to be the set of parents then. I can see that having some value, perhaps as a reminder to yourself that you plan to do something with the merge. Do you think it would be annoying to have to get used to adding a description for merge commits you want to keep (if they're also empty and head commits)?

Well, I could pass -m wip to preserve the merge, but I would find it's surprising if the commit I made explicitly gets abandoned as a side effect of another checkout. Perhaps, it's mental model mismatch. I usually use jj co to "check out" a revision, so the @ commit is kinda implicitly created, and I'm not interested in it. OTOH, when I do jj new x y, I intentionally create a new merge commit.

That said, I have to agree that it would be confusing if jj new x y && jj abandon && jj new z leave an empty merge because the second empty merge is created implicitly by jj abandon. If we choose this jj abandon behavior, an empty merge would have to be discarded.

@ilyagr
Copy link
Collaborator

ilyagr commented Jan 22, 2024

Well, I could pass -m wip to preserve the merge, but I would find it's surprising if the commit I made explicitly gets abandoned as a side effect of another checkout.

This happens already if you do jj new a && jj new b; the first of these is abandoned. I suppose that, even though this seems completely analogous, it is harder to notice for the user since the shape of the graph doesn't obviously change (unless they pay attention to the change id).

Update: On second thought, the shape of the graph presentation does change sometimes from this behavior, because the new commit has a newer date, and the way jj log is shown depends on how old commits are. I remember finding this confusing for a little bit, until I figured out what's going on.


Right now, the two options I see are either what I suggested (making empty no-description commits discardable regardless of the number of parents) or to special-case jj abandon so that, if @ had multiple parents, it creates a new working copy with one parent (probably the first parent). With the second option, abandon would be a special case since I'm assuming that we also make jj move --to somewhere and similar commands preserve the shape of the graph.

I have a preference for the first option, but not a strong one. I think both of these have advantages -- the first one seems more theoretically pure and IMO easier to remember, but the second one might be less surprising in some situations. I wonder if there's a third option.

@yuja
Copy link
Collaborator

yuja commented Jan 22, 2024

Right now, the two options I see are either what I suggested (making empty no-description commits discardable regardless of the number of parents) or to special-case jj abandon so that, if @ had multiple parents, it creates a new working copy with one parent (probably the first parent). With the second option, abandon would be a special case since I'm assuming that we also make jj move --to somewhere and similar commands preserve the shape of the graph.

Just a comment. IMHO, it's whether the workspace (conceptually) remembers the previous state or not. I just feel it's unusual that jj abandon @ recreates the merge because there's no @ in the DAG after abandon. To me, the new @ is always picked arbitrary (but in least surprising way.)

ilyagr added a commit to ilyagr/jj that referenced this issue Jan 23, 2024
… empty `@`

This demonstrates the minor bug discussed in
martinvonz#2766 (comment)
AKA martinvonz#2869.

It's also interesting whether changing the definition of "discardable" commit
would affect this test, see
martinvonz#2859 (comment)

(I think it won't, but still)
ilyagr added a commit to ilyagr/jj that referenced this issue Jan 23, 2024
… empty `@`

This demonstrates the minor bug discussed in
martinvonz#2766 (comment)
AKA martinvonz#2869.

It's also interesting whether changing the definition of "discardable" commit
would affect this test, see
martinvonz#2859 (comment)

(I think it won't, but still)
ilyagr added a commit to ilyagr/jj that referenced this issue Jan 23, 2024
… empty `@`

This demonstrates the minor bug discussed in
martinvonz#2766 (comment)
AKA martinvonz#2869.

It's also interesting whether changing the definition of "discardable" commit
would affect this test, see
martinvonz#2859 (comment)

(I think it won't, but still)
ilyagr added a commit to ilyagr/jj that referenced this issue Jan 23, 2024
…est case

This demonstrates the minor bug discussed in
martinvonz#2766 (comment)
AKA martinvonz#2869.

It's also interesting whether changing the definition of "discardable" commit
would affect this test, see
martinvonz#2859 (comment)

(I think it won't, but still)
ilyagr added a commit that referenced this issue Jan 23, 2024
…est case

This demonstrates the minor bug discussed in
#2766 (comment)
AKA #2869.

It's also interesting whether changing the definition of "discardable" commit
would affect this test, see
#2859 (comment)

(I think it won't, but still)
martinvonz added a commit that referenced this issue May 28, 2024
I recently needed to test something on top of a two branches at the
same time, so I created a new commit on top of both of them (i.e. a
merge commit). I then ran tests and made some adjustments to the
code. These adjustments belonged in one of the parent branches, so I
used `jj squash --into` to squash it in there. Unfortunately, that
meant that my working copy became a single-parent commit based on one
of the branches only. We already had #2859 for tracking this issue.

This patch changes the behavior so we create a new working-copy commit
with all of the previous parents.
martinvonz added a commit that referenced this issue May 28, 2024
Merge commits are very similar to non-merge commits in jj. An empty
merge commit with no description is not really different from an empty
non-merge commit with no description. As we discussed on
#2859, we should not treat
merge commits differently when updating away from them. This patch
adds test for the current behavior (which is to leave the merge commit
in place).
martinvonz added a commit that referenced this issue May 28, 2024
I recently needed to test something on top of a two branches at the
same time, so I created a new commit on top of both of them (i.e. a
merge commit). I then ran tests and made some adjustments to the
code. These adjustments belonged in one of the parent branches, so I
used `jj squash --into` to squash it in there. Unfortunately, that
meant that my working copy became a single-parent commit based on one
of the branches only. We already had #2859 for tracking this issue.

This patch changes the behavior so we create a new working-copy commit
with all of the previous parents.
martinvonz added a commit that referenced this issue May 28, 2024
Merge commits are very similar to non-merge commits in jj. An empty
merge commit with no description is not really different from an empty
non-merge commit with no description. As we discussed on
#2859, we should not treat
merge commits differently when updating away from them. This patch
adds test for the current behavior (which is to leave the merge commit
in place).
martinvonz added a commit that referenced this issue May 29, 2024
I recently needed to test something on top of a two branches at the
same time, so I created a new commit on top of both of them (i.e. a
merge commit). I then ran tests and made some adjustments to the
code. These adjustments belonged in one of the parent branches, so I
used `jj squash --into` to squash it in there. Unfortunately, that
meant that my working copy became a single-parent commit based on one
of the branches only. We already had #2859 for tracking this issue.

This patch changes the behavior so we create a new working-copy commit
with all of the previous parents.
martinvonz added a commit that referenced this issue May 29, 2024
Merge commits are very similar to non-merge commits in jj. An empty
merge commit with no description is not really different from an empty
non-merge commit with no description. As we discussed on
#2859, we should not treat
merge commits differently when updating away from them. This patch
adds test for the current behavior (which is to leave the merge commit
in place).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants