"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

Stefan Sperling <stsp@stsp.name>
Re: got ref -l tags?
Christian Weisgerber <naddy@mips.inka.de>
Mon, 18 Mar 2024 21:06:35 +0100

Download raw body.

On Mon, Mar 18, 2024 at 08:23:27PM +0100, Christian Weisgerber wrote:
> I can briefly list the tags in a repository with
> $ got ref -l refs/tags
> Can I drop the "refs/"?  What is supposed to happen for
> $ got ref -l tags
> ?
> "If name is a reference namespace, list all references in this
> namespace."  *scratches head*  So the two command above are equivalent?
> Because in the FreeBSD src.git, they are not:
> $ got ref -l refs/tags | wc -l
>     3446
> $ got ref -l tags | wc -l
>       27
> Is that a bug or do I misunderstand the intended behavior?

My reading of got/got.c and lib/reference.c suggests that got ref -l tags
will try to read references within the on-disk directory .git/tags/.

Does the directory .git/tags/ exist?

The "refs/" prefix is just a convention; refs can exist anywhere in
the repository as plaintext files that contain an object ID, just like
the HEAD reference for example.

The index at https://cgit.freebsd.org/src/refs/ only lists branches,
no tags at all. 

The copy of freebsd-src on github has a much smaller collection of tags:

$ got clone -l git@github.com:freebsd/freebsd-src | grep tags | wc -l 

Can you show the full output of got ref -l and also the output of
'ls tags' in your repo?