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

Re: [PATCH 3/4] diff: Do not warn about missing EOL at EOF for symlinks

From
Jeff King <peff@peff.net>
Date
Jun 3, 2010, 17:02 UTC
Message-ID
<20100603170244.GA22779@coredump.intra.peff.net>
In-Reply-To
<c1e0646449aae50fb962108d16b5428fb7d73bae.1275575236.git.git@drmicha.warpmail.net>
On Thu, Jun 03, 2010 at 04:35:22PM +0200, Michael J Gruber wrote:
Show 10 quoted lines
> diff --git a/diff.c b/diff.c
> index 7950df6..cad7339 100644
> --- a/diff.c
> +++ b/diff.c
> @@ -1788,6 +1788,8 @@ static void builtin_diff(const char *name_a,
>  		ecbdata.color_diff = DIFF_OPT_TST(o, COLOR_DIFF);
>  		ecbdata.found_changesp = &o->found_changes;
>  		ecbdata.ws_rule = whitespace_rule(name_b ? name_b : name_a);
> +		if (DIFF_OPT_TST(o, ALLOW_TEXTCONV) && (S_ISLNK(one->mode) || S_ISLNK(two->mode)))
> +			ecbdata.ws_rule &= ~WS_NO_EOL_AT_EOF;

I see why you would use ALLOW_TEXTCONV to control this behavior, since textconv by definition creates patches you can't apply. But it feels a little hack-ish to me, as textconv is really something different. You seem to want a "--allow-diff-which-cant-be-applied".

-Peff
Previous: Michael J GruberNext: Michael J Gruber
Message 14 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.