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

Re: [PATCH v2] git-am: Ignore whitespace before patches

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Aug 11, 2010, 22:55 UTC
Message-ID
<AANLkTind7ZtTS+Fi-tOSE7ExgD1ubhpLuxYJgWYms2aE@mail.gmail.com>
In-Reply-To
<AANLkTin2DM-q7acST-x_Oz7jU-hODy8se6sngGxTDi_9@mail.gmail.com>
On Wed, Aug 11, 2010 at 22:50, Jon Seymour <jon.seymour@gmail.com> wrote:
Show 21 quoted lines
> On Thu, Aug 12, 2010 at 5:57 AM, Ævar Arnfjörð Bjarmason
> <avarab@gmail.com> wrote:
>> Change git-am to ignore whitespace (as defined by sh's read) at the
>> beginning of patches.
>>
>> This makes git-am work with patches downloaded from the GMail web
>> interface, here's an example from a raw Gmail attachment produced with
>> `hexdump -C':
>>
>>    20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
>>    20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 0a  |               .|
>>    52 65 74 75 72 6e 2d 50  61 74 68 3a 20 3c 61 76  |Return-Path: <av|
>>
>> Having to tell GMail users that they must manually edit their patches
>> before git-am will accept them (as this article does:
>> http://evag.evn.am/git/git-and-gmail) isn't optimal.
>
> This is a good point. Current behaviour discourages testing of patches
> as delivered by e-mail since the GMail user is more likely to overlook
> actual whitespace errors in a patch because they come to expect this
> usual failure.

Just to clarify, git-am doesn't print a whitespace error on GMail patches currently, the detection just fails:

    $ git am ~/Desktop/mail.txt
    Patch format detection failed.
But with my patch:
    $ git am ~/Desktop/mail.txt
    Applying: git-am: Ignore whitespace before patches
Previous: Jon SeymourNext: Jay Soffian
Message 7 of 11 in “git-am: Ignore whitespace before patches”
  1. git-am: Ignore whitespace before patchesÆvar Arnfjörð Bjarmason, May 15, 2010
  2. Ævar Arnfjörð BjarmasonJun 9, 2010
  3. Junio C HamanoJun 10, 2010
  4. Ævar Arnfjörð BjarmasonJun 10, 2010
  5. git-am: Ignore whitespace before patchesÆvar Arnfjörð Bjarmason, Aug 11, 2010
  6. Jon SeymourAug 11, 2010
  7. Ævar Arnfjörð BjarmasonAug 11, 2010
  8. Jay SoffianAug 12, 2010
  9. Ævar Arnfjörð BjarmasonAug 12, 2010
  10. Jonathan NiederAug 12, 2010
  11. Junio C HamanoAug 12, 2010

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.