Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2019-03-20 13:29:06 +0300
committerJunio C Hamano <gitster@pobox.com>2019-03-22 10:44:37 +0300
commit5a1dbd48bcd1b917ce103e4f5bb68d3cfadf9543 (patch)
tree3afc4c17451445d2a0b3431791e741f5ee0b107f /builtin
parentaeb582a98374c094361cba1bd756dc6307432c42 (diff)
commit: improve error message in "-a <paths>" case
I did something stupid today and got $ git commit -a --fixup= @^ fatal: Paths with -a does not make sense. which didn't make any sense (at least for the first few seconds). Include the first path(spec) in the error message to help spot the problem quicker. Now it shows fatal: paths '@^ ...' with -a does not make sense which should ring some bell because @^ should clearly not be considered a path. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r--builtin/commit.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/builtin/commit.c b/builtin/commit.c
index 2986553d5f..48ddccaa37 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -1185,7 +1185,8 @@ static int parse_and_validate_options(int argc, const char *argv[],
handle_untracked_files_arg(s);
if (all && argc > 0)
- die(_("Paths with -a does not make sense."));
+ die(_("paths '%s ...' with -a does not make sense"),
+ argv[0]);
if (status_format != STATUS_FORMAT_NONE)
dry_run = 1;