Announcement

Collapse
No announcement yet.

pre-commit hook to mandate a pattern in commit message

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • pre-commit hook to mandate a pattern in commit message

    Hello al,
    I want to mandate a specific pattern in the commit message while I commit to SVN . Could someone help me as to how to proceed with this ?
    Any help on this would be greatly appreciated ...

    Thanks
    Nanditha

  • #2
    RE: pre-commit hook to mandate a pattern in commit message

    That's fairly simple. You can create a script (perl/shell/etc) which you can invoke from pre-commit. Pass on the repository path and transaction id to the script. Make the script use svnlook to get the log comment (svnlook log -t <TXN-ID> <REPO-PATH>). Now check if the comment adheres to your standard. If it doesn't print an error message to stderr and exit with 1. In pre-commit, exit with whatever status this script returns.

    Comment

    Working...
    X