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 980761F619 for ; Wed, 26 Feb 2020 18:40:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727105AbgBZSkj (ORCPT ); Wed, 26 Feb 2020 13:40:39 -0500 Received: from cloud.peff.net ([104.130.231.41]:55236 "HELO cloud.peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1726998AbgBZSkj (ORCPT ); Wed, 26 Feb 2020 13:40:39 -0500 Received: (qmail 20964 invoked by uid 109); 26 Feb 2020 18:40:39 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with SMTP; Wed, 26 Feb 2020 18:40:39 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 28031 invoked by uid 111); 26 Feb 2020 18:49:46 -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; Wed, 26 Feb 2020 13:49:46 -0500 Authentication-Results: peff.net; auth=none Date: Wed, 26 Feb 2020 13:40:38 -0500 From: Jeff King To: Chris Jerdonek Cc: "brian m. carlson" , git@vger.kernel.org Subject: Re: create reflog for reflog-less ref Message-ID: <20200226184038.GB23188@coredump.intra.peff.net> References: <20200226023909.GC7911@camp.crustytoothpaste.net> <20200226034731.GA2915944@coredump.intra.peff.net> <20200226094716.GA14546@coredump.intra.peff.net> 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 Wed, Feb 26, 2020 at 02:21:59AM -0800, Chris Jerdonek wrote: > > The "touch" trick I showed would work for that, but it's not going to be > > portable going forward. I don't think it would be a bad idea to have > > some way of triggering a "noop" reflog update via update-ref, where we > > either create the reflog as empty, or insert a pointless entry going > > from the current sha1 to itself. But AFAIK that doesn't exist right now. > > Thanks. By the way, this functionality does already seem to exist for ref HEAD: > > $ git update-ref -m my-message HEAD HEAD > $ git reflog HEAD > 3ccacdc (HEAD -> master) HEAD@{0}: my-message > ... > > I don't know why it would work for HEAD though and what's different > about the mechanism. I thought it might be because it's a symbolic > ref, but it didn't work for other symbolic refs when I tried (even > ones that already had a reflog). I suspect that wasn't really intentional, but just a by-product of the way we treat HEAD's reflog specially (when we update any other ref, if HEAD points to it, we'll update the HEAD reflog, too). But I could be wrong (you'd have to dig in the commit history around that code). -Peff