From: Junio C Hamano Date: Mon, 05 Dec 2011 19:27:18 GMT Subject: Re: [PATCH 2/2] builtin/apply.c: report error on failure to recognize input Message-ID: <7vzkf6lsyx.fsf@alter.siamese.dyndns.org> In-Reply-To: <1322944550-27344-2-git-send-email-drafnel@gmail.com> Brandon Casey writes: > When git apply is passed something that is not a patch, it does not produce > an error message or exit with a non-zero status if it was not actually > "applying" the patch i.e. --check or --numstat etc were supplied on the > command line. > > Fix this by producing an error when apply fails to find any hunks whatsoever > while parsing the patch. > > This will cause some of the output formats (--numstat, --diffstat, etc) to > produce an error when they formerly would have reported zero changes and > exited successfully. That seems like the correct behavior though. Failure > to recognize the input as a patch should be an error. > > Plus, add a test. > > Reported-by: Artem Bityutskiy > Signed-off-by: Brandon Casey > --- > > Initially, I was reluctant to change the error message, thinking that > error messages for plumbing commands were not supposed to change. But I > think I was wrong in that thought, so I changed the error message so it > was a more descriptive "unrecognized input". I am still reluctant to see $ git apply