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

Re: [PATCH 2/9] apply --whitespace=fix: detect new blank lines at eof correctly

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 4, 2009, 16:26 UTC
Message-ID
<7vpra6n0b7.fsf@alter.siamese.dyndns.org>
In-Reply-To
<4AA101BB.7010206@viscovery.net>
Johannes Sixt <j.sixt@viscovery.net> writes:
> After reading this explanation, I was worried that added blank lines that
> are at the end of a patch but apply in the middle of a file would be
> mis-attributed as blank lines at EOF.

The codepath this patch is about checks "does the hunk result in more blank at the end of the place it applies to?". There is a separate logic that checks "does the hunk applies at the end of the file", which is the topic of the codepath that is fixed by Patch #1.

Previous: Johannes SixtNext: Junio C Hamano
Message 5 of 14 in “War on blank-at-eof”
  1. 0/9 War on blank-at-eofJunio C Hamano, Sep 4, 2009
  2. 1/9 apply --whitespace=fix: fix handling of blank lines at the eofJunio C Hamano, Sep 4, 2009
  3. 2/9 apply --whitespace=fix: detect new blank lines at eof correctlyJunio C Hamano, Sep 4, 2009
  4. Johannes SixtSep 4, 2009
  5. Junio C HamanoSep 4, 2009
  6. 3/9 apply.c: split check_whitespace() into twoJunio C Hamano, Sep 4, 2009
  7. 4/9 apply --whitespace=warn/error: diagnose blank at EOFJunio C Hamano, Sep 4, 2009
  8. 5/9 apply --whitespace: warn blank but not necessarily empty lines at EOFJunio C Hamano, Sep 4, 2009
  9. 6/9 diff.c: the builtin_diff() deals with only two-file comparisonJunio C Hamano, Sep 4, 2009
  10. 7/9 diff --whitespace=warn/error: obey blank-at-eofJunio C Hamano, Sep 4, 2009
  11. 8/9 diff --whitespace=warn/error: fix blank-at-eof checkJunio C Hamano, Sep 4, 2009
  12. 9/9 diff --color: color blank-at-eofJunio C Hamano, Sep 4, 2009
  13. Thell FowlerSep 5, 2009
  14. Junio C HamanoSep 6, 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.