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

restack: Detect merges #314

Open
abhinav opened this issue Jul 29, 2024 · 0 comments
Open

restack: Detect merges #314

abhinav opened this issue Jul 29, 2024 · 0 comments
Labels
area/git Issues heavy on local Git management. bug Something isn't working

Comments

@abhinav
Copy link
Owner

abhinav commented Jul 29, 2024

Report from a user:

Starting situation is master <= A <= B.

  1. In the Github UI, I merge in A. Locally, I git checkout master && git pull && git checkout B.
  2. While on B, I perform a gs stack restack. A and B both restack sucessfully. Looking at git checkout A && git log, I can see that the A branch points to the same commit as master.
  3. gs stack submit dies on the A push failing. I'm pretty sure I just tried to force push master.
  4. gs branch submit dies on not finding the base branch anymore.

The thing to do here is that restack operations should detect when the branch in question has been merged into its base branch.
If that's the case, it should (either by default or with a prompt), delete the branch in question, and restack the upstack into the base.

Separately, RE: this line:

I'm pretty sure I just tried to force push master.

The user shared logs and fortunately that's not true. It was a push attempt to the merged branch (A), rejected because the local ref for that branch did not match the remote ref.


This should not be fixed until #331 is resolved.
Fixing this would break a workaround for #331 that relies on keeping merged branches around and just not submitting them.

@abhinav abhinav added bug Something isn't working enhancement New feature or request and removed bug Something isn't working labels Jul 29, 2024
@abhinav abhinav changed the title repo sync: Recover from git pull restack: Detect merges Aug 7, 2024
@abhinav abhinav added bug Something isn't working and removed enhancement New feature or request labels Aug 7, 2024
@abhinav abhinav added the area/git Issues heavy on local Git management. label Feb 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/git Issues heavy on local Git management. bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant