From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 31139 invoked from network); 5 Jan 2021 13:40:37 -0000 Received: from krantz.zx2c4.com (192.95.5.69) by inbox.vuxu.org with ESMTPUTF8; 5 Jan 2021 13:40:37 -0000 Received: by krantz.zx2c4.com (ZX2C4 Mail Server) with ESMTP id e44d0bff; Tue, 5 Jan 2021 13:29:30 +0000 (UTC) Return-Path: Received: from mail.thenautilus.net (mail.thenautilus.net [5.79.87.27]) by krantz.zx2c4.com (ZX2C4 Mail Server) with ESMTPS id 6055e8f8 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for ; Tue, 5 Jan 2021 13:29:28 +0000 (UTC) Received: (qmail 1251 invoked from network); 5 Jan 2021 13:40:11 -0000 Received: from unknown (HELO nautilus) (dakkar@::ffff:81.2.107.215) by 0 with ESMTPA; 5 Jan 2021 13:40:11 -0000 Date: Tue, 5 Jan 2021 13:40:10 +0000 From: Gianni Ceccarelli To: cgit@lists.zx2c4.com Subject: Re: [PATCH] Handle tags outside of refs/tags gracefully. Message-ID: <20210105134010.19c66f2c@nautilus> In-Reply-To: References: <20201228133550.67945-1-uqs@FreeBSD.org> <20201229203309.33f1fcae@thenautilus.net> <20210105115303.2cc704f9@nautilus> X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: cgit@lists.zx2c4.com X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: List for cgit developers and users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: cgit-bounces@lists.zx2c4.com Sender: "CGit" On 2021-01-05 John Keeping wrote: > I think something like option 2 is the right answer here, since that > brings us closer to Git's behaviour. ``git tag`` never looks anywhere but under ``refs/tags/``. Not even ``git tag --contains`` will show annotated tags that are only referenced outside that path. OTOH (on my example repo):: $ git show HEAD commit 4081ad6720f3f60f5f11a77f1d932517496e33ba (HEAD -> master, refs/weird/thing, tag: refs/weird/annotated, tag: foo, origin/master, origin/HEAD) Author: dakkar Date: 2020-12-29 20:10:18 +0000 first $ git tag -v refs/weird/annotated error: tag 'refs/weird/annotated' not found. So maybe CGit is already behaving very closely to git. > Does the patch below help? > > [snip] > > +static const char *tag_patterns[] = { > + "%s", > + "refs/%s", > + "refs/tags/%s", > + NULL > +}; I feel like those strings should be in the reverse order: we've been asked to show a tag, let's try to resolve the ref as an actual tag before guessing. -- Dakkar - GPG public key fingerprint = A071 E618 DD2C 5901 9574 6FE2 40EA 9883 7519 3F88 key id = 0x75193F88