From owner-freebsd-git@freebsd.org Mon Mar 1 23:56:26 2021 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 714DB550A32 for ; Mon, 1 Mar 2021 23:56:26 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4DqHGc6NG4z4Vy5; Mon, 1 Mar 2021 23:56:24 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id C79073C0199; Mon, 1 Mar 2021 23:56:18 +0000 (UTC) Date: Mon, 1 Mar 2021 23:56:18 +0000 From: Brooks Davis To: Rene Ladan Cc: Brandon Bergren , John Mehr via freebsd-git Subject: Re: Ports Repocopy Message-ID: <20210301235618.GD50170@spindle.one-eyed-alien.net> References: <202102221945.11MJjCiO063445@slippy.cwsent.com> <20210222211032.GA21063@freefall.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="8NvZYKFJsRX2Djef" Content-Disposition: inline In-Reply-To: <20210222211032.GA21063@freefall.freebsd.org> User-Agent: Mutt/1.9.4 (2018-02-28) X-Rspamd-Queue-Id: 4DqHGc6NG4z4Vy5 X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of brooks@spindle.one-eyed-alien.net has no SPF policy when checking 199.48.129.229) smtp.mailfrom=brooks@spindle.one-eyed-alien.net X-Spamd-Result: default: False [-1.90 / 15.00]; ARC_NA(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[199.48.129.229:from]; FREEFALL_USER(0.00)[brooks]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; DMARC_NA(0.00)[freebsd.org]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(1.00)[1.000]; SPAMHAUS_ZRD(0.00)[199.48.129.229:from:127.0.2.255]; TO_DN_ALL(0.00)[]; NEURAL_HAM_SHORT(-1.00)[-1.000]; SIGNED_PGP(-2.00)[]; FORGED_SENDER(0.30)[brooks@freebsd.org,brooks@spindle.one-eyed-alien.net]; RCVD_COUNT_ZERO(0.00)[0]; R_SPF_NA(0.00)[no SPF record]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:36236, ipnet:199.48.128.0/22, country:US]; FROM_NEQ_ENVFROM(0.00)[brooks@freebsd.org,brooks@spindle.one-eyed-alien.net]; MAILMAN_DEST(0.00)[freebsd-git] 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: Mon, 01 Mar 2021 23:56:26 -0000 --8NvZYKFJsRX2Djef Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Feb 22, 2021 at 09:10:32PM +0000, Rene Ladan wrote: > On Mon, Feb 22, 2021 at 02:46:40PM -0600, Brandon Bergren wrote: > > On Mon, Feb 22, 2021, at 1:45 PM, Cy Schubert wrote: > > > When ports switches to GIT, given that there is no GIT equivalent to = svn=20 > > > copy will repocopy become a thing of the past? Will we live with this= or=20 > > > will there be some kind of procedure ports committers must follow to= =20 > > > approximate a repocopy? > > >=20 > >=20 > > Renames and copies in git are inferred, not tracked. > >=20 > > About all you can do to make following stuff easier across a copy is to= cp -a and immediately commit, before making any changes, so that it shows = up in the index with identical file hashes as what it was copied from. > >=20 > > Following a file's history across a copy is dependent on the settings t= he person looking at the history is using. > >=20 > > It is not enabled by default because it is an extremely expensive opera= tion -- it is O(n^2) where n is the number of files in the tree, plus even = then it only works if the original file was modified in the same commit. Ot= herwise you have to use --find-copies-harder which is an even more expensiv= e option. > >=20 > > If the commit was done by committing an unmodified version first, you c= an theoretically use `git log --follow -C100% --find-copies-harder ` which should probably be able to do its work without having to compute = similarities on all of the objects. But if you have many files with the sam= e contents, I don't really know what the log will look like past that point= =2E I *think* it will just randomly mix history. I haven't tested it though. > >=20 > > I suppose writing a tool that adds metadata about the copy to a git not= e or something would be the best way to track this stuff... >=20 > Hm, or just write something at the bottom of the commit message, like > cherry-pick -x does? I remmber that emaste suggested something like this > in the last git working group meeting. For simple cases like copying one port or resurrecting one port, I think the easiest thing to do is to cause the new copy to exist in one commit (but don't hook it up) and then update it. E.g.,=20 resurrection: git revert --no-commit git revert --continue (or whatever the equivalent is) git add + git commit copying: git cp cat/port cat/portng git commit cat/portng git add + git commit This gives git the best chance to infer the right history by ensuring identical files are copied. I think the copying case will work better than resurrection from a tooling perspective. Resurrection will likely go best if ports are deleted in independent commits rather than in one big one during expiration. -- Brooks --8NvZYKFJsRX2Djef Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJgPX8iAAoJEKzQXbSebgfAGFoH/0S/nvbjHjOL9bv3NWl5v/vI Yafx3E+5+AhCR9UK7+vIqa696+ZAqac4GW919kNaLjmPU6gTWrtwnHanY9meomc4 IC8Z+C0pDE4Un1OKu4SEJGUJgzDBYdM+sGZW8x1TL4u6pzXRvw3R7xFXTgmCn3e3 8182nfPacb8kekag7mKShTx0NQPUUyc6Z5QN/G1iZj+qmbgIuTuwvdYjdF8ma370 BmvJVtP17s2GsQVA6E55WAGd+GUdUL/JyzqeQKkafQAqkrIUxJDsg+0xzJB/kGkZ Gt0OvF5pZqWLvh4NnoP4E8X3j9IRUM+LI8bWzb3zkg1Q/hwpW91O0a9dPpEUYkM= =8UQj -----END PGP SIGNATURE----- --8NvZYKFJsRX2Djef--