git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH/RFC] fetch: allow command line --tags to override config
@ 2010-08-04 18:56 Daniel Johnson
  2010-08-05  9:56 ` Tay Ray Chuan
  0 siblings, 1 reply; 12+ messages in thread
From: Daniel Johnson @ 2010-08-04 18:56 UTC (permalink / raw)
  To: git; +Cc: Daniel Johnson, Kristian Høgsberg

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

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2010-08-14 21:37 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-04 18:56 [PATCH/RFC] fetch: allow command line --tags to override config Daniel Johnson
2010-08-05  9:56 ` Tay Ray Chuan
2010-08-06 13:54   ` [PATCH] Documentation: changes in the behavior of tagopt Daniel Johnson
2010-08-08  2:17     ` Tay Ray Chuan
2010-08-11 22:57       ` [RFC/PATCHv2] fetch: allow command line --tags to override config Daniel Johnson
2010-08-13  1:22         ` Junio C Hamano
2010-08-13 20:13           ` [RFC/PATCH] t5525: test the tagopt variable and that it can be overridden Daniel Johnson
2010-08-13 20:55             ` Ævar Arnfjörð Bjarmason
2010-08-13 21:27               ` [RFC/PATCHv2] " Daniel Johnson
2010-08-13 21:39                 ` Ævar Arnfjörð Bjarmason
2010-08-14 21:32                   ` Daniel Johnson
2010-08-14 21:37                     ` Ævar Arnfjörð Bjarmason

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).