List for cgit developers and users
 help / color / mirror / Atom feed
From: "Jason A. Donenfeld" <Jason@zx2c4.com>
To: "Ulrich Spörlein" <uqs@freebsd.org>
Cc: cgit@lists.zx2c4.com
Subject: Re: [PATCH] Handle tags outside of refs/tags gracefully.
Date: Tue, 29 Dec 2020 21:04:06 +0100	[thread overview]
Message-ID: <CAHmME9rDRjGoXe25qx-XfxpgAsTscz=__PH6exgWB5-4mLdsLg@mail.gmail.com> (raw)
In-Reply-To: <X+tz0yd3BMgqxA8U@acme.spoerlein.net>

On Tue, Dec 29, 2020 at 7:22 PM Ulrich Spörlein <uqs@freebsd.org> wrote:
>
> 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

  reply	other threads:[~2020-12-29 20:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-28 13:35 Ulrich Spörlein
2020-12-29 11:37 ` Jason A. Donenfeld
2020-12-29 18:22   ` Ulrich Spörlein
2020-12-29 20:04     ` Jason A. Donenfeld [this message]
2020-12-29 20:33       ` Gianni Ceccarelli
2021-01-05 11:53         ` Gianni Ceccarelli
2021-01-05 13:09           ` John Keeping
2021-01-05 13:40             ` Gianni Ceccarelli
     [not found]               ` <CAJ9axoSnfttirTwaVNhZPa73KSw+PCTq_5MVyvUfT7AcDxLXPg@mail.gmail.com>
2021-01-05 17:12                 ` Gianni Ceccarelli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAHmME9rDRjGoXe25qx-XfxpgAsTscz=__PH6exgWB5-4mLdsLg@mail.gmail.com' \
    --to=jason@zx2c4.com \
    --cc=cgit@lists.zx2c4.com \
    --cc=uqs@freebsd.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).