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

Re: Retrieve version-string on shallow clone

From
RWReino Wijnsma <rwijnsma@xs4all.nl>
Date
Sep 3, 2019, 21:30 UTC
Message-ID
<078d6283-726a-c7a9-5c24-97dbc7ff180f@xs4all.nl>
In-Reply-To
<20190902140854.GA3806@instance-1.europe-west6-a.c.vaulted-journal-250706.internal>
Hello Giuseppe, Philip and Jeff,
On 2019-09-02T16:08:54+0200, Giuseppe Crinò <giuscri@gmail.com> wrote:
> To my understanding both questions are solved by
> * https://stackoverflow.com/a/47720414/2219670
> * https://stackoverflow.com/a/12704727/2219670
On 2019-09-02T17:52:19+0200, Philip Oakley <philipoakley@iee.email> wrote:
> 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).
On 2019-09-02T17:54:40+0200, Jeff King <peff@peff.net> wrote:
> But what you want is perfectly reasonable; there's just not a good way to do it yet.
> [...] There's no way to trigger this within Git's protocols.
I never thought this would be impossible, or at least very hard, to accomplish.

git ls-remote --tags --refs https://github.com/mstorsjo/fdk-aac.git 94f9d5ca2077262e838fbc8ed111da03be5389d5 refs/tags/v0.1.0 1551d17717e42e7c295da0a682ae299791ee87c7 refs/tags/v0.1.1 fa3b711888883ccb19337c0ca76aea7dd85af9c8 refs/tags/v0.1.2 db7189736b49d27225eea917fcf1581b5228c830 refs/tags/v0.1.3 d17a2ebc6d8f593ffbefacaea1bfa6d6a81356a1 refs/tags/v0.1.4 a3f40d8d974f1aacde95e0996739941bde8f5e98 refs/tags/v0.1.5 c98ba983b0cd6905a52ab34222418ca7a5ff2260 refs/tags/v0.1.6 e35d91ddd8d41515594b7fd51b6bae1b17fee530 refs/tags/v2.0.0

git ls-remote --tags --refs https://github.com/mstorsjo/fdk-aac.git | tail -n1 | cut -d/ -f3- v2.0.0

Regrettably the remote repo doesn't include the entire version-string with revision and commit-hash (v2.0.0-185-gcc5c85d).

Having to download fdk-aac's complete commit-history (9.38MB) isn't yet all too bad. FFmpeg (https://github.com/FFmpeg/FFmpeg.git) its commit-history on the other hand is a whopping 239MB (as opposed to 15.7MB for --depth 1) and perhaps a better example here! I'm compiling and distributing FFmpeg executables. When I compile FFmpeg I'm not interested in its entire commit-history at that moment. I'm only interested in the checked out source files and the version-string (4.3-dev-327-g83e0b71 for instance).

Since this doesn't appear to be possible at the moment, I'll let this rest. Thank you all for your replies.

-- Reino
Previous: Giuseppe Crinò
Message 2 of 2 in “Re: Retrieve version-string on shallow clone”
  1. Giuseppe CrinòSep 2, 2019
  2. Reino WijnsmaSep 3, 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.