Re: [PATCH] git-am: ignore leading whitespace before patch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



David Barr <davidbarr@xxxxxxxxxx> writes:

> Hi Jonathan,
> ...
>>> 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
> ...
> 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.

It no longer checks "the first few lines" but can read a lot more, so the
comment that precedes this block is now invalid.

Also we are rather old fashioned and we never say "until [ ... ]" anywhere
in our shell scripts.

	$ git grep -e until -- '*.sh'

Personally to me this is a borderline "Meh", in the sense that I wouldn't
bother to waste too much effort rejecting it, as I do not see downsides
other than these minor points.

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


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]