List for cgit developers and users
 help / color / mirror / Atom feed
From: Gianni Ceccarelli <dakkar@thenautilus.net>
To: cgit@lists.zx2c4.com
Subject: Re: [PATCH] Handle tags outside of refs/tags gracefully.
Date: Tue, 5 Jan 2021 11:53:03 +0000	[thread overview]
Message-ID: <20210105115303.2cc704f9@nautilus> (raw)
In-Reply-To: <20201229203309.33f1fcae@thenautilus.net>

I have found an annoying case…

In the repository created as per my previous message, I did::

  $ git tag -a foo
  $ git rev-parse refs/tags/foo > .git/refs/weird/annotated
  $ git push origin refs/weird/*:refs/weird/*

This creates an "annotated tag", which is an object in the store, not
just a reference.

Now CGit shows the ``refs/weird/annotated`` as a tag in
https://www.thenautilus.net/cgit/example/ and several other views, but
following that link goes to
https://www.thenautilus.net/cgit/example/tag/?h=refs/weird/annotated
which says "bad tag reference"

I hope you'll concur this is not the best behaviour.

I see several ways to "fix" this:

* in all the various views, don't show links to annotated tags whose
  ref is outside of ``refs/tags/``
* in ``/tag``, try ``refs/tags/$h`` first, and if that doesn't work,
  try ``$h``, and show that only if it's an annotated tag (not just a
  reference)
* create another endpoint (``/atag``?) to show tag objects, and link
  to that one for annotated tags whose ref is outside of
  ``refs/tags/``

-- 
	Dakkar - <Mobilis in mobile>
	GPG public key fingerprint = A071 E618 DD2C 5901 9574
	                             6FE2 40EA 9883 7519 3F88
	                    key id = 0x75193F88


  reply	other threads:[~2021-01-05 11:53 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
2020-12-29 20:33       ` Gianni Ceccarelli
2021-01-05 11:53         ` Gianni Ceccarelli [this message]
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=20210105115303.2cc704f9@nautilus \
    --to=dakkar@thenautilus.net \
    --cc=cgit@lists.zx2c4.com \
    /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).