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-Status: No, score=-3.8 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_PASS, SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id 6D8C31F66F for ; Wed, 18 Nov 2020 01:24:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727937AbgKRBWb (ORCPT ); Tue, 17 Nov 2020 20:22:31 -0500 Received: from cloud.peff.net ([104.130.231.41]:33282 "EHLO cloud.peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726532AbgKRBWb (ORCPT ); Tue, 17 Nov 2020 20:22:31 -0500 Received: (qmail 19910 invoked by uid 109); 18 Nov 2020 01:22:31 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with ESMTP; Wed, 18 Nov 2020 01:22:31 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 6968 invoked by uid 111); 18 Nov 2020 01:22:30 -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; Tue, 17 Nov 2020 20:22:30 -0500 Authentication-Results: peff.net; auth=none Date: Tue, 17 Nov 2020 20:22:30 -0500 From: Jeff King To: Felipe Contreras Cc: "Eric W. Biederman" , Johannes Schindelin via GitGitGadget , Git , Johannes Schindelin , Junio C Hamano Subject: Re: [PATCH 00/28] Use main as default branch name Message-ID: <20201118012230.GB650959@coredump.intra.peff.net> References: <87r1oraewl.fsf@x220.int.ebiederm.org> <20201117233313.GB642410@coredump.intra.peff.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Tue, Nov 17, 2020 at 06:18:03PM -0600, Felipe Contreras wrote: > On Tue, Nov 17, 2020 at 5:33 PM Jeff King wrote: > > On Tue, Nov 17, 2020 at 04:47:56PM -0600, Felipe Contreras wrote: > > > > This should be easy to do if we make "origin" be a pseudo ref that > > > points to "origin/HEAD" (and we could introduce "origin/@"). > > > > Didn't we already do this long ago? refs/remotes/%s/HEAD is special in > > the dwim_ref() lookup: > > > > $ git rev-parse --symbolic-full-name origin > > refs/remotes/origin/master > > Hmmm. For some reason none of my remotes do have a HEAD. > > If I do "git remote add", and then fetch, the HEAD doesn't seem to be present. Yes, I have run into that, and it's definitely annoying. The refs/remotes//HEAD symref is created by clone, but is not updated by "fetch". That's intentional, because it's supposed to represent a local choice (that is merely seeded by the remote side). But it seems like adding it if it's missing might be reasonable. I'm not sure if "git remote add" should be doing it (it already can do it with "git remote set-head -a", but that is not the default when adding a new remote, which otherwise does not contact the network at all). Or if "git fetch" should be doing it. Certainly having "fetch --update-remote-head" would be fine, but that doesn't really solve the problem (which is that people don't realize they need to specify it). There was some related discussion in: https://lore.kernel.org/git/CAEXP2g8-reK+u2FaO=mMP-nsvuDDWGpwV_tyKG5L5XpU=1LQeg@mail.gmail.com/ but I don't think any patches came out of that. -Peff