From owner-freebsd-git@freebsd.org Wed Aug 19 12:47:28 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 8121F3BDC15 for ; Wed, 19 Aug 2020 12:47:28 +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 4BWncJ2tr9z3VpN; Wed, 19 Aug 2020 12:47: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 153E1150D2; Wed, 19 Aug 2020 12:47:28 +0000 (UTC) (envelope-from mat@freebsd.org) Received: from aching.in.mat.cc (fonera.eqx.absolight.net [79.143.253.217]) (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 CB0AD942D81; Wed, 19 Aug 2020 12:47:25 +0000 (UTC) Date: Wed, 19 Aug 2020 14:47:24 +0200 From: Mathieu Arnold To: Dan Langille Cc: freebsd-git@freebsd.org Subject: Re: FreshPorts & src commits to branches Message-ID: <20200819124724.yoni3kjxzlboknlq@aching.in.mat.cc> References: <3430278.PbzQmE3shN@beastie.bionicmutton.org> <15d19351-3c4c-4ad1-bd1a-7f8f6c2ae211@www.fastmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="r5pkvj7bryq7m7ja" Content-Disposition: inline In-Reply-To: <15d19351-3c4c-4ad1-bd1a-7f8f6c2ae211@www.fastmail.com> X-BeenThere: freebsd-git@freebsd.org X-Mailman-Version: 2.1.33 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: Wed, 19 Aug 2020 12:47:28 -0000 --r5pkvj7bryq7m7ja Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Aug 18, 2020 at 09:23:03AM -0400, Dan Langille wrote: > On Tue, Aug 18, 2020, at 3:44 AM, Adriaan de Groot wrote: > > On Tuesday, 18 August 2020 03:19:26 CEST Dan Langille wrote: > > > I am quickly realizing that in order for FreshPorts to track src comm= its it > > > needs to query every branch. There does not seem to be any other way = to > > > know that a commit ocurred on stable/12 without a checkout of stable/= 12 > >=20 > > If you have the full repo (e.g. a normal clone) then you might be able = to use=20 > > something along this line: > >=20 > > git log --branches --since 2020-08-16 --source --raw | grep ^commit > >=20 > > (the important bit is --branches to include all of them, and --source t= o=20 > > include the source). I don't have a FreeBSD repo at hand, but my work-r= epo=20 > > (which currently has some other branch checked out) gives me this kind = of=20 > > output: > >=20 > > commit 36cefe3be10c707a2cdfaedd14fddee5cda31f50 hotfix-3.2.28.2 > > commit eb44d0c6be18c1ced99d5a8c1b1a6a1a0e653be2 hotfix-3.2.28.2 > > commit 24efce0c1d5601a77ad2b919cf0cf387231add76 calamares > > commit 5db4195b7e3e507a34f84e041b15a4aa86ed32da hotfix-3.2.28.2 > > commit 34946ecdee90584caf255fcca732c021e1dc1832 hotfix-3.2.28.2 > > commit 1a7b2668dc1e341b493990b99e9a0cc4530d32cd hotfix-3.2.28.2 > >=20 > > This gives me branches for each commit hash in the given range. The bra= nches=20 > > you see mentioned here diverged before the date range given. I can't sa= y=20 > > anything about performance, here -- my little test repo only has ~8000 = commits=20 > > going back six years. > >=20 > > (Turning this command-line into a collection of libgit calls is left as= an=20 > > exercise for the reader) >=20 > FYI, FreshPorts is using devel/py-pygit2 which uses devel/libgit2 :) >=20 > After a git pull, I same up with this: >=20 > [dan@devgit-ingress01:~/src/freebsd/freebsd] $ git log --branches --since= 2020-08-17 --source --raw | grep ^commit > commit ef1942cafc385f2ebc7e4a7a5f5679bb1a4b0d78 stable/12 > commit 3889b52f5c73875df9a28180c4b1b4a07bf0042a stable/12 > commit 9fc2a101135102074391b6ff28b825b082410ffa master > commit a9a7211e27bfe2bec89b08899b977a4677728d97 master > ... several lines omitted from this paste > commit 5853f38da725897c25a505ce62675e31aca27f26 master > commit 1b47d5c7b7fb338daf65ccf05b9df0d9e93d11ae stable/12 >=20 > Let's try a date time in there: >=20 > [dan@devgit-ingress01:~/src/freebsd/freebsd] $ git log --branches --since= "2020-08-17 23:00:00" --source --raw | grep ^commit > commit ef1942cafc385f2ebc7e4a7a5f5679bb1a4b0d78 stable/12=20 > commit 3889b52f5c73875df9a28180c4b1b4a07bf0042a stable/12 >=20 > Those were both at 23:40 yesterday. >=20 > The current approach is: I have this commit, show me all the commits afte= r that: hash..HEAD >=20 > That works on a branch-by-branch basis. >=20 >=20 > This may be a potential issues: The --since & --branches approach require= s a date/timestamp. If we always use the timestamp of the last time we aske= d, will we skip over commits? Well, I would run something like --since '2 weeks ago' and ignore what commits you already have. It will maybe work, or not, it will probably depend on wether we allow branches or out of order commits, or... It would probably be safer to do for each branch, look at the commits in the ... range, which would get you all the commits, proably even if we allow merge commits. > Humor me while I contemplate URLs. =20 >=20 > The 3889b52f5c73875df9a28180c4b1b4a07bf0042a commit translates to: >=20 > https://github.com/freebsd/freebsd/blob/stable/12/sys/sys/ata.h Well, nom the 3889b52f5c73875df9a28180c4b1b4a07bf0042a commit translates to=20 https://github.com/freebsd/freebsd/blob/3889b52f5c73875df9a28180c4b1b4a07bf= 0042a/sys/sys/ata.h The URL you have is for the head of the stable/12 branch. > The format seems to be: >=20 > https://github.com/freebsd/freebsd - URL to repo >=20 > blob - some abstraction >=20 > stable/12 - branch >=20 > sys/sys/ata.h - path to file >=20 > Compared to head/master: >=20 > https://github.com/freebsd/freebsd/blob/master/sys/sys/ata.h >=20 > The only difference: stable/12 -> master : very straight forward. What do you need the github url for? --=20 Mathieu Arnold --r5pkvj7bryq7m7ja Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKTBAABCgB9FiEEVhwchfRfuV0unqO5KesJApEdfgIFAl89H1dfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDU2 MUMxQzg1RjQ1RkI5NUQyRTlFQTNCOTI5RUIwOTAyOTExRDdFMDIACgkQKesJApEd fgK7gg//ZrQLnvZKycqAoRIo14FQkcHb5nZYals4TCaJh6w2BiCteeQgE++3E++/ B91m9qinEbW3zqkLqd0tFzogA+iOcmMG0JeVNgRfZL+olWOUttKR0y84mxJE4KcR nfLv4xFLmvkdjNlxOeJMOti422t0p8wRnSIJbxYKrKAwpH+cGgHJe0ZxeAFtpM0J It71MRNOgu9hpggbrgei17hKMThU0BWEGnrayGL5rKvI1tN2xKkwcEUBs2YW1Aya wwXpzrOnGqDrCYE/MTn1gmUoxJ6sC7vFvTmecJb5k2XJboQ+YXNst5x0P16+IN72 BcbRfyFhsP1bOUdVOo5LZ5ikpGpryRwcevXDx93ffi+7qg0kaNYnp9hE2aYu4YbR fquKf2/L0xF8y87OAkORvJtiO0E1alOH9iP1IR4Bc/3Dz22lUFNX/LJo/Sfox+Ot GufUZVF3Am4LEo5pWM7+5brrgjtcTYyA7JR/FHTOr/jJBFEHNlOSACVvdxlxuj5O jnais3u7j1ZEwnBv6yGCID7N+Jdc83Jvs35f+2NaLG/opNshHzestj+QT5+TJr87 0CUIF5SdbasR0eZ47n9ooyqFmkUz+Toy6v1hQ3V8gYjoPcstNlyDsIne/6uHcmWe tQb0HVaBpufVfpU60F6gChMDOYuHANJaEPl4suHautK+8jlTTvQ= =2pLX -----END PGP SIGNATURE----- --r5pkvj7bryq7m7ja--