Date: Tue, 4 May 2021 14:08:22 +0200 From: Mathieu Arnold <mat@freebsd.org> To: Stefan Esser <se@freebsd.org> Cc: FreeBSD ports <freebsd-ports@freebsd.org> Subject: Re: [SOLVED?] Recovery of deleted ports fails due to pre-commit checks Message-ID: <20210504120822.2smsk7nllmcgmmwe@aching.in.mat.cc> In-Reply-To: <c05df6a0-d471-5e27-022b-784c535c3fdb@freebsd.org> References: <2c1ab5d2-d885-8f8d-94dd-99d0a5559a88@freebsd.org> <20210503070134.bydnbc2eah7st2on@aching.in.mat.cc> <6041a16c-a114-2896-7162-39b59110b782@freebsd.org> <20210504094653.3m27ucqa3hotsusw@aching.in.mat.cc> <c05df6a0-d471-5e27-022b-784c535c3fdb@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--pyrz4mnf5hpxs3qq Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, May 04, 2021 at 12:12:50PM +0200, Stefan Esser wrote: > Am 04.05.21 um 11:46 schrieb Mathieu Arnold: > > On Mon, May 03, 2021 at 09:54:36PM +0200, Stefan Esser wrote: > >> Am 03.05.21 um 09:01 schrieb Mathieu Arnold: > >>> On Sat, May 01, 2021 at 09:01:02PM +0200, Stefan Esser wrote: > >>>> The recovery of deleted ports in their previous form is rejected > >>>> by the pre-commit checks on the repository server: > >>>> > >>>> remote: > >>>> remote: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > >>>> remote: Do not commit ports without TIMESTAMP in their distinfo file= s. > >>>> remote: Rerun make makesum to add it. > >>>> remote: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > >>>> remote: > >>>> > >>>> I have tried to revert the deletion with unchanged files and then > >>>> updated the ports' Makefiles and distinfo files in a later commit. > >>>> > >>>> Pushing those commits all together fails with the message above, > >>>> and in order to not confuse GIT, deleted files should be committed > >>>> first, before applying any changes. > >>> > >>> This is not needed at all, Git cannot get confused by something it has > >>> no knowledge of. Once a file is deleted, or moved, the history tracki= ng > >>> stops. > >> > >> I wanted to re-connect the resurrected files to the history of the por= t. > >> And that works best, if unmodified files are committed first, changes > >> applied and committed thereafter. > >> > >> Did you try "git log multimedia/transcode"? > >> > >> The history is there, back to 2002. > >=20 > > Yeah, but this has nothing to do with you commiting unmodified files. > > Git does not track file renames or moves (or resurrection), it blindly > > looks at what you told it and goes as far as it can find things. >=20 > Yes, sure, but the general advice when moving around files in GIT > repositories is: First move and commit unchanged, then modify in > place and commit again. And I was under the impression that the > same advice applies to files that have been deleted and are brought > back - GIT can identify and reconnect them in a way that preserves > history only by guessing, and I wanted to make it as easy as possible > for GIT, since I have watched GIT to get trivial operations of that > kind wrong in grotesque ways ... >=20 > https://github.blog/2020-12-17-commits-are-snapshots-not-diffs/#since-com= mits-arent-diffs-how-does-git-track-renames Note that there are two caveats. Git will only look for files to compare to in the parent of the commit where the files are added, so if it is a resurrection, Git will never find out where the file came from. Git will only look around for a few files, like a few thousands, see diff.renameLimit in git-config(1), as we have something like 140k files in the tree, there is no chance for Git to actually find the original file you moved the new file from. So, let me say it once again, if you want to record where a file was moved/resurrected from, describe it in the commit message. Don't try to be clever with special commits, Git won't care and won't find where the file came from. --=20 Mathieu Arnold --pyrz4mnf5hpxs3qq Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKTBAABCgB9FiEEVhwchfRfuV0unqO5KesJApEdfgIFAmCROTFfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDU2 MUMxQzg1RjQ1RkI5NUQyRTlFQTNCOTI5RUIwOTAyOTExRDdFMDIACgkQKesJApEd fgKwqw/+MkrpDVl3ypCaewdi634wOy70cYOPT0koebKEO+0kAcBSr1jHC/mjQLA8 d1993cenbRw8a95t9+7eJIhoJTlu71qKlyOmmWkpyZd58Sr6I9sGQ4hnbvtZ89RR Ej2r63vJCqzIttR8+os0+VOpq6vjgBh4VuOrtLsjP2BE39EQulNIN2jYWXDp4eke qQ7hP4jejgQ/s2fXXjdregmd25JuPYswQuWhCpU9ixJJt78k8uynsCKQ+3zD575R ifNSfh/iOjxjS4hXE6xfcvKFeIOYtV64X1RfSABkbtZt8oj2ENE70qsMfEYsoyBk UAalPsrFXUg0IiQfMu4nNHSDGNlEFzpUYaniLP8yxr89WKqRUObz24PB+SsNCF7K afWIWtt/+LyyBmwuHSt5e3tNac0yO3q+De3+NZ+PVikpfljnWJRFizFkVTiG3zmb js4m/HElMBA6BdwfoGg26GWk0US8BzqAA6DQM6A4hfAl9QFiVfaSTKmOQrpzFfSp hIiDbRH/PqBWrqexYZsdQ4jTj/NpwShYvPjBouTUKv1APaB82Fe0VKYnMJicbtUx rxT+o94ES6K5GNaITmIUY8SlwU8CsODG9mjktisPHCTgXAjyzHj/eDkc+Kf+Tiso cQE9UYrNSFonl1ghsThrHXSn1QvaPaJMlzPr89OO08PhJ02oDqg= =+4BR -----END PGP SIGNATURE----- --pyrz4mnf5hpxs3qq--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20210504120822.2smsk7nllmcgmmwe>