Viewing a stack
Let's continue the example from the previous page and see what our current stack looks like!
gt log longis just an alias for:
git log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(auto)%d%C(reset)' --branches
But we like the way it looks!
log shortboth support the following options. Since
log longis just a shortcut for a git command it doesn't have any customizability in Graphite at the moment.
gt log --stack— only shows the direct descendants and ancestors of the current PR. By default the commands show all branches currently tracked with Graphite.
gt log --steps <n>— implies
--stackbut only shows n levels of descendants and ancestors.
gt log --reverse— displays the log with trunk (e.g. main) at the top instead of the bottom. Useful when you have larger stacks to keep their tips near the bottom of the output.
Once you've submitted your branches with Graphite (we'll get to this later!),
gt logalso includes a link to the PR page and some details about its status.
You can also view some information for one branch at a time with
gt branch infowhich by default shows, in addition to the PR info, the children and parents of the branch as well as the commit descriptions for each commit in the branch. There are also
--patchoptions to see the PR description (if one exists) and the changesets of each commmit.
Now that you know how to visualize your stack, you can use Graphite to navigate it and submit your PRs!