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

Re: [PATCH] git-revover-tags-script

From
Junio C Hamano <junkio@cox.net>
Date
Jul 17, 2005, 18:53 UTC
Message-ID
<7voe91jmc6.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<m1psthomf0.fsf@ebiederm.dsl.xmission.com>
ebiederm@xmission.com (Eric W. Biederman) writes:
Show 8 quoted lines
> What we care about are the tag objects, those are the only kind
> that are verifiable and usable remotely.  
>
> Now that I know we do not pull tags currently with any of the
> optimized transports, I would suggest taking the list of commit
> objects we are transporting and for each commit look in the
> remote repo/refs/tags and transferring every tag object we can find
> that refers to that commit.

I do not think it is particularly a good idea to fetch a tag that refers to a commit when the user asks only for that commit (e.g. the user said "the head of this remote branch I am tracking", and the head happened to have been tagged). Yes, it may be convenient, but retrieving the commit chain and retrieving tags are conceptually separate issues. A tag does not necessarily refer to a commit, so your reverse index does not make sense for a tag pointing at a blob, for example.

I think if we have discovery mechanism of remote tags/heads, we do not need anything else. You _could_ say something like:

    $ git-list-remote --tags linux-2.6
    9e734775f7c22d2f89943ad6c745571f1930105f	v2.6.12-rc2
    26791a8bcf0e6d33f43aef7682bdb555236d56de	v2.6.12
    ...
    a339981ec18d304f9efeb9ccf01b1f04302edf32	v2.6.13-rc3
    $ git-list-remote --tags linux-2.6 |
      while read sha1 tag;
      do
          git fetch linux-2.6 tag $tag
      done

and you are done. We did not use the reverse index, nor we used the --all-tags flag to git-fetch-script. You do not even need git-list-remote if you are willing to wget a=summary output from gitweb and parse the bottom of the page ;-).

The above may not exactly work for linux-2.6 repository because I think the "tag" form of git-fetch-script may expect to find a tag that resolves to a commit object and there is the oddball v2.6.11-tree tag, but you got the general idea.

Previous: Eric W. BiedermanNext: Eric W. Biederman
Message 4 of 12 in “git-revover-tags-script”
  1. git-revover-tags-scriptEric W. Biederman, Jul 16, 2005
  2. Junio C HamanoJul 17, 2005
  3. Eric W. BiedermanJul 17, 2005
  4. Junio C HamanoJul 17, 2005
  5. Eric W. BiedermanJul 18, 2005
  6. Junio C HamanoJul 18, 2005
  7. Eric W. BiedermanJul 18, 2005
  8. Junio C HamanoJul 18, 2005
  9. Eric W. BiedermanJul 18, 2005
  10. [RFD] server-info to help clientsJunio C Hamano, Jul 20, 2005
  11. David LangJul 20, 2005
  12. Junio C HamanoJul 20, 2005

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.