From owner-freebsd-git@freebsd.org Mon Oct 5 15:34:05 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 CDA49427AB7 for ; Mon, 5 Oct 2020 15:34:05 +0000 (UTC) (envelope-from david@catwhisker.org) Received: from mailman.nyi.freebsd.org (mailman.nyi.freebsd.org [IPv6:2610:1c1:1:606c::50:13]) by mx1.freebsd.org (Postfix) with ESMTP id 4C4l4s36hKz433R for ; Mon, 5 Oct 2020 15:34:05 +0000 (UTC) (envelope-from david@catwhisker.org) Received: by mailman.nyi.freebsd.org (Postfix) id 693FB427AB5; Mon, 5 Oct 2020 15:34:05 +0000 (UTC) Delivered-To: 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 6907A42777E for ; Mon, 5 Oct 2020 15:34:05 +0000 (UTC) (envelope-from david@catwhisker.org) Received: from mx.catwhisker.org (mx.catwhisker.org [107.204.234.170]) (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 did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4C4l4r5Mvbz43KK; Mon, 5 Oct 2020 15:34:04 +0000 (UTC) (envelope-from david@catwhisker.org) Received: from albert.catwhisker.org (localhost [127.0.0.1]) by albert.catwhisker.org (8.16.1/8.15.2) with ESMTP id 095FY2F8014983; Mon, 5 Oct 2020 15:34:02 GMT (envelope-from david@albert.catwhisker.org) Received: (from david@localhost) by albert.catwhisker.org (8.16.1/8.16.1/Submit) id 095FY2n5014982; Mon, 5 Oct 2020 08:34:02 -0700 (PDT) (envelope-from david) Date: Mon, 5 Oct 2020 08:34:02 -0700 From: David Wolfskill To: Ulrich =?iso-8859-1?Q?Sp=F6rlein?= Cc: Ed Maste , git@freebsd.org Subject: Re: Question on (my) workflow migration svn -> git Message-ID: <20201005153402.GA1349@albert.catwhisker.org> References: <20200924201715.GR1390@albert.catwhisker.org> <20200924205326.GB64154@spindle.one-eyed-alien.net> <20200926020946.GK1390@albert.catwhisker.org> <20200926124212.GL92039@acme.spoerlein.net> <20201003223531.GA77534@albert.catwhisker.org> <20201004180342.GB1349@albert.catwhisker.org> <20201005150312.GQ92039@acme.spoerlein.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="ofekNuVaYCKmvJ0U" Content-Disposition: inline In-Reply-To: <20201005150312.GQ92039@acme.spoerlein.net> X-Rspamd-Queue-Id: 4C4l4r5Mvbz43KK X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:7018, ipnet:107.192.0.0/12, country:US] 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: Mon, 05 Oct 2020 15:34:05 -0000 --ofekNuVaYCKmvJ0U Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Oct 05, 2020 at 05:03:12PM +0200, Ulrich Sp=F6rlein wrote: > ... > > Sure -- and I (at least half-)expected that: I am experimenting, so at > > this stage, I expect a loty of stuff to be tried and tossed. >=20 > David, I'm not sure what "unhappiness" you were referring to. I just > updated the bare repo from my stable_12 worktree that I've created last > time. Unfortunately, I failed to run it within script(1), so I don't have a record, but the attempt to fetch (on the "bare" (but not "mirror") repo failed. As noted, when I re-created the repo, I created it as a "mirror"... which (based on your comments beliw) appears to have been a fairly reasonable thing to do. :-) > ... > What I tried: >=20 > % cd /tmp/stable_12 > % git fetch # takes some time, downloads 1GiB ... > Receiving objects: 100% (2734600/2734600), 1.04 GiB | 2.90 MiB/s, done. > Resolving deltas: 100% (2119516/2119516), completed with 368 local object= s. > From https://cgit-beta.freebsd.org/src > * branch HEAD -> FETCH_HEAD >=20 > This is a bit worrying, as it did not update any of the refs, so it's > borderline useless. A `git pull` instead of fetch will spew out a grant > massive diff though and churn like mad. ^C ^C >=20 > So we need to properly update our "upstream" bare repo first: > % cd /tmp/src.git > % git fetch -pP >=20 > That downloads everything again, which isn't surprising as it doesn't > know about all the other refs that were already fetched, and also > because the server offers that all in 1 giant packfile and I guess it > doesn't re-compress and encode things on the fly :/ >=20 > Turns out that refuses to clobber existing tags, so I run it again with > --force. Still no luck with refs, turns out this wasn't a --mirror > clone, so I add `mirror =3D true` and `fetch =3D +refs/*:refs/*` under its > remote section. Aye; I had noted the parts (from "git help clone") about how "--mirror" handles all branches and refs, and figured that would be a Good Thing for my use case. > % git fetch --force --all > ... > aaahh, that finally gets me all the refs into a proper mirror bare repo. :-) So far (2 out of 2 tries, so take it with a "grain of salt") mere "git fetch --all" seems to be adequate for the mirror repo. > Back to stable/12 workspace and force a checkout to stable/12, even > though due to hash re-spinning it is something "totally" unrelated. >=20 > % cd /tmp/stable_12 > % git status # will list how we are so, so different from what is now > # stable/12 in our local upstream bare repo that we share > # refs with > % git reset --hard stable/12 # yolo, get us stable/12 no matter what > # we have to throw away In practice, I find that I do not need to specify the target branch -- just "git reset --hard" appears to be adequate. > So there you have it. No need to throw away your existing bare repo, but > starting out with a --mirror clone would've made things easier. So I am seeing. So it's good that this is documented, after a fashion. > Then you need to keep in mind git never wants to throw away any diffs > you might have, and we might get 1 or 2 more massive "diffs" due to > different hashes till the final switch over date. Aye. For now, I'll: * Continue using svn for actually updating the sources I use to keep my systems up-to-date. * Experiment with setting something up to update my local private git mirror repo on a daily basis, as well. * Start running some comparisonsa -- and, with luck, build some confidence that the use of git may work for me. > As you want a read-only mirror/checkout of this, you can just forcefully > `reset --hard` the workspace to whatever git hash or reference you > fancy. Well, the mirror repo is read-only. I do mess with the working copy (e.g. for experimenting with patches after I've reported an issue). I also rely on having mt kernel config file represented in the source tree by a symlink to a different hierachy of files under separate revision control, so that could also prove to become "interesting." >=20 > > > Deleting and cloning again from scratch is a reasonable way to > > > interact with the repository during this stage. > > ... > > > For the time being I think that you'd want to remove the bare repo and > > > worktrees, and recreate everything from scratch over a hash change. >=20 > Not really required, but you need to understand the data model to be > able to dig your clone out of that mess. Fair, but given that it was a "scratch" repo anyway, blowing the old one away and re-creating (as a real "mirror") appears to have worked well in this case. > > And that part's fine. > >=20 > > Where I'm having a problem is for the (usual) case of "no hash change", > > but there have been commits to the source-of-truth: it appears that "git > > fetch --all" copies those to my local private mirror, but I don't see > > how to get my "worktree" updated. >=20 > In your stable_12 workspace, you should be able to do this normally with > `git pull origin stable/12`, but that is a) not going to work while we > respin hashes and b) overkill, as you don't even want any of the > safeguards. So in short: >=20 > - in your bare --mirror clone: git fetch (--force) Aye. > - in your workspace: git reset --hard stable/12 Aye (though as noted above, the target branch appears to be superfluous). > This is not expected to make sense That is actually a fairly large relief to see.... :-} > Uli Thanks again -- I think we're actually closing in on a solution (for my case). Peace, david --=20 David H. Wolfskill david@catwhisker.org "the end of the pandemic is in sight" -- Donald Trump (while infected with SARS-COV-2) See http://www.catwhisker.org/~david/publickey.gpg for my public key. --ofekNuVaYCKmvJ0U Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGTBAEBCgB9FiEE4owz2QxMJyaxAefyQLJg+bY2PckFAl97POpfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEUy OEMzM0Q5MEM0QzI3MjZCMTAxRTdGMjQwQjI2MEY5QjYzNjNEQzkACgkQQLJg+bY2 PcmVrwf9G8ahOLaHUXxJjl9gH9GZ2XXjLjDNPJfaWq+3V7tQASJOSl31+wL0REG1 ah1oizPlVGh1ZtBPz0I46sD73oVgy2qKXHroSsVZei5Ka/Sj630ZygbTnInhEEIO oCZSH4iJ5y/zQOic0lApIo87C22tIEe7e9c9lrk+gD8SAeTFfza4/ngkq/SGenD0 lVs8xC91ni7SEqEaQFwq5Pn1ZkspKr7WjcgSEeMVVzptCAsFXyOI0hBsS2zeMN1+ iXFgAOeDEp1/G9ki+oloPDY4wVGcyNdX3Rm+V77zLDPVU67gk1io4RwuojuFNxU+ gd57eCuSHaqzwzHDsRgap2aRSxMtTg== =oF9f -----END PGP SIGNATURE----- --ofekNuVaYCKmvJ0U--