On Mon, May 25, 2015 at 04:27:40PM -0700, Junio C Hamano wrote:
> "brian m. carlson" <sand...@crustytoothpaste.net> writes:
> > My use case is determining whether a patch to a pristine-tar
> > repository introduced trailing whitespace (which is not okay) or
> > just left it there (which is okay).
> 
> In your use case, where keeping trailing blank that is otherwise not
> OK is fine only when the breakage was inherited from the preimage,
> wouldn't it be equally fine to keep other kinds of breakages as long
> as they were inherited from the preimage?  E.g. "The original used
> 8-space as leading indent, and you would not use that for your new
> lines, but the breakage was inherited from the preimage" would want
> to be treated the same way, no?  Why trailing blanks so special?

The goal is to keep the code as similar as possible to the old code,
since this is third-party code.  If you're changing the whitespace
significantly, your changes are too invasive.  If you're inserting
lines, you shouldn't be adding trailing whitespace, but keeping
upstream's bizarre indent would be acceptable.

Trailing blanks aren't necessarily special, but they are the most common
and the easiest to fix (or not introduce) on a piecemeal basis.

I agree that a more generic solution would be better.

> If the implementation were addition of a new option to check and
> mark all kinds of errors core.whitespace would catch for new lines
> also for old lines, then it would be a somewhat different story.  I
> personally do not find such an option interesting, but at least I
> can understand why some people might find it useful.

The vast majority of the whitespace errors I see are blank-at-eol, so I
felt this change was, if anything, a good first step.  Having read your
response, I agree the generic solution is preferable.

> [Footnote]
> 
> *1* To support your use case with the ultimate ease-of-use, it would
> be best if the new option were to squelch the whitespace error on
> the new line when it was inherited from the old line, which is
> different from showing and marking the breakage on the old line.
> But I do not think it can be implemented sanely, so I will not go
> there.

I'd rather see that there's an error on both so that I have the
knowledge when reviewing a patch.
-- 
brian m. carlson / brian with sandals: Houston, Texas, US
+1 832 623 2791 | http://www.crustytoothpaste.net/~bmc | My opinion only
OpenPGP: RSA v4 4096b: 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187

Attachment: signature.asc
Description: Digital signature

Reply via email to