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

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?

Previous: Marcus ComstedtNext: Marcus Comstedt
Message 12 of 19 in “Fix for normalization of foreign idents”
  1. Marcus ComstedtAug 23, 2010
  2. convert: fix normalization of foreign identsMarcus Comstedt, Aug 23, 2010
  3. Jonathan NiederAug 23, 2010
  4. Marcus ComstedtAug 23, 2010
  5. Jonathan NiederAug 23, 2010
  6. Junio C HamanoAug 23, 2010
  7. Marcus ComstedtAug 24, 2010
  8. Marcus ComstedtSep 6, 2010
  9. Jonathan NiederSep 6, 2010
  10. Marcus ComstedtSep 7, 2010
  11. 1/2 convert: fix normalization of foreign identsMarcus Comstedt, Aug 23, 2010
  12. Junio C HamanoSep 10, 2010
  13. Marcus ComstedtSep 12, 2010
  14. Junio C HamanoSep 12, 2010
  15. Marcus ComstedtSep 12, 2010
  16. convert: generalize checksafe parameterMarcus Comstedt, Sep 13, 2010
  17. 2/2 t0021: test checkout and commit of foreign identsMarcus Comstedt, Sep 7, 2010
  18. 0/2 fix normalization of foreign idents (now with test cases)Marcus Comstedt, Sep 7, 2010
  19. Jonathan NiederSep 8, 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.