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

Re: [PATCH] Respect core.autocrlf when preparing temporary files for external diff

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 21, 2009, 19:35 UTC
Message-ID
<7vocvuekjb.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<8cb424b16f21164ddc26d0be3f6f7727254b3506.1237635609u.git.johannes.schindelin@gmx.de>
Johannes Schindelin <johannes.schindelin@gmx.de> writes:
> When preparing temporary files for an external diff, the files should be
> handled as if they were worktree files.

I do not think so. convert_to_working_tree() aka "smudge" means you would be feeding crap like $Id$ expansion to the external diff, which we chose not to do quite on purpose.

I think the right solution is to filter inside GIT_EXTERNAL_DIFF *if* the diff tool you are dispatching into from the external diff script wants to take smudged representation. I know we don't have such a command right now, but something like

	git filter --take-attr-for-path=$path --direction=out <clean >smudged
	git filter --take-attr-for-path=$path --direction=in >clean ><mudged

to invoke convert_to_working_tree() and convert_to_git() filters would be sufficient.

Previous: Michael J GruberNext: Johannes Schindelin
Message 3 of 14 in “Respect core.autocrlf when preparing temporary files for external diff”
  1. Respect core.autocrlf when preparing temporary files for external diffJohannes Schindelin, Mar 21, 2009
  2. Michael J GruberMar 21, 2009
  3. Junio C HamanoMar 21, 2009
  4. Johannes SchindelinMar 21, 2009
  5. Junio C HamanoMar 22, 2009
  6. Junio C HamanoMar 22, 2009
  7. Jeff KingMar 22, 2009
  8. Junio C HamanoMar 22, 2009
  9. Jeff KingMar 22, 2009
  10. Sebastian SchuberthMar 22, 2009
  11. Junio C HamanoMar 22, 2009
  12. Sebastian SchuberthMar 22, 2009
  13. Junio C HamanoMar 22, 2009
  14. Junio C HamanoMar 23, 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.