Re: [RFC] refer to post-patch lines in whitespace warnings
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 9, 2008, 20:22 UTC
- Message-ID
- <7vy7ayhhpj.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <alpine.LNX.1.00.0801091046100.13593@iabervon.org>
Daniel Barkalow <barkalow@iabervon.org> writes:
Show 10 quoted lines
> When I rebase series with bad whitespace, I end up with unhelpful messages > like: > > .dotest/patch:412: trailing whitespace. > -- > .dotest/patch:446: trailing whitespace. > -- > > These line numbers obviously refer to lines in a file that's been removed > by the time I can do anything about it.
The message is more appropriate for a workflow to "git apply --check" first, fix the patchfile and then applying for real.
Show 5 quoted lines
> ... if, in the case where it leaves the working tree > modified with the non-compliant whitespace, it gave this location rather > than the patch's location (because, even if you have the patch still, > you'd need to revert it first in order to be able to apply a fixed version > anyway).
In such a case, "git diff" will highlight the non-compliant whitespace.
More problematic is if you used whitespace=warn to let it commit anyway. You can use "git diff $beginning_of_series..HEAD" the same way to locate the breakages, but you then need to do "rebase -i" to fix it up (I personally would run "format-patch", fix the problems in the patch text, and run "am", instead of "rebase -i", mostly because I am used to working that way).