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

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

From
Matthieu Moy <matthieu.moy@imag.fr>
Date
Jul 26, 2010, 16:32 UTC
Message-ID
<1280161929-18620-1-git-send-email-Matthieu.Moy@imag.fr>

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(-)
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
Next: Junio C Hamano
Message 1 of 2 in “Clarify help message when no remote is specified in fetch/pull.”
  1. Clarify help message when no remote is specified in fetch/pull.Matthieu Moy, Jul 26, 2010
  2. Junio C HamanoJul 27, 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.