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

git sync --pull leaves repo at a "rewritten" commit if the last checkout fails #1137

Open
ppwwyyxx opened this issue Nov 14, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@ppwwyyxx
Copy link

ppwwyyxx commented Nov 14, 2023

Description of the bug

git sync --pull will rebase my current stack onto the new main, and checkout to the corresponding commit on the new stack.

However, if my current repo has uncommitted changes, the step "checkout" may fail.
2023-11-14_00-53

Despite that git sync --pull fails in the last step, the stack is still rebased, and the old commits were rewritten to the new stack.

At this moment, the correct user action, is for them to address the checkout failure (e.g. with a stash), and manually checkout to the new stack. Otherwise they are left at a rewritten commit in the old stack. I think this could be confusing. For instance, today one user thought "sync failed, so I'll remove my uncommitted changes and sync again", and they ended up with two identical stacks.

Expected behavior

I wonder what could make the experience more straightforward in the above scenario, e.g.:

  1. Maybe sync --pull can revert to the initial state, if the last checkout failed.
  2. Maybe sync --pull can refuse to run, if it founds the current commit needs to be rewritten AND the current repo has uncommitted changes.

Actual behavior

No response

Version of rustc

No response

Automated bug report

No response

Version of git-branchless

git-branchless-opts 0.8.0

Version of git

git version 2.25.1

@ppwwyyxx ppwwyyxx added the bug Something isn't working label Nov 14, 2023
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

1 participant