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

Re: Something like $Id$, $Revision$ or $Date$?

From
FGFrancis Galiegue <fg@one2team.net>
Date
Nov 10, 2008, 15:58 UTC
Message-ID
<200811101658.44366.fg@one2team.net>
In-Reply-To
<871vxjoa3j.fsf@erwin.mina86.com>

Le Monday 10 November 2008 16:48:48 Michal Nazarewicz, vous avez écrit : [...]

>
> The thing is that for some repositories I don't distinguish anything
> like a "release version" of files.
"Git tracks contents, not files".
You have two problems here:
* first, unlike CVS, files don't have revisions;
* second, unline SVN (or even Mercurial), commits are not "ordered", at least 
not in a natural way (can't tell what SHA1 is more recent).

Git will not track a single file, and I don't think it will ever do so. And then, what about renames?

You have two options there:
1. (requires git modification, I guess) put a $last_modified_date$ magic that 
expands to the last modification date;
2. (what I do) keep an internal ChangeLog for such files, that you (have to) 
fill by hand each time.
The second approach has big advantages:
* you can date your changes;
* you _really_ know the file history;
* git's renaming handle allows you to track this ChangeLog over time!
It requires discipline, though...
-- 
fge
Previous: Michal NazarewiczNext: Jakub Narebski
Message 10 of 18 in “Something like $Id$, $Revision$ or $Date$?”
  1. Michal NazarewiczNov 10, 2008
  2. Sverre RabbelierNov 10, 2008
  3. Michal NazarewiczNov 10, 2008
  4. dhruvaNov 10, 2008
  5. Michal NazarewiczNov 10, 2008
  6. Johannes SixtNov 10, 2008
  7. Johannes SchindelinNov 10, 2008
  8. dhruvaNov 10, 2008
  9. Michal NazarewiczNov 10, 2008
  10. Francis GaliegueNov 10, 2008
  11. Jakub NarebskiNov 10, 2008
  12. Michal NazarewiczNov 10, 2008
  13. Jakub NarebskiNov 10, 2008
  14. Michal NazarewiczNov 10, 2008
  15. Jakub NarebskiNov 10, 2008
  16. Francis GaliegueNov 10, 2008
  17. Jakub NarebskiNov 10, 2008
  18. Brian GernhardtNov 10, 2008

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.