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.