3

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.

2
  • 3
    You 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. Commented Nov 12, 2010 at 18:06
  • Oh. Did not know that I had to accept answers, just always voted them up. Thanks. Commented Mar 2, 2011 at 20:17

4 Answers 4

2

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

Sign up to request clarification or add additional context in comments.

Comments

0

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

0

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

yes...you are missing something, as am I. I use the svn commit -m "foo" everyday, but a coworker of mine claims that with cvs on a commit, for all the changed files your commit can be placed at the top of the file. So next person working on it will know possible changes.
Unfortunately, this answer totally misses the point. The OP does know how to add a comment. The question is how to include it in a file. (Like the header of a source code, or a README.txt)
0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.