commit: improve error message in "-a <paths>" case
commit5a1dbd48bcd1b917ce103e4f5bb68d3cfadf9543
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Wed, 20 Mar 2019 10:29:06 +0000 (20 17:29 +0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 22 Mar 2019 07:44:37 +0000 (22 16:44 +0900)
tree3afc4c17451445d2a0b3431791e741f5ee0b107f
parentaeb582a98374c094361cba1bd756dc6307432c42
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>
builtin/commit.c