Closed Alizter closed 8 months ago
Here are my notes I had chillen locally for thils. Figured I would share them.
// get the merge base between HEAD and the upstream tracking branch (e.g. origin/main) if we
// were on main
// if the merge base sha matches the sha of the upstream tracking branch (e.g. origin/main)
// than the stack is not behind the upstream branch at all, so it would be 0 behind.
// if the merge base sha does NOT match the sha of the upstream tracking branch (e.g.
// origin/main) then the stack is behind the upstream branch by some number of commits. To
// determine the number of commits we would have to walk from the upstream tracking branch
// (e.g. origin/main) down the tree until we hit the merge base sha, counting the commits
// along the way. This resulting count is the number of commits that the stack is behind its
// upstream tracking branch.
// We may already have something implemented that will facilitate this or may be similar to it.
// When we do a `gps pull` it initially does a `gps fetch` which if I recall correctly shows
// the commits that were pulled down and the stack rebased onto or something like that.
This has been integrated into mainline so I am closing this issue.
We discussed having a
git status -sb
like status when doinggps ls
on slack. It would be good to both show how many commits we are ahead and how many commits we are behind.