简体   繁体   中英

svn comments added to file on commit?

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.

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.

http://subversion.apache.org/faq.html#log-in-source

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

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

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."

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM