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

Re: RCS keyword expansion

From
Peter Karlsson <peter@softwolves.pp.se>
Date
Oct 15, 2007, 14:03 UTC
Message-ID
<Pine.LNX.4.64.0710151457131.1901@ds9.cixit.se>
In-Reply-To
<Pine.LNX.4.64.0710121231410.25221@racer.site>
Hi!
> Finding out which commit last changed that file is slow.  That's why
> it breaks down.
That might be, but it only needs to be done when a file is updated.
> You are just to used to CVS/SVN to see that there is a much better
> way in git.

I can see that favouring the argument that having a $Id$ that gives me the global state id when the file was last updated is a bad idea. Fair enough. Give me a local state tham (which you did, hash id for the file contents).

My problem now is the file date. That could possibly be fixed by having it updated before I check in the file.

So, to summarize, if I've understood the responses here correctly, what I really want is:

 on commit:
  - replace "$Date$" (or whatever) with the current time.
  - store the contents.
 on checkout:
  - update the file.
  - replace "$Id$" (ditto) with a magic identifier for the file state.
  - update git's state so that it doesn't see the "$Id$" expansion
    as a change in the file contents.

Now the question is: Where can I find documentation on how to do this (i.e what should I search for--"hooks"?)?

And, if this goes into the ".git" directory, can I still have it replicated when I clone a repository? I noticed that my ".git/ignore" file wasn't replicated and that I had to replace it with a local ".gitignore" to get it under version control.

-- 
\\// Peter - http://www.softwolves.pp.se/
Previous: Johannes SchindelinNext: Johannes Schindelin
Message 14 of 27 in “RCS keyword expansion”
  1. Peter KarlssonOct 11, 2007
  2. Johannes SixtOct 11, 2007
  3. Randal L. SchwartzOct 11, 2007
  4. Oliver KullmannOct 11, 2007
  5. Alex RiesenOct 11, 2007
  6. Johannes SchindelinOct 11, 2007
  7. Sam VilainOct 11, 2007
  8. Peter KarlssonOct 12, 2007
  9. Johannes SchindelinOct 12, 2007
  10. Peter KarlssonOct 12, 2007
  11. Johannes SixtOct 12, 2007
  12. Lars HjemliOct 12, 2007
  13. Johannes SchindelinOct 12, 2007
  14. Peter KarlssonOct 15, 2007
  15. Johannes SchindelinOct 15, 2007
  16. Jan HudecOct 12, 2007
  17. Salikh ZakirovOct 12, 2007
  18. Johannes SchindelinOct 12, 2007
  19. Zakirov SalikhOct 12, 2007
  20. Peter KarlssonOct 11, 2007
  21. Alex RiesenOct 11, 2007
  22. Peter KarlssonOct 12, 2007
  23. Barry FishmanOct 12, 2007
  24. Linus TorvaldsOct 12, 2007
  25. Florian WeimerOct 12, 2007
  26. Sam VilainOct 11, 2007
  27. Lars HjemliOct 11, 2007

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.