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

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

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Jun 10, 2010, 17:03 UTC
Message-ID
<AANLkTikgWsumvqwicvOW8keGgvrgak8D6HXCGQ3wqHG6@mail.gmail.com>
In-Reply-To
<7vd3vyn84j.fsf@alter.siamese.dyndns.org>
On Thu, Jun 10, 2010 at 16:51, Junio C Hamano <gitster@pobox.com> wrote:
Show 19 quoted lines
> Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:
>
>> Change git-am to ignore whitespace (as defined by sh's read) at the
>> beginning of patches.
>>
>> Empty lines are wont to creep in at the beginning of patches, here's
>> an example from a raw Gmail attachment:
>>
>>     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|
>>
>> Whitespace is also likely to appear if the user copy/pastes the patch
>> around, e.g. via a pastebin, or any any number of other cases. This
>> harms nothing and makes git-am's detection more fault tolerant.
>
> Actually cut-and-paste is often a major source of whitespace breakage
> (including tabs silently being expanded), and I personally think a patch
> like this to encourage the practice is going in a wrong direction.

It doesn't encourage that copy/paste. It's just tangentally mentioned in the commit message since it's a plausable use case.

What it does is enable the GMail -> download -> git-am workflow. GMail (and doubtless countless other) E-Mail providers introduce whitespace at the beginning of raw E-Mail messages, while otherwise leaving them intact.

Previous: Junio C HamanoNext: Ævar Arnfjörð Bjarmason
Message 4 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.