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

Re: [PATCHv3] git apply: option to ignore whitespace differences

From
Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Date
Jul 29, 2009, 09:05 UTC
Message-ID
<cb7bb73a0907290205t6402c5dbob3d4a1663ec39135@mail.gmail.com>
In-Reply-To
<7vws5rx4qt.fsf@alter.siamese.dyndns.org>
On Wed, Jul 29, 2009 at 10:39 AM, Junio C Hamano<gitster@pobox.com> wrote:
Show 10 quoted lines
> Giuseppe Bilotta <giuseppe.bilotta@gmail.com> writes:
>
>> I was thinking more about consistency than 'correctness'  in this
>> case, actually. Typical scenario would be: patch is created for a file
>> using a given whitespace convention (e.g. 4 spaces). File is updated
>> to match the rest of the project (tabs). Patch would now introduce the
>> wrong whitespace convention for the new lines.
>
> You are assuming that the patch is always based on a wrong convention and
> the target always uses the right convention.
No, I'm just assuming that the lines should have consistent whitespace
> In general, however, you
> cannot tell which way the "consisitency" should go --- often you have to
> apply a patch based on a fixed codebase to an older version.

Consistency should go the way of the context lines. So if the convention changed and you're backporting changes, the changes would use the old convention on the old codebase, and the new convention on the new codebase, because that's what the context lines would direct the new lines to.

Of course, this is all very abstract reasoning because I don't even think the feature can be implemented at all robustly (too much 'AI' work, IMO).

-- 
Giuseppe "Oblomov" Bilotta
Previous: Junio C HamanoNext: Nanako Shiraishi
Message 7 of 15 in “[PATCHv3] git apply: option to ignore whitespace differences”
  1. Giuseppe BilottaJul 28, 2009
  2. Junio C HamanoJul 28, 2009
  3. Giuseppe BilottaJul 29, 2009
  4. Junio C HamanoJul 29, 2009
  5. Giuseppe BilottaJul 29, 2009
  6. Junio C HamanoJul 29, 2009
  7. Giuseppe BilottaJul 29, 2009
  8. Nanako ShiraishiJul 29, 2009
  9. Giuseppe BilottaJul 29, 2009
  10. Felipe ContrerasJul 31, 2009
  11. Junio C HamanoJul 31, 2009
  12. Felipe ContrerasJul 31, 2009
  13. Giuseppe BilottaJul 31, 2009
  14. Junio C HamanoJul 31, 2009
  15. Giuseppe BilottaJul 31, 2009

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.