Monitoring commits on all branches
Mathieu Arnold
mat at freebsd.org
Fri Nov 20 17:03:29 UTC 2020
On Thu, Nov 19, 2020 at 02:00:36PM -0500, Dan Langille wrote:
> Mathieu mentioned: git log $foo_hash...branch_name
>
> That was the first time I've seen that used. All previous suggestions were HEAD, not branch_name. But they are all the same in this context?
HEAD is an alias for "whatever is currently checked-out right now".
HEAD usally points to a branch that you work on, but if you git checkout
some-commit-hash you get in a "detached HEAD" state where HEAD does not
point to a branch but to a specific commit, and it can lead to you
loosing new commits if you work from there and are not careful.
> * Polling git
>
> It is beginning to sound like the FreshPorts git code for detecting incoming commits will be:
>
> Every N minutes, do this:
>
> for each repo in REPOS
> for branch in BRANCHES
> cd to the directory for that repo
> git checkout branch
> git log $branch_last_hash...HEAD
Those two should probably be `git log $branch_last_hash...$branch_name`,
you don't actually need to checkout the thing.
> for each of those commits
> process the commit
> end for
> end for
> end for
>
> At present, the REPOS and BRANCHES are:
>
> * freebsd BRANCHES="master branches/2020Q4 branches/2020Q3 branches/2020Q2 ...etc"
> * freebsd-ports BRANCHES="master stable/12 stable/11"
> * freebsd-doc BRANCHES="master"
Those should probably not be static but should probably be parsed from,
for example, `git branch -a`, possibly with a --format to be easily
parsed.
--
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/20201120/de632afc/attachment.sig>
More information about the freebsd-git
mailing list