{"thread":{"id":"43673","subject":"Re: [PATCH 5/5] fetch-pack: Do not fetch tags for shallow clones.","startedAt":"2006-11-24T15:00:13Z","lastAt":"2006-11-25T19:01:34Z","messageCount":3,"participants":["Junio C Hamano","Alexandre Julliard","Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":5},"messages":[{"id":"298271","messageId":"87k61kubya.fsf@wine.dyndns.org","threadId":"43673","inReplyTo":null,"subject":"[PATCH 5/5] fetch-pack: Do not fetch tags for shallow clones.","fromName":"Alexandre Julliard","fromEmail":"julliard@winehq.org","sentAt":"2006-11-24T15:00:13Z","receivedAt":"2006-11-24T15:00:13Z","isPatch":true,"sender":{"key":"julliard@winehq.org","avatar":null},"body":"A better fix may be to only fetch tags that point to commits that we\nare downloading, but git-clone doesn't have support for following\ntags. This will happen automatically on the next git-fetch though.\n\nSigned-off-by: Alexandre Julliard <julliard@winehq.org>\n---\n fetch-pack.c |    3 ++-\n 1 files changed, 2 insertions(+), 1 deletions(-)\n\ndiff --git a/fetch-pack.c b/fetch-pack.c\nindex bb310b6..80979b8 100644\n--- a/fetch-pack.c\n+++ b/fetch-pack.c\n@@ -342,7 +342,8 @@ static void filter_refs(struct ref **ref\n \t\tif (!memcmp(ref->name, \"refs/\", 5) &&\n \t\t    check_ref_format(ref->name + 5))\n \t\t\t; /* trash */\n-\t\telse if (fetch_all) {\n+\t\telse if (fetch_all &&\n+\t\t\t (!depth || strncmp(ref->name, \"refs/tags/\", 10) )) {\n \t\t\t*newtail = ref;\n \t\t\tref->next = NULL;\n \t\t\tnewtail = &ref->next;\n-- \n1.4.4.1.ga335e\n\n-- \nAlexandre Julliard\n"},{"id":"296565","messageId":"7v3b88bncp.fsf@assigned-by-dhcp.cox.net","threadId":"43673","inReplyTo":"87k61kubya.fsf@wine.dyndns.org","subject":"Re: [PATCH 5/5] fetch-pack: Do not fetch tags for shallow clones.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-11-24T20:28:54Z","receivedAt":"2006-11-24T20:28:54Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Alexandre Julliard <julliard@winehq.org> writes:\n\n> A better fix may be to only fetch tags that point to commits that we\n> are downloading, but git-clone doesn't have support for following\n> tags. This will happen automatically on the next git-fetch though.\n>\n> Signed-off-by: Alexandre Julliard <julliard@winehq.org>\n\nAll five patches look sane.  Thanks.\n\nThe last one made me go \"Huh?\" at first, but it indeed is an\nimprovement.  It wouldn't make much sense to \"shallow clone\" by\ntwo commits near the tip of the 'master' branch from Linus's\nkernel, and then having to \"shallow clone\" all of his tags down\nto v2.6.12-rc2, each with two commit depths limit.\n\nI however think a better \"fix\" is not to use shallow \"clone\" but\nshallowly fetch branches you are interested in into an empty\nrepository for such a use scenario.  Just like making two-depth\nshallow copy of all the old tags do not help when the user is\ninterested in the recent history of the tip of the 'master'\nbranch, it does not help much to get near the tip of all other\nbranches with a uniform depth when one particular branch from a\nremote repository is of interest.  I can imagine that somebody\nwho fully follows the 'master' branch from git.git repository\nfrom time to time wants to take a peek at near the tip of 'pu'\n(perhaps because the 'shallow clone' topic is interesting) or\nwants to fetch near the tip of Jakub's gitweb work to see what\narea is still being improved, and shallowly fetching them into a\nrepository that has full history of my 'master' would be a\nuseful way to do so, provided if 'pu' and/or Jakub's tree have\ndeep enough histories since 'master' that the benefit of saved\nbandwidth and disk usage outweighs the complexity of \"shallow\".\n\nI haven't tried these usage scenarios myself.  I wonder if a\nshallow \"clone\" with non-uniform depths from possible more than\none repository work sensibly?\n"},{"id":"298604","messageId":"Pine.LNX.4.63.0611251958110.30004@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"43673","inReplyTo":"87k61kubya.fsf@wine.dyndns.org","subject":"Re: [PATCH 5/5] fetch-pack: Do not fetch tags for shallow clones.","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-11-25T19:01:34Z","receivedAt":"2006-11-25T19:01:34Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nthe other 4 patches look good to me (fixing a few typos/thinkos). However, \nI think there must be a way to fetch tags for clones, when it is possible \nfor fetches. Especially since fetch gets closer to including the features \nneeded for \"clone\" (regexes for remote names, storing packs, ...)\n\nCiao,\nDscho\n\nP.S.: I just realized that send-pack and receive-pack are not at all aware \nof shallow repos. Maybe both should check for a shallow repo, and die() on \nit?\n\n"}]}