Subject: [PATCH] When a remote is added but not fetched, tell the user.

From: Gabriel <[email-masked]>
Date: Fri, 11 Apr 2008 01:25:46 +0200

A helpful message tells the user when a remote was added
without being fetched, and how to fetch it.

Our default of not fetching is breaking the users' workflow
in the common "let me access this repo" use case.
This message alleviates the problem.

Signed-off-by: Gabriel <[email-masked]>
---
 builtin-remote.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/builtin-remote.c b/builtin-remote.c
index d77f10a..044215a 100644
--- a/builtin-remote.c
+++ b/builtin-remote.c
@@ -111,8 +111,16 @@ static int add(int argc, const char **argv)
 			return 1;
 	}
 
-	if (fetch && fetch_remote(name))
-		return 1;
+	if (fetch) {
+		if (fetch_remote(name))
+			return 1;
+	}
+	else {
+		printf ("Added remote repository `%s' without fetching it.\n"
+			"Before accessing the branches of this "
+			"remote, run `git fetch %s' "
+			"or `git remote update'.\n", name, name);
+	}
 
 	if (master) {
 		strbuf_reset(&buf);
-- 
1.5.5.24.geb27