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.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 20471 invoked from network); 29 Dec 2020 20:04:24 -0000 Received: from krantz.zx2c4.com (192.95.5.69) by inbox.vuxu.org with ESMTPUTF8; 29 Dec 2020 20:04:24 -0000 Received: by krantz.zx2c4.com (ZX2C4 Mail Server) with ESMTP id 83b4e4ca; Tue, 29 Dec 2020 19:54:13 +0000 (UTC) Return-Path: Received: from mail.zx2c4.com (mail.zx2c4.com [192.95.5.64]) by krantz.zx2c4.com (ZX2C4 Mail Server) with ESMTPS id ddfb1c4e (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for ; Tue, 29 Dec 2020 19:54:11 +0000 (UTC) Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTP id f58a4a52 for ; Tue, 29 Dec 2020 19:54:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=zx2c4.com; h=mime-version :references:in-reply-to:from:date:message-id:subject:to:cc :content-type:content-transfer-encoding; s=mail; bh=vRbk4QUgBgLj hIMQG3nRt+sW3k0=; b=L1NUc/viNDfKL+M2Lgpg6jb/6BdvJnXzSqtb2Bov/M3J vbpbojvGPTV9bjzazPOLHB79G+31leeTEgDMjndlCqdbOZ4xHYOAtALuHN5ZsyW/ O/RWxIy/D5NeG3WI8a41j9WEAJ3JP/jVZJxrrhrzeSvpQFmo/LwnXwe8TurkQWgT jucfEs6bqFYkAOP5XQbpwNREe3YM/H1RmxTTKmqgoeFHr4A6mcCkK7NKb47CbFrd BDEYhpWrvq+FyC+txr1jKlBqIhnVfK9GCjntiAOt5Jq9uMkuDLqu2dQG0oJqgxnT Gn39pqXWuII/44J47LnzkkxbWYr9px9ZXM//qZJYaA== Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id 09a5f30f (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for ; Tue, 29 Dec 2020 19:54:57 +0000 (UTC) Received: by mail-yb1-f174.google.com with SMTP id w127so13196885ybw.8 for ; Tue, 29 Dec 2020 12:04:18 -0800 (PST) X-Gm-Message-State: AOAM530FwUrYwKZwu3IRf1k59nwRGMQZm4Iw68Q1qLRJtb35oJGPTL7K SOJid0dopTOOd5PtOQyFuwpkSUUFAgKE5nlHv5w= X-Google-Smtp-Source: ABdhPJzgEY8CPNgNzi4Rulgm/MR6WA5VPgNIJHtnCokO75iUPwYXeA3IpTGwhmwQGqE/aUpR17LcsGtrM/vXPoQVf5k= X-Received: by 2002:a25:b813:: with SMTP id v19mr47494461ybj.178.1609272257549; Tue, 29 Dec 2020 12:04:17 -0800 (PST) MIME-Version: 1.0 References: <20201228133550.67945-1-uqs@FreeBSD.org> In-Reply-To: From: "Jason A. Donenfeld" Date: Tue, 29 Dec 2020 21:04:06 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] Handle tags outside of refs/tags gracefully. To: =?UTF-8?Q?Ulrich_Sp=C3=B6rlein?= Cc: cgit@lists.zx2c4.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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, Dec 29, 2020 at 7:22 PM Ulrich Sp=C3=B6rlein wrot= e: > > 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? > > > >Special casing "refs/" also winds up breaking repositories that > >accidentally push tags literally named 'refs/tags/something'. I've > >seen this happen quite a few times in the real world. > > Nothing is really enforced by git, so you can put tags anywhere (and > suffer the consequences). We decided to have these tags not be pulled by > default and stashed them under refs/backups/foo so they are not directly > user visible after a default clone. > > If I ask for the tag refs/backups/foo, I expect it to look for that, and > not for refs/tags/refs/backups/foo. That is what I feel most of the git > commands do, that need to look up a ref. It was just striking how the > log handler does handle this just fine (as does the git CLI). 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? Jason