threads / patch / 24529

patchClarify help message when no remote is specified in fetch/pull.

Subject: [PATCH] Clarify help message when no remote is specified in fetch/pull.

## tl;dr

2 messages between Jul 26, 2010 and Jul 27, 2010. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

Matthieu Moy· Jul 26, 2010, 16:32 UTC · lore

The message is especially confusing when "git fetch" is ran from "git pull", for users not aware of "git fetch". The new message makes it clear that "fetch" means "fetch new revisions", and gives hint on the solution.

We don't add a advice.* configuration option since this message doesn't appear in normal use, and shouldn't disturb advanced users.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
---
I already gave this a try a long time ago:
  http://thread.gmane.org/gmane.comp.version-control.git/143229/focus=143404
This version should fix the drawbacks mentionned by Junio.
 builtin/fetch.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
Show changes to builtin/fetch.c +2 −1
diff --git a/builtin/fetch.c b/builtin/fetch.c
index 6eb1dfe..1b67f5f 100644
--- a/builtin/fetch.c
+++ b/builtin/fetch.c
@@ -845,7 +845,8 @@ static int fetch_one(struct remote *remote, int argc, const char **argv)
 	int exit_code;
 
 	if (!remote)
-		die("Where do you want to fetch from today?");
+		die("No remote repository specified.  Please, specify either a URL or a\n"
+		    "remote name from which new revisions should be fetched.");
 
 	transport = transport_get(remote, NULL);
 	transport_set_verbosity(transport, verbosity, progress);
-- 
1.7.2.19.g9a302.dirty

← back to recent threads