git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 6, 2011, 05:00 UTC
Message-ID
<7vvcub16e7.fsf@alter.siamese.dyndns.org>
In-Reply-To
<CAFfmPPMY5FP8NbZ5Q15pW-NC_qs=i6FY7v6Pi8jkMAhkURFTmQ@mail.gmail.com>
David Barr <davidbarr@google.com> writes:
Show 20 quoted lines
> 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.
Previous: David BarrNext: Jonathan Nieder
Message 7 of 10 in “git-am: ignore leading whitespace before patch”
  1. git-am: ignore leading whitespace before patchDavid Barr, Aug 2, 2011
  2. Tay Ray ChuanAug 3, 2011
  3. Sverre RabbelierAug 3, 2011
  4. Tay Ray ChuanAug 3, 2011
  5. Sverre RabbelierAug 3, 2011
  6. David BarrAug 6, 2011
  7. Junio C HamanoAug 6, 2011
  8. am: ignore leading whitespace before patchJonathan Nieder, Aug 8, 2011
  9. David BarrAug 8, 2011
  10. David BarrAug 8, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.