Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 2 Dec 2020 18:31:15 +0000
From:      Brooks Davis <brooks@freebsd.org>
To:        Ulrich Sp??rlein <uqs@freebsd.org>
Cc:        Warner Losh <imp@bsdimp.com>, Chris Rees <crees@freebsd.org>, "portmgr@FreeBSD.org" <portmgr@freebsd.org>, git@freebsd.org, Adam Weinberger <adamw@adamw.org>
Subject:   Re: converting rmport to git
Message-ID:  <20201202183115.GE18452@spindle.one-eyed-alien.net>
In-Reply-To: <X8elyzcEwrfkgx8L@acme.spoerlein.net>
References:  <20201129164707.GA31739@freefall.freebsd.org> <CAP7rwchHsz3x4v%2BWmxEqTyXOvJx6fUbRuKnirBPEPVzz7gMw0A@mail.gmail.com> <14871125-A032-4980-8DB1-0210E34D5A11@FreeBSD.org> <20201130105337.GA42359@freefall.freebsd.org> <7246FB00-655B-4BD4-BC99-B87E4595969C@FreeBSD.org> <20201201095906.GA50345@freefall.freebsd.org> <CANCZdfrMP--yZBedSoCBhAFuDzhxLt3BbNi=DCoErrXTtY=qtg@mail.gmail.com> <X8elyzcEwrfkgx8L@acme.spoerlein.net>

next in thread | previous in thread | raw e-mail | index | archive | help

--cHMo6Wbp1wrKhbfi
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Dec 02, 2020 at 03:33:47PM +0100, Ulrich Sp??rlein wrote:
> On Tue, 2020-12-01 at 09:36:48 -0700, Warner Losh wrote:
> >On Tue, Dec 1, 2020 at 2:59 AM Rene Ladan <rene@freebsd.org> wrote:
> >> On Mon, Nov 30, 2020 at 08:19:40PM +0000, Chris Rees wrote:
> >> > The only reason I wrote the removed ports thing is because we were
> >> losing the link between old and new version when a port was removed and
> >> readded.  Is git likely to DTRT without it?
> >> I don't know, perhaps we can search the git history itself.
> >>
> >
> >The typical way I've seen this done is to add the metadata to either the
> >'bring it back' commit (so like our MFC After: lines), or using the 'not=
es'
> >feature in some way. The upside to either of these techniques is that you
> >preserve the data. the downside is that neither is known by git log.
> >
> >I've also seen weird merge commits attempted for this since git log knows
> >about them... The only problem is they are sufficiently weird that git l=
og
> >does odd things for everybody across them...
> >
> >I don't anticipate that git will do the right thing w/o help because the
> >ports tree has so many nearly identical files. For simple ports, the
> >Makefile could have been copied from anywhere, likewise some of the pkg*
> >files. Though for simple ones, lost history doesn't lose much that's
> >useful. For complex ones, it likely would do close to the right thing si=
nce
> >complex ports, kinda by definition, are different. Though I'd test this
> >notion (because as I'm typing this I find myself making too many mental
> >reservations)...
> >
> >To be honest, though, I think this is an area where some experimentation=
 to
> >understand the alternatives is needed because this use case is relatively
> >rare in the larger open source community.
>=20
> Isn't the ports copy or move fixable by doing it in 2 steps? That is,=20
> one commit is copying or moving the file without any modification inside=
=20
> the file whatsoever (sic!). This is obviously a bogus state for the=20
> ports tree, so a 2nd commit then changes the content of that new file to=
=20
> adjust its name or category or whatever.
>=20
> The good thing about a DVCS is that these 2 commits will obviously be=20
> pushed together, atomically, so no one will ever see the broken=20
> intermediate state. Unless of course you want to `git bisect` stuff, so=
=20
> it's not a panacea and also brittle as it depends on a human doing the=20
> right thing.

The state need not even be broken, just partially orphaned (e.g. perform
the copy, but don't hook the port up until the second commit.)  Likewise
for resurrection, revert the removal, but don't include the addition to
<category>/Makefile in the revert.  This would work best if deletes are
done as separate commits, but that shouldn't be a big deal.

-- Brooks

--cHMo6Wbp1wrKhbfi
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQEcBAEBAgAGBQJfx91zAAoJEKzQXbSebgfA/SQIAIKLaFbsvcimG9zYBwaXNkmr
pkH+m8ogGuqu1yZR32Lz9tk+qivJmHY8pJkBTyeUg6pFGkr9ycn9DGHG5l271xr4
LnpA6yoaIV8ID5sEGNYJ/LsosoxvDcGHK9D4O86T8+GJewq4/+PcfakHFFGrj3nW
opoc4oRqBSOw94ZYH4rlkGgA6vFdFleaGekqJlmhQSuBe5S2C/V71imwB10rMWm8
yUv/XdEvSX/M7eqaYo/uioZaxOJHMKJ6OfNyFD16xCVAgO3lcXhUv4Z40MoWpH5o
8DxHU1H9REnyulNVeEPcZpoWsBEND0wrCANVmTkrMs7DxMJDq0vxZszDgN0VDBY=
=WB/8
-----END PGP SIGNATURE-----

--cHMo6Wbp1wrKhbfi--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20201202183115.GE18452>