Is there a way to have commit comments added to changed files on 'svn commit'. I have been told there is a way to do this with cvs, but we use svn. Currently, we have it add the revision number to changed files with '$Revision' keyword.
-
3You have 0 accepted answers of 9 posted question, and that is not nice. More people would help you if you accept answers to your question.Dialecticus– Dialecticus2010-11-12 18:06:54 +00:00Commented Nov 12, 2010 at 18:06
-
Oh. Did not know that I had to accept answers, just always voted them up. Thanks.NullPointer0x00– NullPointer0x002011-03-02 20:17:54 +00:00Commented Mar 2, 2011 at 20:17
4 Answers
We migrated from PVCS to SVN and found that they do not have off-the-shelf support for these type of comments which we also think are valuable. All I found was the reason behind it on a FAQ from the SVN guys.
Comments
I think the only way to do this would be to use a pre or post commit hook. Looking at SvnBook it does not appear that the commit message is part of the available variables http://svnbook.red-bean.com/en/1.5/svn.advanced.props.special.keywords.html
Comments
I must be missing something here because comments are part of the svn commit command.
Here's a quick example: $ svn commit -m "added howto section."
2 Comments
Short answer:
No, you can't do it Subversion
Explanation:
- Subversion has not internal keyword $Log$
- Changing content of transaction (during transaction, in pre-commit hook) is strictly prohibited (because it may give unpredictable results)
At last:
Log-message inside changed file is almost useless, because you can always use svn log -r REV, and get REV of last change for file with existing keyword. Just re-think about used post-CVS techiques