Re: [PATCH v2 1/2] convert: fix normalization of foreign idents
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Sep 10, 2010, 00:26 UTC
- Message-ID
- <7vmxrqjvf6.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <E1Ot4NP-0002xn-Nc@chiyo.mc.pp.se>
Marcus Comstedt <marcus@mc.pp.se> writes:
Show 11 quoted lines
> Since ident_to_worktree() does not touch $Id$ tags which contain > foreign expansions in the repository, make sure that ident_to_git() > does not either. This fixes the problem that such files show > spurious modification upon checkout. > > There is however one case where we want ident_to_git() to normalize > the tag to $Id$ despite the asymmetry: When committing a modification > to a file which has a foreign ident, the foreign ident should be > replaced with a regular git ident. Thus, add a new parameter to > convert_to_git() that indicates if we want the foreign idents > normalized after all.
Would it be possible that the real culprit is that ident_to_worktree() does not always touch $Id$ in the first place? Why isn't "$Id: garbage$" first cleaned and then smudged upon checkout?
It also smells wrong that this "sometimes we convert, sometimes we don't" is a special case for "$Id$" and for no other conversion. Why don't smudge/clean filter or CRLF conversion have the same issue that can be solved with the same approach as this patch takes?