Problem description
Some time ago git added a --update-refs flag to rebase. This flag is awesome when working with stacked branches. What it does is when we have a series of commits like this:
A ---> B ---> C (branch-Y) ---> D ---> E (branch-X)
and then checkout branch-X and perform rebase on A, for example to edit B's message, git will update where branch-Y points to. With update-refs it will look like this after the rebase:
A ---> B' ---> C' (branch-Y) ---> D' ---> E' (branch-X)
without update-refs:
B ---> C (branch-Y) ---> D ---> E
/
/
A ---> B' ---> C' ---> D' ---> E' (branch-X)
When editing commits using sublime merge the second behavior is present, which is frustrating if you have more than one branch in a line of commits.
--update-refs can be set as default in gitconfig:
[rebase]
updateRefs = true
however it seems to not have any effect in SM. From what I see in git console it's because SM doesn't call rebase, it uses commit-tree and update-ref instead.
So after any edit I need to, for each branch
checkout the branch
find the commit it should point to
hard reset it
Preferred solution
Please implement --update-refs behavior in SM, possibly enabled somewhere in preferences.
Alternatives
The alternative would be for SM to use git rebase when editing commits, so that --update-refs can be enabled in global git config.
Problem description Some time ago git added a
--update-refs
flag to rebase. This flag is awesome when working with stacked branches. What it does is when we have a series of commits like this:and then checkout
branch-X
and perform rebase on A, for example to edit B's message, git will update wherebranch-Y
points to. With update-refs it will look like this after the rebase:without update-refs:
When editing commits using sublime merge the second behavior is present, which is frustrating if you have more than one branch in a line of commits.
--update-refs
can be set as default in gitconfig:however it seems to not have any effect in SM. From what I see in git console it's because SM doesn't call rebase, it uses commit-tree and update-ref instead.
So after any edit I need to, for each branch
Preferred solution
Please implement
--update-refs
behavior in SM, possibly enabled somewhere in preferences.Alternatives
The alternative would be for SM to use
git rebase
when editing commits, so that--update-refs
can be enabled in global git config.