Re: [PATCH] git-am: ignore leading whitespace before patch
- From
David Barr <davidbarr@google.com>
- Date
- Aug 6, 2011, 01:56 UTC
- Message-ID
- <CAFfmPPMY5FP8NbZ5Q15pW-NC_qs=i6FY7v6Pi8jkMAhkURFTmQ@mail.gmail.com>
- In-Reply-To
- <CALUzUxpn-vCWpTQyB7z9dsu8a+UBL9MPjEycOfTmyws5ndz5kA@mail.gmail.com>
Hi Jonathan,
Show 7 quoted lines
> On Wed, Aug 3, 2011 at 6:20 AM, David Barr <davidbarr@google.com> wrote: >> Some web-based email clients prepend whitespace to raw message >> transcripts to workaround content-sniffing in some browsers. >> Adjust the patch format detection logic to ignore leading >> whitespace. >> >> Signed-off-by: David Barr <davidbarr@google.com>
Show 17 quoted lines
>> diff --git a/git-am.sh b/git-am.sh
>> index 463c741..19b2f0f 100755
>> --- a/git-am.sh
>> +++ b/git-am.sh
>> @@ -199,7 +199,11 @@ check_patch_format () {
>> # otherwise, check the first few lines of the first patch to try
>> # to detect its format
>> {
>> - read l1
>> + # Start from first line containing non-whitespace
>> + until [ -n "$l1" ]
>> + do
>> + read l1
>> + done
>> read l2
>> read l3
>> case "$l1" inOn Wed, Aug 3, 2011 at 10:28 PM, Tay Ray Chuan <rctay89@gmail.com> wrote:
> Finally, patches from GMail that play nice with git-am! > > Acked-by: Tay Ray Chuan <rctay89@gmail.com>
Do you see any subtle issues in this tiny patch? I failed to include a test, I'll add at least one to the next version. I did check that it doesn't break any of the existing git-am tests.
-- David Barr