Commit 5a1dbd48 authored by Duy Nguyen's avatar Duy Nguyen Committed by Junio C Hamano

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: Duy Nguyen's avatarNguyễn Thái Ngọc Duy <>
Signed-off-by: default avatarJunio C Hamano <>
parent aeb582a9
......@@ -1185,7 +1185,8 @@ static int parse_and_validate_options(int argc, const char *argv[],
if (all && argc > 0)
die(_("Paths with -a does not make sense."));
die(_("paths '%s ...' with -a does not make sense"),
if (status_format != STATUS_FORMAT_NONE)
dry_run = 1;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment