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
This commit is contained in:
commit
64336ebe34
8
setup.c
8
setup.c
@ -79,7 +79,7 @@ static void NORETURN die_verify_filename(const char *prefix,
|
|||||||
{
|
{
|
||||||
if (!diagnose_misspelt_rev)
|
if (!diagnose_misspelt_rev)
|
||||||
die("%s: no such path in the working tree.\n"
|
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);
|
arg);
|
||||||
/*
|
/*
|
||||||
* Saying "'(icase)foo' does not exist in the index" when the
|
* Saying "'(icase)foo' does not exist in the index" when the
|
||||||
@ -92,7 +92,8 @@ static void NORETURN die_verify_filename(const char *prefix,
|
|||||||
|
|
||||||
/* ... or fall back the most general message. */
|
/* ... or fall back the most general message. */
|
||||||
die("ambiguous argument '%s': unknown revision or path not in the working tree.\n"
|
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);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -141,7 +142,8 @@ void verify_non_filename(const char *prefix, const char *arg)
|
|||||||
if (!check_filename(prefix, arg))
|
if (!check_filename(prefix, arg))
|
||||||
return;
|
return;
|
||||||
die("ambiguous argument '%s': both revision and filename\n"
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user