On Thu, May 15, 2014 at 01:21:26PM -0700, Alain wrote: > Hi, > > i would like to know if it is possible (and if yes, how to do it) to > retrieve for example tag information or file version from GIT in > order to automatically generate/append a file header to each file in > order to allow traceability. > I mean i would like to have for example: > > /********* > * Filename : filename_from_git_repo > * version : file_version_from_git_repo > * author: author_name_from_git_repo > * date: last_modification_date_from_git_repo > * ... > */ > > it would be great for php, css, html or any other file...
http://stackoverflow.com/questions/11534655/git-keyword-substitution-like-those-in-subversion I personally think that the lack of keyword substitution is a good thing. I've so far, during my 15 years in software development *never* seen a worthwhile use of VCS keyword substitution. - filname: only useful if I have short memory and am using an editor that doesn't display the name of the currently open file - version: doesn't make sense in git, would it be the hash? what does that tell me? - author: who's the author? the person that added the file to git? all people who have made a change to the file? the person making the latest change? who? and how does that help me as a developer? - date: what use is it to me to know that the file was last changed 2 days ago? All that information is interesting to have, but it's already available in the git repo, why have it in each file too? I'd be very interested in hearing your use case for having that info in the file. I'd love to be convinced that all those other VCSs haven't wasted effort on implementing a rather useless feature :) /M -- Magnus Therning OpenPGP: 0xAB4DFBA4 email: mag...@therning.org jabber: mag...@therning.org twitter: magthe http://therning.org/magnus Heuristic is an algorithm in a clown suit. It’s less predictable, it’s more fun, and it comes without a 30-day, money-back guarantee. -- Steve McConnell, Code Complete
Description: PGP signature