summaryrefslogtreecommitdiff
path: root/setup.c
diff options
context:
space:
mode:
authorMatthieu Moy <Matthieu.Moy@imag.fr>2012-08-03 10:21:20 +0200
committerJunio C Hamano <gitster@pobox.com>2012-08-03 09:06:30 -0700
commit4d4b573977833f887635be386b84681e73834b72 (patch)
treec78a9ff689dfd8421fffa1faefb8f6148d2c4d70 /setup.c
parent0e4c8822e98e27c3c63125570c8bcbf0a8fd34da (diff)
downloadgit-4d4b573977833f887635be386b84681e73834b72.tar.gz
setup: clarify error messages for file/revisions ambiguity
The previous "Use '--' to separate filenames from revisions" may sound obvious for an old-time Unix user, but does not make it clear how to use this '--'. In addition to mentionning this '--', give an idea of what the new command should look like. Ideally, we could provide cut-and-paste ready commands based on the command that just failed, but we have no easy access to argv[] in this place of the code. Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'setup.c')
-rw-r--r--setup.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/setup.c b/setup.c
index e11497720e..7663a4cbb2 100644
--- a/setup.c
+++ b/setup.c
@@ -82,7 +82,7 @@ static void NORETURN die_verify_filename(const char *prefix,
if (!diagnose_misspelt_rev)
die("%s: no such path in the working tree.\n"
- "Use '-- <path>...' to specify paths that do not exist locally.",
+ "Use 'git <command> -- <path>...' to specify paths that do not exist locally.",
arg);
/*
* Saying "'(icase)foo' does not exist in the index" when the
@@ -96,7 +96,8 @@ static void NORETURN die_verify_filename(const char *prefix,
/* ... or fall back the most general message. */
die("ambiguous argument '%s': unknown revision or path not in the working tree.\n"
- "Use '--' to separate paths from revisions", arg);
+ "Use '--' to separate paths from revisions, like this:\n"
+ "'git <command> [<revision>...] -- [<file>...]'", arg);
}
@@ -145,7 +146,8 @@ void verify_non_filename(const char *prefix, const char *arg)
if (!check_filename(prefix, arg))
return;
die("ambiguous argument '%s': both revision and filename\n"
- "Use '--' to separate filenames from revisions", arg);
+ "Use '--' to separate paths from revisions, like this:\n"
+ "'git <command> [<revision>...] -- [<file>...]'", arg);
}
/*