Re: Extra blank line when using command line editor for commit message
From: Justin Mrkva <mail_at_justinmrkva.com>
Date: Tue, 22 Apr 2014 13:52:47 -0400
That looks good at first, but this excerpt from the Subversion book explains why that’s a bad idea:
While hook scripts can do almost anything, there is one dimension in which hook script authors should show restraint: do not modify a commit transaction using hook scripts. While it might be tempting to use hook scripts to automatically correct errors, shortcomings, or policy violations present in the files being committed, doing so can cause problems. Subversion keeps client-side caches of certain bits of repository data, and if you change a commit transaction in this way, those caches become indetectably stale. This inconsistency can lead to surprising and unexpected behavior. Instead of modifying the transaction, you should simply validate the transaction in the pre-commit hook and reject the commit if it does not meet the desired requirements.
I could of course just reject the commit if it has whitespace, but then that means that any commit using the command line editor would be rejected, because svn always adds the whitespace.
On Apr 21, 2014, at 6:19 PM, Ryan Schmidt <subversion-2014_at_ryandesign.com> wrote:
>
|
This is an archived mail posted to the Subversion Users mailing list.
This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.