From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-3.9 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by dcvr.yhbt.net (Postfix) with ESMTP id 36C2F1F466 for ; Fri, 17 Jan 2020 19:26:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729335AbgAQT0L (ORCPT ); Fri, 17 Jan 2020 14:26:11 -0500 Received: from cloud.peff.net ([104.130.231.41]:39090 "HELO cloud.peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1726897AbgAQT0L (ORCPT ); Fri, 17 Jan 2020 14:26:11 -0500 Received: (qmail 13006 invoked by uid 109); 17 Jan 2020 19:26:11 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with SMTP; Fri, 17 Jan 2020 19:26:11 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 18988 invoked by uid 111); 17 Jan 2020 19:32:42 -0000 Received: from coredump.intra.peff.net (HELO sigill.intra.peff.net) (10.0.0.2) by peff.net (qpsmtpd/0.94) with (TLS_AES_256_GCM_SHA384 encrypted) ESMTPS; Fri, 17 Jan 2020 14:32:42 -0500 Authentication-Results: peff.net; auth=none Date: Fri, 17 Jan 2020 14:26:10 -0500 From: Jeff King To: Junio C Hamano Cc: Derrick Stolee via GitGitGadget , git@vger.kernel.org, jrnieder@gmail.com, Derrick Stolee Subject: Re: [PATCH] fetch: add --no-update-remote-refs Message-ID: <20200117192610.GC11358@coredump.intra.peff.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Fri, Jan 17, 2020 at 11:13:10AM -0800, Junio C Hamano wrote: > > Add a --[no-]update-remote-refs option to 'git fetch' which defaults > > to the existing behavior of updating the remote refs. This allows > > a user to run > > > > git fetch --no-update-remote-refs +refs/heads/*:refs/hidden/* > > > > to populate a custom ref space and download a pack of the new > > reachable objects. > > Hmph. I have to wonder if this should have been the default. That > is, when refs/heads/X on the remote is configured to be copied to > refs/remotes/origin/X on this side, and an explicit refspec says it > should go some other place (i.e. refs/hidden/X), shouldn't that > automatically bypass configured +refs/heads/*:refs/remotes/origin/* > refspec? In any case, it is too late to change that now. It used to be the default. You can blame 2013-me. ;) Before that, though, we had people complaining the other way ("I just fetched from the remote, but my tracking ref is stale!"). > > 3. With fetch.writeCommitGraph enabled, the refs/hidden refs are > > used to update the commit-graph file. > > I have a moderately strong suspicion that it would be better to make > this "--ignore-configured-refspecs" and implemented without special > casign the "refs/remotes/" hierarchy like the code does by > hardcoding. Yeah, I just independently wrote something similar. Your "--refmap" option can accomplish that already. > I also wonder if auto-following of tags should be disabled at the > same time. I have no good argument either way (yet). I _didn't_ think of tag auto-following in my other response. That's a good point. I think he'd probably just want to use "--no-tags" for the background fetch. You'd end up having to fetch the tag objects themselves during the "real" fetch, but presumably they're very small compared to the rest of history. You could also do: git fetch --refmap= +refs/heads/*:refs/hidden/heads/* +refs/tags/*:refs/hidden/tags/* to get everything in your pre-fetch (though you actually get more than the real fetch would need, since by default it won't grab tags which don't point to otherwise-reachable history). -Peff