I have a private git repository that I do all of my staging on before pushing it up to Github. I have the following template
/**
*
* @version ${commit}
* @since ${initial_commit}
*/
public class Foo {
}
What I want is to have the ${initial_commit}
to be replaced with the commit number when the file was added to the repo, and every time there is a change, change the ${commit}
to the resulting commit number. Is there some way to accomplish this? I saw another post about using a post-commit hook, but my thinking is that, the commit number (or value/hash) is calculated based on the changes, but by changing the values in the post-commit hook when committing to the public repo, it would have a different number. Or am I mistaken?