On Tue, Sep 22, 2020 at 07:28:04AM +0000, Chris. Webster via GitGitGadget wrote:
I think this will work OK in practice, but a few thoughts:
- for a linear branch on top of master, using the commit count will
work reliably. But I suspect it would run into problems if there were
ever a merge on a PR (e.g., back-merging from master), where we'd be
subject to how `git log` linearizes the commits. That's not really a
workflow I'd expect people to use with git.git, but it would probably
be easy to make it more robust. Does the PR object provide the "base"
oid, so we could do "git log $base..$head"?
- this will run only on PRs. That's helpful for people using
GitGitGadget, but it might also be useful for people just running the
CI by pushing branches, or looking at CI builds of Junio's next or
seen branches. Could we make it work there? Obviously we wouldn't be
able to rely on having PR data, but I wonder if "git log
HEAD..$branch" would be sufficient.
-Peff