Monitoring commits on all branches

Mathieu Arnold mat at freebsd.org
Thu Nov 19 08:54:00 UTC 2020


On Wed, Nov 18, 2020 at 08:49:46PM -0500, Dan Langille wrote:
> How can a repo be monitored for commits on all branches?
> 
> I know how to ask a given branch: do you have any commits after foo_hash?
> 
> How do I:
> 
> * get a list of all commits since foo_hash

All commits on the branch foo_hash is:

git log $foo_hash...branch_name

> * know which branch each of those commits was on (e.g. master, branches/2020Q4)

You will need to keep track of the latest commit on each branch
separately, because there is absolutely no relation or ordering
possible between branches.

You could be tempted to use `--since <date>`, but you cannot, because as
git is distributed, commit dates are by no mean increasing as you get to
the tip of the branch.  For example, I work on something on a private
branch, commit it, and open a review, a few days pass, the review gets
accepted, and I then rebase my one commit branch on the main branch and
git push.  The latest commit on that branch will be mine, which has a
date a few days in the past, the previous commit probably has a date a
few hours ago.

-- 
Mathieu Arnold
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 963 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-git/attachments/20201119/45438dab/attachment.sig>


More information about the freebsd-git mailing list