git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Retrieve version-string on shallow clone

From
Philip Oakley <philipoakley@iee.email>
Date
Sep 2, 2019, 15:52 UTC
Message-ID
<26794b96-8627-0d73-c548-91b0ea7fde83@iee.email>
In-Reply-To
<26d7f32e-2df5-ce39-cd20-8cd82dc8587c@xs4all.nl>
Hi Reino
On 01/09/2019 12:07, Reino Wijnsma wrote:
Show 21 quoted lines
> Hello git@vger.kernel.org,
>
> Two days ago I started https://github.com/mstorsjo/fdk-aac/issues/107, asking how to retrieve the fdk-aac version-string on a shallow clone.
> My question was of course not fdk-aac related, so Martin Storsjö suggested I'd try here. It basicly comes down to this:
>
> git clone https://github.com/mstorsjo/fdk-aac.git
> [...]
>
> git describe --tags
> v2.0.0-185-gcc5c85d
>
> git clone --depth 1 https://github.com/mstorsjo/fdk-aac.git
>
> git describe --tags
> fatal: No names found, cannot describe anything.
>
> The tags get lost while doing a shallow clone.
> I'm not an expert git user, so I was wondering if anyone could tell what my options are here.
> I'd figure one of these options would be to clone everything from tag v2.0.0 onward, but if so how would I do that?
> As another option I was thinking; maybe it's possible to do git describe --tags on the remote repo?
>
This is most likely a mental model problem.

If you only have a depth = 1 level clone, then there is no history available locally to use from which to describe almost anything. Even if you had all the tags (without the actual commits they tagged) you still don't have that history upon which to describe them.

Start by getting a bit more history depth, then see if you need to fetch some of the tags (or at least any specific tags of interest).

Philip
Previous: Reino WijnsmaNext: Jeff King
Message 2 of 3 in “Retrieve version-string on shallow clone”
  1. Reino WijnsmaSep 1, 2019
  2. Philip OakleySep 2, 2019
  3. Jeff KingSep 2, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.