Slackbot
09/08/2023, 2:57 PMAryaman
09/08/2023, 3:05 PMgt upstack onto work for you?Aryaman
09/08/2023, 3:06 PMJeff Huang
09/08/2023, 3:08 PMdev, i’d want to run the equivalent of:
git rebase --onto dev HEAD~1
(HEAD~1 is an example, it could be whatever)
and have that propagate through the stack. not sure if it would actually be possible to auto-propagate this without conflicts… but that would be the idealJeff Huang
09/08/2023, 3:09 PMAryaman
09/08/2023, 3:10 PMJacob Gold
09/08/2023, 3:11 PMtrack to better address this case in the coming monthsJacob Gold
09/08/2023, 3:12 PMgit rebase --onto parent child~ child && gt track child --parent parent should work for now thoughJacob Gold
09/08/2023, 3:12 PMJeff Huang
09/08/2023, 3:17 PMJeff Huang
09/08/2023, 3:18 PMdev
- branchA (needs restack)
- branchB
- ...
if there are conflicts, that I know can be resolved using the --onto trick, I’ll do sometihng like:
# start at branchA
git rebase --onto dev HEAD~...
# At this point, i think branch B is not tracked correctly, but branch A is tracked
git co branchB
git rebase --onto branchA HEAD~...
# at this point, branch B is tracked correctly, same with A
# repeat for all remaining branchesJeff Huang
09/08/2023, 3:19 PMgt bu instead of git checkout <branch>? That saves some time and mental overhead for sure!
ideally the rebasing could be propagated automatically (i’m not sure if that’s actually possible though)Jacob Gold
09/08/2023, 3:25 PMcommit-B when git log roughly looks like
commit-B <- B
commit-A <- A
main
would have {parentBranch: 'A', parentBranchRevision: 'commit-A'}
this allows us to do git rebase --onto A commit-A B to restack B when A changes underneath it
we maintain the invariant that git merge-base --is-ancestor <parentBranchRevision> branch holds, and if that ever breaks we throw our hands up and require you to retrack the branch
gt track only allows you to track branches when the commit of the parent is currently an ancestor of the commit of the branch, so rebasing gets it to that pointJeff Huang
09/08/2023, 6:31 PM