From owner-freebsd-git@freebsd.org Wed Dec 23 10:34:17 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 234AA4BA3B4 for ; Wed, 23 Dec 2020 10:34:17 +0000 (UTC) (envelope-from uqs@freebsd.org) Received: from acme.spoerlein.net (acme.spoerlein.net [IPv6:2a05:fc87:1:5::15]) (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 (2048 bits) client-digest SHA256) (Client CN "www.spoerlein.net", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D18hS513Jz4fWY for ; Wed, 23 Dec 2020 10:34:16 +0000 (UTC) (envelope-from uqs@freebsd.org) Received: from localhost (acme.spoerlein.net [IPv6:2a05:fc87:1:5:0:0:0:15]) by acme.spoerlein.net (8.16.1/8.15.2) with ESMTPS id 0BNAY8ct052253 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Wed, 23 Dec 2020 11:34:10 +0100 (CET) (envelope-from uqs@freebsd.org) Date: Wed, 23 Dec 2020 11:34:08 +0100 From: Ulrich =?utf-8?B?U3DDtnJsZWlu?= To: Bakul Shah Cc: David Wolfskill , freebsd-git@freebsd.org Subject: Re: Src repository is available on git.freebsd.org Message-ID: References: <1527634C-4E31-4325-BB93-BDFF0C8ADB8C@iitbombay.org> <0C3B8F33-851B-4513-815A-09F33EF96DE8@iitbombay.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <0C3B8F33-851B-4513-815A-09F33EF96DE8@iitbombay.org> User-Agent: Mutt/2.0.1 (2020-11-14) X-Rspamd-Queue-Id: 4D18hS513Jz4fWY X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [0.00 / 15.00]; ASN(0.00)[asn:39540, ipnet:2a05:fc87::/32, country:CH]; local_wl_from(0.00)[freebsd.org] 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: Wed, 23 Dec 2020 10:34:17 -0000 On Tue, 2020-12-22 at 14:18:10 -0800, Bakul Shah wrote: >On Dec 22, 2020, at 2:03 PM, David Wolfskill wrote: >> >> On Tue, Dec 22, 2020 at 01:51:39PM -0800, Bakul Shah wrote: >>> I have been tracking cgit-beta.freebsd.org since September. >>> What is the process for switching over to git.freebsd.org? >>> I thought there were instructions for that but I can't find them any more! >>> Thanks. >>> .... >> >> I aqssumed(!) that the hashes would be different, so I moved aside the >> repo I had from cgit-beta and cloned a new one (from git.freebsd/org), >> then removed the old one once I was satisfied that the new one was OK. > >Forgot to add that I wanted to switch over *without* blowing away 3.2GB >of local git bits. Hashes shouldn't change unless something major got >redone. Comparing hashes from my local repo with https://cgit.freebsd.org/src/commit/ >I see they are the same. 3.2GB sounds wrong, it looks like you have the new hashes and the old hashes and no GC run in between. This is expected and would fix itself over time, you might want to compress things down to 1.6GB however, using: git gc --prune=now BEWARE: that you don't have any loose refs that you still might need later on. If all your changes are in regular branches and you didn't go wild with rebase -i or anything, then this should be safe. To not re-download everything, use --reference to point to an existing clone, that is: git clone --reference /path/to/old/clone https://git.FreeBSD.org/src.git /path/to/new/clone You could also: git init git add remote .... cp the objects/* files over to the new repo git fetch >> A couple of caveats: >> * I'm not a committer; I merely use the repo a a "source of truth" for >> updating machines locally, and I never have any commits to be pushed >> anywhere. > >Same here. > >> >> * I actually used "git clone --mirror" (as noted in >> https://www.catwhisker.org/~david/FreeBSD/repo-sync.html); I then >> clone from that mirror to make working copies. There are certainly >> other ways to accomplish this; some may be better for some folks. > >I don't quite do this because I am tracking -current and -stable locally >and am using worktrees so as to avoid keeping multiple local git copies. >AFAIK a mirror would blow away any local changes. I think you're right, for that a single --bare clone (not --mirror) plus workspaces and local branches sounds more applicable. Cheers Uli