Bug v1.9.3: Spurious whitespace warnings when using git apply with the --exclude option

2014-08-06 Thread Peyton Randolph
Bug v1.9.3: Spurious whitespace warnings when using git apply with the 
--exclude option

REPRO STEPS:
1. Create a patch PATCH that modifies two files, A and B. Make sure the 
modifications to file A add whitespace errors and the modifications to file B 
do not.
2. Apply that patch to a repo using git apply PATCH --exclude A

ACTUAL RESULT:
git apply outputs a warning: n lines add whitespace errors.” where n is the 
number of lines with whitespace errors in A. 

EXPECTED RESULT:
No warning about adding whitespace errors because no whitespace errors are 
added to the tree since A is excluded and B has no whitespace errors.--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Bug v1.9.3: Spurious whitespace warnings when using git apply with the --exclude option

2014-08-06 Thread Junio C Hamano
Peyton Randolph prando...@apple.com writes:

 Bug v1.9.3: Spurious whitespace warnings when using git apply with the 
 --exclude option
 ...
 EXPECTED RESULT:
 No warning about adding whitespace errors because no whitespace
 errors are added to the tree since A is excluded and B has no
 whitespace errors.

By reading the way the code is structured, I would expect (I didn't
check) that all versions of apply that supports whitespace error
detection with include/exclude option to share this symptom, and
this bug is not specific to 1.9.3.

In order to decide if a hunk with a new whitespace error should be
reported, the program needs to parse the patch input to at least
find out what path the part being parsed is to be applied, and the
whitespace error detection and reporting is done when the patch
input is parsed.  After the part that applies to one path is fully
parsed, it then checks to see if the path is included/excluded and
omits it from the --stat output and also actual application.

That part of the code needs to be restructured so that at least
error reporting (and preferrably error detection) is not done when
the path is known to be excluded.  Let me see if this can be easily
done.

Thanks.
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html