4

I have a bare (remote) GIT repository with the several users blessed to commit there. On repository clone/pull I want that each source file which contains magic $Id:$ is expanded to smth. like: $Id: <name-of-last-committer> <data>.

It'd be amazing if this expanded/collapsed magic string would not affect on file modification state.

I suppose it is done via hooks. I wonder if there are any ready-to-use such hooks? Or how my task with $Id can be solved? Thanks.

nulltoken
  • 64,429
  • 20
  • 138
  • 130

2 Answers2

3

You should take a look at the section of Pro Git on keyword expansion - I'm sure you can adapt that solution to your needs:

ax.
  • 58,560
  • 8
  • 81
  • 72
Mark Longair
  • 446,582
  • 72
  • 411
  • 327
0

I use the pre-commit script to alter the $Id:$ tag. It fills out the whole thing with current information. As for the version number, all I do is add one to it. So 1.012 becomes 1.013. The current time and date as well as the current user are added to the tag.