Skip to content

rebase -ir: optionally auto-update local branches when executing label commands #204

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

Closed
dscho opened this issue May 17, 2019 · 2 comments
Closed
Labels
enhancement New feature or request

Comments

@dscho
Copy link
Member

dscho commented May 17, 2019

The --rebase-merges mode allows users to rebase entire branch thickets, rather than only a linear commit history.

This feature can also be used to structure otherwise too-long patch series. Essentially the history looks like this:

o - A - B - C -D -E -F - G - H - I ...
  \          \             \
   ------------ first-batch - second-batch - ...

This makes sure that the whole feature can be developed from beginning to end, still keeping the "first-batch" in a shape that can be contributed individually to the Git mailing list. And then fixes (e.g. as a reaction to code review comments) can be integrated via git commit --fixup and then git rebase -ir.

However, the local branches first-batch and second-batch are not updated that way; They still have to be updated manually, which is tedious and error-prone.

How about an option to --rebase-merges that teaches label commands to see whether there is a local branch of the same name whose tip commit corresponds to the pre-rebase state of this label, and if such a branch was found, it is updated automatically (even updating a worktree if there is one, much like the receive.denyCurrentBranch=updateInstead feature does on push).

@dscho dscho added the enhancement New feature or request label May 17, 2019
@phil-blain
Copy link

@dscho I think this workflow is now easier with --update-refs, no ? (not sure if it completely solves this here issue though, as I've not tried it along with --rebase-merges)

For lurkers:

@dscho
Copy link
Member Author

dscho commented Jan 17, 2023

Yep, this is addressed. Another useful reference: https://git-scm.com/docs/git-rebase#Documentation/git-rebase.txt---update-refs

@dscho dscho closed this as completed Jan 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants