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

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

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 29, 2009, 07:09 UTC
Message-ID
<7vab2oynhm.fsf@alter.siamese.dyndns.org>
In-Reply-To
<cb7bb73a0907282333g26efd1d8y7d913fba8a426aa5@mail.gmail.com>
Giuseppe Bilotta <giuseppe.bilotta@gmail.com> writes:
Show 5 quoted lines
> Actually, one thing that I've been thinking about doing is to adjust
> the new lines to match the kind of whitespace change the context line
> underwent. Example: if all the context lines had the change 4 spaces
> -> tab, it would be nice to have the new lines undergo the same
> change. However, this is going to be rather hard to implement.
Doing so will be actively wrong.

In the case of "whitespace=fix", it is justifiable to update ws broken context lines while applying a ws corrected patch to a ws broken target, and it also is justifiable not to update context lines while applying a ws broken patch to a ws corrected target, because it is clear which one has the correct whitespace layout (i.e. output of ws_fix_copy() by definition is the correct outcome). But in your example, it is not clear if the layout using 4 spaces is correct or the one with a tab. The tool should refrain from guessing in such a case.

Previous: Giuseppe BilottaNext: Giuseppe Bilotta
Message 4 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.