From owner-freebsd-git@freebsd.org Fri Nov 20 17:03:29 2020 Return-Path: Delivered-To: freebsd-git@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0E2D42EFFCC for ; Fri, 20 Nov 2020 17:03:29 +0000 (UTC) (envelope-from mat@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Cd2tm6wn4z3t43; Fri, 20 Nov 2020 17:03:28 +0000 (UTC) (envelope-from mat@freebsd.org) Received: from mail.j.mat.cc (owncloud.cube.mat.cc [IPv6:2a01:678:4:1::228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.mat.cc", Issuer "Let's Encrypt Authority X3" (verified OK)) (Authenticated sender: mat/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id C62E1206E2; Fri, 20 Nov 2020 17:03:28 +0000 (UTC) (envelope-from mat@freebsd.org) Received: from aching.in.mat.cc (unknown [IPv6:2a01:678:42:0:bdf4:2e83:8ff:e8ad]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: mat@mat.cc) by mail.j.mat.cc (Postfix) with ESMTPSA id A79C7942D84; Fri, 20 Nov 2020 17:03:27 +0000 (UTC) Date: Fri, 20 Nov 2020 18:03:26 +0100 From: Mathieu Arnold To: Dan Langille Cc: freebsd-git@freebsd.org Subject: Re: Monitoring commits on all branches Message-ID: <20201120170326.4k6sj7tt35lrjtaz@aching.in.mat.cc> References: <197541CC-FEA7-4B4C-936E-66A5625BB64C@langille.org> <3c9f6285-ae7c-1062-2dd3-42f8c953a230@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="45wtwjfwliaf7fev" Content-Disposition: inline In-Reply-To: X-BeenThere: freebsd-git@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Discussion of git use in the FreeBSD project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Nov 2020 17:03:29 -0000 --45wtwjfwliaf7fev Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Nov 19, 2020 at 02:00:36PM -0500, Dan Langille wrote: > Mathieu mentioned: git log $foo_hash...branch_name >=20 > That was the first time I've seen that used. All previous suggestions wer= e 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.=20 > * Polling git >=20 > It is beginning to sound like the FreshPorts git code for detecting incom= ing commits will be: >=20 > Every N minutes, do this: >=20 > 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 >=20 > At present, the REPOS and BRANCHES are: >=20 > * freebsd BRANCHES=3D"master branches/2020Q4 branches/2020Q3 branches/202= 0Q2 ...etc" > * freebsd-ports BRANCHES=3D"master stable/12 stable/11" > * freebsd-doc BRANCHES=3D"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. --=20 Mathieu Arnold --45wtwjfwliaf7fev Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKTBAABCgB9FiEEVhwchfRfuV0unqO5KesJApEdfgIFAl+39tlfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDU2 MUMxQzg1RjQ1RkI5NUQyRTlFQTNCOTI5RUIwOTAyOTExRDdFMDIACgkQKesJApEd fgIsehAAg7Sk6N6kOOBX8dipQ8xmZbji5h6zon3LaM2uQczvcOqRw3RKfQO0a6ye ngCGvWLT5yacCQb60SjMP1CiySGpoXxV3F7t+6GyQchBdHhtndzKExpPBisKRwtb jUtcro1vTUR21kAeN9XPU6Yp3fFUTqjiofZCzdUD/SMdzzKDH2YyQHxsAIEvWvTP dHLtJ6RdsW0mql/+ERVMkDKfJnIN8xCuonPz9Cww+xAL0oFpxtCPBkww9L/kJneg aY+XJ6o5qN6PU63PzkypH+pcLYdGqiOkvBV84BxTei2YYejmucs5tv6b7egEgdkr cN5QhgJ3Uye5jIgnj+i7tZrpe0sIP2D75TWRHWZZdN5ZUqZsZSh5tPYi3RGtR4pj /uKZqQWL8NI87z6+Ka/vW6k9TRljjg3aH1KmKWKi0GEzcS8sTiLC+uAxqaAPTQd8 hG5ijTypkqqHq+a/8CRY+WsKe80Vb+3/nrgeWStO6c72g06QuNCuX01s1YcrXsjj ENb6KHidaZiUUb8bvxIRh1nZ+DlDwZAZeZsplwkonZ7DtKdDp6cclDcVohdrYgKV H33yqkyQU3H27nIuM6fBqkid7Eme7pQ4wxF5T1ApLPQK6EHvcXIov4ohTqOO/JBT Wy2/mrx5M7p3bxBm0n2FnCBWcwBiTPAF3eJuMOBRnHeBUulP0rU= =YgJs -----END PGP SIGNATURE----- --45wtwjfwliaf7fev--