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 C3BAB1F45E for ; Thu, 20 Feb 2020 11:25:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727589AbgBTLZk (ORCPT ); Thu, 20 Feb 2020 06:25:40 -0500 Received: from cloud.peff.net ([104.130.231.41]:49124 "HELO cloud.peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1726837AbgBTLZk (ORCPT ); Thu, 20 Feb 2020 06:25:40 -0500 Received: (qmail 3305 invoked by uid 109); 20 Feb 2020 11:25:40 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with SMTP; Thu, 20 Feb 2020 11:25:40 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 3516 invoked by uid 111); 20 Feb 2020 11:34: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; Thu, 20 Feb 2020 06:34:42 -0500 Authentication-Results: peff.net; auth=none Date: Thu, 20 Feb 2020 06:25:39 -0500 From: Jeff King To: Junio C Hamano Cc: Matheus Tavares , git@vger.kernel.org, rhi@pengutronix.de Subject: Re: [PATCH] describe: output tag's ref instead of embedded name Message-ID: <20200220112539.GB1252160@coredump.intra.peff.net> References: <20200216065101.GA2937208@coredump.intra.peff.net> <20200218195402.GA21586@coredump.intra.peff.net> <20200219015733.GA81560@coredump.intra.peff.net> <20200219035650.GA84414@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 19, 2020 at 03:14:14AM -0800, Junio C Hamano wrote: > Jeff King writes: > > > I think a left a few things unsaid in my "v1.0-bob" example. I was > > imagining that there are _two_ v1.0 tags floating around. One that you > > consider "wrong", tagged by Bob, and one you like. You keep the latter > > in refs/tags/v1.0. > > Ahh, OK. > > To continue playing devil's advocate and to step back a bit, > > - The "git describe" command finds that the given commit is > "closest" to that tag Bob called "v1.0". > > - But if it outputs "v1.0" like the current code does, it cannot be > fed back to get_oid() to name the right object, if the given commit > is "at" the tag (i.e. there is no "-$number-g$objectname" suffix), > which is a problem. We want "git describe" to give an output > usable with get_oid() and the name must refer to the correct > object (i.e. the one given to "git describe" as an input). > > There are multiple approaches to make it possible to feed the output > back to get_oid() to obtain correct result: > [...] Thanks for clearly laying out your thinking. All of what you wrote makes sense to me and I'd be OK with any of the options you described. The "-g$objectname" one is kind of clever, and definitely not something I had thought of. We already have "--long", and of course we'd show the long version for any name that isn't an exact match anyway. So as an added bonus, it seems unlikely to surprise anybody who is expecting the current "show the tag, not the refname" output (though again, this is rare enough that I think people simply expect them to be the same ;) ). -Peff