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

[PATCH/RFC] fetch: allow command line --tags to override config

From
Daniel Johnson <computerdruid@gmail.com>
Date
Aug 4, 2010, 18:56 UTC
Message-ID
<1280948202-17385-1-git-send-email-ComputerDruid@gmail.com>

Originally, if remote.<name>.tagopt was set, the --tags and option would have no effect when given to git fetch. So if tagopt="--no-tags"

	git fetch --tags
would not actually fetch tags.

This patch changes this behavior to only follow what is written in the config if there is no option passed by the command line.

Signed-off-by: Daniel Johnson <ComputerDruid@gmail.com>
---
 builtin/fetch.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/builtin/fetch.c b/builtin/fetch.c
index 1b67f5f..7a53144 100644
--- a/builtin/fetch.c
+++ b/builtin/fetch.c
@@ -675,10 +675,12 @@ static int do_fetch(struct transport *transport,
 
 	for_each_ref(add_existing, &existing_refs);
 
-	if (transport->remote->fetch_tags == 2 && tags != TAGS_UNSET)
-		tags = TAGS_SET;
-	if (transport->remote->fetch_tags == -1)
-		tags = TAGS_UNSET;
+	if (tags == TAGS_DEFAULT) {
+		if (transport->remote->fetch_tags == 2)
+			tags = TAGS_SET;
+		if (transport->remote->fetch_tags == -1)
+			tags = TAGS_UNSET;
+	}
 
 	if (!transport->get_refs_list || !transport->fetch)
 		die("Don't know how to fetch from %s", transport->url);
-- 
1.7.2
Next: Tay Ray Chuan
Message 1 of 12 in “fetch: allow command line --tags to override config”
  1. fetch: allow command line --tags to override configDaniel Johnson, Aug 4, 2010
  2. Tay Ray ChuanAug 5, 2010
  3. Documentation: changes in the behavior of tagoptDaniel Johnson, Aug 6, 2010
  4. Tay Ray ChuanAug 8, 2010
  5. [RFC/PATCHv2] fetch: allow command line --tags to override configDaniel Johnson, Aug 11, 2010
  6. Junio C HamanoAug 13, 2010
  7. t5525: test the tagopt variable and that it can be overriddenDaniel Johnson, Aug 13, 2010
  8. Ævar Arnfjörð BjarmasonAug 13, 2010
  9. [RFC/PATCHv2] t5525: test the tagopt variable and that it can be overriddenDaniel Johnson, Aug 13, 2010
  10. Ævar Arnfjörð BjarmasonAug 13, 2010
  11. Daniel JohnsonAug 14, 2010
  12. Ævar Arnfjörð BjarmasonAug 14, 2010

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.