Slackbot
08/12/2023, 8:01 PMTyler Laprade
08/12/2023, 8:03 PMNader Al-Naji
08/12/2023, 8:06 PMNader Al-Naji
08/12/2023, 8:07 PMJacob Gold
08/12/2023, 9:03 PMJacob Gold
08/12/2023, 9:05 PMNader Al-Naji
08/13/2023, 2:44 AMJacob Gold
08/13/2023, 5:26 AMgit merge-base <base> <head>
is the base commit — i.e. the base is in the linear history of the head. Merge commits make it harder to reason about maintaining this invariant because it introduces the possibility of multiple merge bases.
I was at Facebook before this (we have folks from Google on our team as well) and it's my understanding that `hg`/Phabricator at facebook behaves not too differently from Piper — both consider stacks of commits as opposed to branches, and keep track of the version history of the diff/CL respectively. You are correct that this is isomorphic to using merge commits to keep track of the history of a feature, however, we model this differently on top of Git. The main motivation for this difference being that we want Graphite to be fully compatible with Git and GitHub pull requests so as to allow for incremental adoption from fully GitHub to fully Graphite. We keep track of the version history of the Graphite branch on our server, outside of Git itself. (i.e. a history of the head/base commits updated on each submit
command or when we detect that the branch was updated via a non-Graphite push)Jacob Gold
08/13/2023, 5:32 AMbig-feature-branch
and base your stacks on that instead of main. Our CLI will then rebase small-feature-branch
to restack it on big-feature-branch
without trying to restack big-feature-branch
on main
. You can change your trunk branch with gt repo init
.
In this world, you would manage merging main
into big-feature-branch
and pushing big-feature-branch
to GitHub outside of Graphite.
Perhaps a better statement of what I said earlier is that Graphite is designed and best used for managing stacks of small, short lived branches that merge into longer lived "trunk" branches. If you are willing to treat big-feature-branch
as a trunk branch, and manage its relationship with main
outside of Graphite you may see more value from it.