{"thread":{"id":"11542","subject":"[PATCH 1/2] \"git-apply --check\" should not report \"fixed\"","startedAt":"2008-01-08T23:46:18Z","lastAt":"2008-01-08T23:46:18Z","messageCount":1,"participants":["Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"64796","messageId":"7vejcrrid1.fsf@gitster.siamese.dyndns.org","threadId":"11542","inReplyTo":null,"subject":"[PATCH 1/2] \"git-apply --check\" should not report \"fixed\"","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-01-08T23:46:18Z","receivedAt":"2008-01-08T23:46:18Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"When running \"git apply --check\" while --whitespace=fix is\nenabled (either from the command line or via the configuration),\nwe reported that \"N line(s) applied after _fixing_\", but --check\nby itself does not apply and this message was alarming.\n\nWe could even reword the message to say \"N line(s) would have\nbeen applied after fixing...\", but this patch does not go that\nfar.  Instead, we just make it use the \"N lines add whitespace\nerrors\" warning, which happens to be a good diagnostic message a\nuser would expect from the --check option.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n builtin-apply.c |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/builtin-apply.c b/builtin-apply.c\nindex 5e3b4a1..d57bb6e 100644\n--- a/builtin-apply.c\n+++ b/builtin-apply.c\n@@ -2907,7 +2907,7 @@ int cmd_apply(int argc, const char **argv, const char *unused_prefix)\n \t\t\t    whitespace_error,\n \t\t\t    whitespace_error == 1 ? \"\" : \"s\",\n \t\t\t    whitespace_error == 1 ? \"s\" : \"\");\n-\t\tif (applied_after_fixing_ws)\n+\t\tif (applied_after_fixing_ws && apply)\n \t\t\tfprintf(stderr, \"warning: %d line%s applied after\"\n \t\t\t\t\" fixing whitespace errors.\\n\",\n \t\t\t\tapplied_after_fixing_ws,\n"}]}