Skip to content

Commit 64336eb

Browse files
committed
Merge branch 'mm/die-with-dashdash-help'
When the user gives an argument that can be taken as both a revision name and a pathname without disambiguating with "--", we used to give a help message "Use '--' to separate". The message has been clarified to show where that '--' goes on the command line. * mm/die-with-dashdash-help: setup: clarify error messages for file/revisions ambiguity
2 parents 4692f32 + 4d4b573 commit 64336eb

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

setup.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ static void NORETURN die_verify_filename(const char *prefix,
7979
{
8080
if (!diagnose_misspelt_rev)
8181
die("%s: no such path in the working tree.\n"
82-
"Use '-- <path>...' to specify paths that do not exist locally.",
82+
"Use 'git <command> -- <path>...' to specify paths that do not exist locally.",
8383
arg);
8484
/*
8585
* Saying "'(icase)foo' does not exist in the index" when the
@@ -92,7 +92,8 @@ static void NORETURN die_verify_filename(const char *prefix,
9292

9393
/* ... or fall back the most general message. */
9494
die("ambiguous argument '%s': unknown revision or path not in the working tree.\n"
95-
"Use '--' to separate paths from revisions", arg);
95+
"Use '--' to separate paths from revisions, like this:\n"
96+
"'git <command> [<revision>...] -- [<file>...]'", arg);
9697

9798
}
9899

@@ -141,7 +142,8 @@ void verify_non_filename(const char *prefix, const char *arg)
141142
if (!check_filename(prefix, arg))
142143
return;
143144
die("ambiguous argument '%s': both revision and filename\n"
144-
"Use '--' to separate filenames from revisions", arg);
145+
"Use '--' to separate paths from revisions, like this:\n"
146+
"'git <command> [<revision>...] -- [<file>...]'", arg);
145147
}
146148

147149
/*

0 commit comments

Comments
 (0)