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 23828 invoked from network); 29 Dec 2020 20:33:30 -0000 Received: from krantz.zx2c4.com (192.95.5.69) by inbox.vuxu.org with ESMTPUTF8; 29 Dec 2020 20:33:30 -0000 Received: by krantz.zx2c4.com (ZX2C4 Mail Server) with ESMTP id 6534d8f3; Tue, 29 Dec 2020 20:23:20 +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 478b811c (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for ; Tue, 29 Dec 2020 20:23:19 +0000 (UTC) Received: (qmail 4710 invoked from network); 29 Dec 2020 20:33:11 -0000 Received: from unknown (HELO localhost) (dakkar@::ffff:10.111.0.42) by 0 with ESMTPA; 29 Dec 2020 20:33:11 -0000 Date: Tue, 29 Dec 2020 20:33:09 +0000 From: Gianni Ceccarelli To: cgit@lists.zx2c4.com Subject: Re: [PATCH] Handle tags outside of refs/tags gracefully. Message-ID: <20201229203309.33f1fcae@thenautilus.net> In-Reply-To: References: <20201228133550.67945-1-uqs@FreeBSD.org> 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 Tue, 2020-12-29 at 12:37:43 +0100, Jason A. Donenfeld wrote: > This is for the tag UI, though. Aren't tags supposed to live in > refs/tags/ by definition? Yes. The "git tag" manpage says: >> Add a tag reference in refs/tags/, unless -d/-l/-v is given to >> delete, list or verify tags On 2020-12-29 "Jason A. Donenfeld" wrote: > The fact that the git CLI handles it properly actually is a compelling > reason to mimic its logic. How does it handle this scenario? I assume > it looks up both possibilities and returns the first one that matches? > In which order does it check? Depends which sub-command we're talking about:: $ mkdir /tmp/a $ cd /tmp/a $ git init $ touch foo && git add foo && git commit -m first $ mkdir .git/refs/weird && git rev-parse HEAD > .git/refs/weird/thing $ git log --decorate commit 4081ad6720f3f60f5f11a77f1d932517496e33ba (HEAD -> master, refs/weird/thing) Author: dakkar Date: 2020-12-29 20:10:18 +0000 first Now, ``git checkout weird/thing`` works, as does ``git log weird/thing``, or anything that uses ``rev-parse`` internally. ``git tag`` will *not* show ``weird/thing`` because it's not a tag, it's a non-tag ref:: $ git tag -d weird/thing error: tag 'weird/thing' not found. As far as CGit is concerned, these work: * https://www.thenautilus.net/cgit/example/log/?h=weird/thing * https://www.thenautilus.net/cgit/example/commit/?h=weird/thing * https://www.thenautilus.net/cgit/example/tree/?h=weird/thing * https://www.thenautilus.net/cgit/example/diff/?h=weird/thing -- Dakkar - GPG public key fingerprint = A071 E618 DD2C 5901 9574 6FE2 40EA 9883 7519 3F88 key id = 0x75193F88