I am considering migrating from subversion to git. One of the things we use subversion for our sysadmins to manage things like configuration files. To that end, we put $URL$
into each file, which expands to the file's location in the subversion tree. This lets the admins look at a file on some arbitrary host and figure out where in the tree it came from.
The closest analog I could find is gitattributes. There is the filter=
directive, but it seems that git doesn't communicate to the filter what filename it's filtering, which would be necessary to turn $URL$
into a path.
There is also the ident
directive, which would turn $Id$
into the blob hash. This might be usable if one could map that back into a pathname, but my git-fu isn't strong enough.
Any suggestions?
The workflow is as follows:
- Admin commits changes to the VCS repo
- Admin updates a central location that has checked out the repo
- Admin pulls the changes to the host using cfengine
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…