From owner-freebsd-git@freebsd.org Sat Nov 28 22:22:06 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 E862146CB44 for ; Sat, 28 Nov 2020 22:22:06 +0000 (UTC) (envelope-from rene@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (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 "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ck5Zk6Jp8z4qjw; Sat, 28 Nov 2020 22:22:06 +0000 (UTC) (envelope-from rene@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1606602126; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ug86aGvwMvWAwVDwzVYpMwV+BJKmk4obxeFFkUjIcBU=; b=V4RT0Tn2kOlc56xMWJiJuU0S5wKrLkITi9ZhV8z9LMwi6w7dzxG19IGMXO5N1HOpFv7SGh l3njWRxdE6WAUgGLdgNMpKSK9Ld2AfYXJkKam+LqCTTVkHU66o5seAkR51kLS+YsbNOIm7 4f1oiACaavt3IRmaq1GpFixGtB5LEJLGQNu8/NklRJ237Fa/+2K/l3FJBUW5KYbfPJXjYH SN916+VjB/VrxKpLAMDK10gfMM8J2gw9JY2V22fvuI0CQIPzKAePW5tiu0eVt53RNY9xaa QrgccDy7fu2Qz32elkURNL6Cu9n6NjcgrMWwbNlDK36GvYOBCfx7Ob05hjbpYw== Received: by freefall.freebsd.org (Postfix, from userid 1185) id C78371F215; Sat, 28 Nov 2020 22:22:06 +0000 (UTC) Date: Sat, 28 Nov 2020 22:22:06 +0000 From: Rene Ladan To: Warner Losh Cc: Ulrich =?iso-8859-1?Q?Sp=F6rlein?= , freebsd-git@freebsd.org Subject: Re: HEADS UP: freebsd-ports hashes were all changed Message-ID: <20201128222206.GA42737@freefall.freebsd.org> References: <20201128165115.GA22587@freefall.freebsd.org> <20201128205528.GA58416@freefall.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1606602126; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ug86aGvwMvWAwVDwzVYpMwV+BJKmk4obxeFFkUjIcBU=; b=E03fb85ifgu05lFsi4h9VgPigSBmRYA2a8afjknRMuD1HUjE9g4xoLy39x29rDt4Fh7YIN zpufTTXKESgwcTWQssjo+4ANX0LiqYzlA1iEzR7QPbNlDfFCpccEnqnWNUd6U2dMo2AY1p oyneymPVikZzequYxaVjyA240U/2ZX5lXDQaGbAGtEbU6FiO4g1/4oweFr2d3jY1gX2OlU l4BxHuydRlFS3N1j57XIK+dVdoiWurtJ1jChavBnjEi2G3pHwEPeviYqvuXE0vj0p/3fMo zOEijTOsqX9tkVveCg+Rf+MbRUNCi1EkMzJB6gtF/UmqyW+MeLFRyLJBDZQf5g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1606602126; a=rsa-sha256; cv=none; b=RaD8BvrExyA0nPFHZ/52Tkyq9SwI5GolkqWtVQHX01Lp6nunMQ20IggSM+9v0kL8nRxsqS IoSaVPxlSehZwmirrx8fXnJBHnFrP8xe8TyBdvvumii7WCc0xogqZzHnxzze+cWpTNrqry dAZQsCw+85GxzRg0SzNEzN4xe/id7HeWEkRqTdjVeAPyafF3OujhCThoz2DkpFf5JaVsNq B+5wmMHqpRyJK4Yi5R8sqsyZNgzAkB/pJDlCm7K5Ecgm/kgmfLCALT872ntlEStiC7Vzuk 6iZpG6bhTxg6hVOWqSnJbjj+r0PKhQfwqD/scIxI9pVJmC7LmReU0cO1LeYAew== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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: Sat, 28 Nov 2020 22:22:07 -0000 On Sat, Nov 28, 2020 at 02:49:44PM -0700, Warner Losh wrote: > On Sat, Nov 28, 2020 at 1:55 PM Rene Ladan wrote: > > > On Sat, Nov 28, 2020 at 01:41:02PM -0700, Warner Losh wrote: > > > On Sat, Nov 28, 2020 at 9:51 AM Rene Ladan wrote: > > > > > > > On Sat, Nov 28, 2020 at 12:52:01PM +0100, Ulrich Spörlein wrote: > > > > > On Sat, 2020-11-28 at 12:24:41 +0100, Ulrich Spörlein wrote: > > > > > >Hi folks, bad news > > > > > > > > > > > >While carving out the history of the access and mentors file (we > > want to > > > > > >retain that for historical analysis, which people seem to do from > > time > > > > > >to time), I overlooked that fact that the previous runs for ports > > did > > > > > >contain all of CVSROOT, but the new one, by necessity would not > > contain > > > > > >CVSROOT/{access,mentors}, in fact, I dropped the whole CVSROOT > > prefix > > > > > >from the latest rules file. It should never have been there in the > > first > > > > > >place. :( > > > > > > > > > > > >All that is to say that this of course means all the git commit > > hashes > > > > > >for the ports tree have changed. Oops. > > > > > > > > > > > >Sorry about that, please let me know if you need help in > > transplanting > > > > > >your work from old hashes to new hashes. > > > > > > > > > The web finds [1] which would translate to > > > > > > > > git merge orgin main --allow-unrelated-histories > > > > > > > > but I'm not sure if this is the correct hammer? > > > > > > > > [1] > > > > > > https://github.com/git/git/blob/master/Documentation/RelNotes/2.9.0.txt#L58-L68 > > > > > > > > > > I'm not sure either. What does your tree look like? Is it just tracking > > > upstream? Or do you have changes / branches? > > > > > I have a few local branches for some WIP things that I keep in sync with > > main. > > None of those are pushed obviously. If all else fails I can just reclone > > the > > repository and recreate those branches, they are of a temporary nature. > > > > OK. So, at this point, 'main' locally is the old hash, and 'origin/main' is > the new hash. > > I'd recommend the following. What it does is creates an 'oldmain' branch to > match the current repo, then recreates the new hash main as 'main' and then > rebases all your WIP branches to main with the new hashes. It looks a bit > scary, I'll grant, but I've done similar things a lot. If any is > unfamiliar, then reading the man page first is a good idea. If things go > wrong, then 'git reflog' will help you recover the values for old branches, > etc. git rebase --abort is your friend if it's going horribly sideways... > > (1) Create a new name for the old main: > % git checkout main > % git checkout -b oldmain > > (2) Now, make main point to the new hashes > % git checkout -B main origin/main > > (3) now, for each of your WIP branches, rebase them (I have -i here, but > that's finger memory). > % git rebase -i oldmain $WIPNAME --onto main > This mostly worked fine. There were some hiccups with one somewhat outdated branch which could all be fixed with some manual merge conflicts I think. > (4) if you really want, you can now delete oldmain, though I'd keep it > around for a while. > % git branch -D oldmain > I'll just keep it around for a while. > Make sense? Oh, if it does go terribly sideways, and you need to just > reclone into a new directory, you can check out > http://bsdimp.blogspot.com/2020/08/how-to-transport-branch-from-one-git.html > which will show you how to use git format-patch and git am to move the > branches to the new repo. Again, git reflog can help if branch names get > screwed up since that's as close as git gets to keeping meta-data history... > > And please let me know if it works, or if you encounter any issues. > Thanks for the instructions! René