From owner-freebsd-git@freebsd.org Sat Nov 28 22:49:27 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 AE81246D0FD for ; Sat, 28 Nov 2020 22:49:27 +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 4Ck6BH4XxZz4rTc; Sat, 28 Nov 2020 22:49:27 +0000 (UTC) (envelope-from rene@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1606603767; 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=h6Rso+gw/Y6H9gTjpYUNAW++rASy6SRZ9VBdFKEqa0c=; b=it/w28DWX9yK0I7UNJ7fdU2ZN3PxVwF+DIVnJG98nlkRLfOOaDKDkG0F79xF2QtyO7hZKB qPrQTeOpSvkO7olATeuSiRMYbaovSMEF56DAmijsjpL232ZduDgthNFquEelOzqn6i9RsC jzeK7Z/yXfhqaOxUUXe9kmwDhR+qLmNmLb3Yu/qM/WxOd8DzaPGKcHE5u0aiHBJhzuAprH X867yRDWwKE/3vV8j0ipe+OW9K9wAEnesduRQlJ6mUbu9TeBdxRSuEWL2xuPeD+qOjK+9L I8ds0zdD8GbP2q4zX1Mjk2du7Cy1IYXkhrer8cwZpyrdc3adHuVaEG8vCN9vEA== Received: by freefall.freebsd.org (Postfix, from userid 1185) id 8D10B1F44B; Sat, 28 Nov 2020 22:49:27 +0000 (UTC) Date: Sat, 28 Nov 2020 22:49:27 +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: <20201128224927.GC42737@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=1606603767; 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=h6Rso+gw/Y6H9gTjpYUNAW++rASy6SRZ9VBdFKEqa0c=; b=OFJpsqu69k4DGD+zIFyg7Bk3xk4NY3tuY2lIKlxndf+GB6zeRW9wi+xyG71HrbBrm2mb0e b9kmUVxx1uqPnQpfZQpar/TsbxSUCSXnrTrbgCKShY3Im6vavMsjObz8aMQmfMJCcrMf4Y 41R4uKELHKudjUYzAeBHeEI9R1YypwQNR6Z0JKmQ1LYuJHbKkGEWD8yQH6l3SRwyQEudWg aPwDKWlrB97ZsJHzV9e0xucbQAXPHq9ZD2owuopwggT5zcEbESSnxvlK7UMU9L9IMR747D I/VGxdw9fa3vFeUgFRXOmc5FQgj6jkcQ6SuC295J1G57AUVR2Xqt74KHos//BQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1606603767; a=rsa-sha256; cv=none; b=RwRSw42lpuqUrDha3zYgLACqrQ9Re1Qm9tgGnROQD2vgmSCVH8hRw9XKizP6N48p60H87e umwGc21aKykPv6NdokOTs72+YGNuHIWG/G1tjWWYF1hb3Rv47dA1qKrWo57aFjnO/FN8oZ gtGjQcukCS6xzS08W9jHjobCBtZyvqUEu6LiLrgIwfF0Y4Qqa27MbfPsjHeASPxF46lQbt xcWTA+IJHFer8uyDuXJcDO756QQbfnrW3R3jhSDIur70PH8vJr1YNLc9O7bvDPiEGPK04s hKPgtd7+sCSua5VR1bZGcpE/yfjaJOPO4HKS5e7s/pqwb/vCerVXZhY7WdEqfw== 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:49:27 -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 > > (4) if you really want, you can now delete oldmain, though I'd keep it > around for a while. > % git branch -D oldmain > > 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. > Ah, I read over step 2, and using the --allow-unrelated-histories flag has now created a local main that is 546215 commits ahead of origin/main :( Time to redo that step. René