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>

Nguyễn Thái Ngọc Duy committed Mar 20, 2019 at 17:29 UTC 5a1dbd48bcd1b917ce103e4f5bb68d3cfadf9543
1 file changed +2 -1
builtin/commit.c
+2 -1
@@ -1185,7 +1185,8 @@ static int parse_and_validate_options(int argc, const char *argv[],
1185 handle_untracked_files_arg(s);
1186
1187 if (all && argc > 0)
1188 - die(_("Paths with -a does not make sense."));
1188 + die(_("paths '%s ...' with -a does not make sense"),
1189 + argv[0]);
1190
1191 if (status_format != STATUS_FORMAT_NONE)
1192 dry_run = 1;