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

Rebase does not move the branch being rebased #306

Open
Kinrany opened this issue May 3, 2023 · 2 comments
Open

Rebase does not move the branch being rebased #306

Kinrany opened this issue May 3, 2023 · 2 comments
Labels
bug Not as expected

Comments

@Kinrany
Copy link

Kinrany commented May 3, 2023

Creating a separate issue from #303

Repro: https://github.com/Kinrany/repro-git-stack

Originally the problem was that all branches were being moved onto a single commit. I think I understand that behavior now: all of the commits there were created with --allow-empty. Might make sense to add an exception for commits that are explicitly empty though?

With this new repro, there's another unexpected behavior. I'm moving main2 onto main. main includes all of the commits in main2, however there are other branches on top of main2. For some reason git stack --rebase --onto main moves all those other branches but not main2 itself.

@epage
Copy link
Collaborator

epage commented May 3, 2023

Originally the problem was that all branches were being moved onto a single commit. I think I understand that behavior now: all of the commits there were created with --allow-empty. Might make sense to add an exception for commits that are explicitly empty though?

Empty commits do not matter. If there is also a problem there, please open another issue.

When looking at #303, an issue I noticed is that our logic for updating to the latest commit of a remote was causing main to move to point to main2 which it shouldn't.

@epage
Copy link
Collaborator

epage commented May 3, 2023

With this new repro, there's another unexpected behavior. I'm moving main2 onto main. main includes all of the commits in main2, however there are other branches on top of main2. For some reason git stack --rebase --onto main moves all those other branches but not main2 itself.

One of two things is happening

  • We assume --base is untouchable,. only moving things on top of it
  • We are extra cautious when a branch points to protected commits

@epage epage added the bug Not as expected label May 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Not as expected
Projects
None yet
Development

No branches or pull requests

2 participants