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

Re: [PATCH 1/4] diff/xdiff: refactor EOF-EOL detection

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
Jun 4, 2010, 07:38 UTC
Message-ID
<4C08AD75.6040307@drmicha.warpmail.net>
In-Reply-To
<7vsk537p8k.fsf@alter.siamese.dyndns.org>
Junio C Hamano venit, vidit, dixit 03.06.2010 23:58:
Show 10 quoted lines
> Michael J Gruber <git@drmicha.warpmail.net> writes:
> 
>> This puts the "No newline at end of file" warning for both code paths
> 
> This is not a warning.
> 
> It is an integral part of the diff output specification that allows patch
> recipients to correctly reproduce incomplete lines.  Removing this from
> the output is simply out of question.
> 

I'm sorry, but that makes 3 out of 3 respondents who didn't seem to read what I wrote.

This series is about the display of that line for human-consumable output such as log -p etc.

Patch 1/4 doesn't remove anything. It just makes it simpler to follow the different diff code paths that we have.

In 3/4, that "No NL at EOF" is suppressed for symlinks *when textconv is in effect only*, i.e. when we don't (necessarily) produce a diff fit to be applied anyways.

As Jeff pointed out in his 2nd response, it may make sense to have this dependent on TERM just like color output is currently (which messes ab diff|apply also!).

I would even go so far to say that --no-textconv should be the default for diff,log etc. unless the output goes to the terminal, just like our color handling.

Michael
Previous: Junio C HamanoNext: Junio C Hamano
Message 4 of 22 in “Don't warn about missing EOL for symlinks”
  1. 0/4 Don't warn about missing EOL for symlinksMichael J Gruber, Jun 3, 2010
  2. 1/4 diff/xdiff: refactor EOF-EOL detectionMichael J Gruber, Jun 3, 2010
  3. Junio C HamanoJun 3, 2010
  4. Michael J GruberJun 4, 2010
  5. Junio C HamanoJun 5, 2010
  6. Michael J GruberJun 5, 2010
  7. Jeff KingJun 6, 2010
  8. Junio C HamanoJun 6, 2010
  9. Johannes SixtJun 6, 2010
  10. Jeff KingJun 6, 2010
  11. Michael J GruberJun 7, 2010
  12. 2/4 diff: make treatment of missing EOL at EOF configurableMichael J Gruber, Jun 3, 2010
  13. 3/4 diff: Do not warn about missing EOL at EOF for symlinksMichael J Gruber, Jun 3, 2010
  14. Jeff KingJun 3, 2010
  15. 4/4 RFC: add whitespace rule for no-eol-at-eofMichael J Gruber, Jun 3, 2010
  16. Matthieu MoyJun 3, 2010
  17. Michael J GruberJun 3, 2010
  18. Jeff KingJun 3, 2010
  19. Michael J GruberJun 3, 2010
  20. Jeff KingJun 3, 2010
  21. Johannes SixtJun 4, 2010
  22. Jeff KingJun 4, 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.