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
  • 60,369
  • 19
  • 132
  • 128

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.
  • 56,201
  • 7
  • 77
  • 69
Mark Longair
  • 415,589
  • 70
  • 403
  • 320
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.