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

[PATCH 5/5] fetch-pack: Do not fetch tags for shallow clones.

From
AJAlexandre Julliard <julliard@winehq.org>
Date
Nov 24, 2006, 15:00 UTC
Message-ID
<87k61kubya.fsf@wine.dyndns.org>

A better fix may be to only fetch tags that point to commits that we are downloading, but git-clone doesn't have support for following tags. This will happen automatically on the next git-fetch though.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
---
 fetch-pack.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/fetch-pack.c b/fetch-pack.c
index bb310b6..80979b8 100644
--- a/fetch-pack.c
+++ b/fetch-pack.c
@@ -342,7 +342,8 @@ static void filter_refs(struct ref **ref
 		if (!memcmp(ref->name, "refs/", 5) &&
 		    check_ref_format(ref->name + 5))
 			; /* trash */
-		else if (fetch_all) {
+		else if (fetch_all &&
+			 (!depth || strncmp(ref->name, "refs/tags/", 10) )) {
 			*newtail = ref;
 			ref->next = NULL;
 			newtail = &ref->next;
-- 
1.4.4.1.ga335e

-- 
Alexandre Julliard
Next: Junio C Hamano
Message 1 of 3 in “fetch-pack: Do not fetch tags for shallow clones.”
  1. 5/5 fetch-pack: Do not fetch tags for shallow clones.Alexandre Julliard, Nov 24, 2006
  2. Junio C HamanoNov 24, 2006
  3. Johannes SchindelinNov 25, 2006

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.