Extra newline added to commit messages -- why?

2010-04-15 Thread Ori Avtalion

Hi,

After looking at logs for a project, I notice some commits have an empty 
line between the commit text and the "--" line, and some don't.


After asking on #svn and doing some tests, I realized that the commits I 
saw without the extra newline were either made by "commit -m", git-svn, 
or by removing the helper "--This line, and those below, will be 
ignored--" text from the commit message file and telling the editor to 
not add a newline to the end of a file. (e.g. Can be done using an 
autocmd in vim)


Why is that newline added in the first place?

Shouldn't Subversion maintain the appearance of the commit message as it 
is in the temp commit message file and ignore the newline between the 
message itself and the "--This line" text?


As another example of why I find this illogical, these two processes 
should produce the same commit log message, but they don't:


This doesn't add a newline at the end
1) $ svn commit -m "Fixed something"

This does:
2) $ svn commit # then edit:
Fixed something
--This line, and those below, will be ignored--

Ma
EOF

What do you think?

-Ori


Re: Extra newline added to commit messages -- why?

2010-04-16 Thread Ori Avtalion

On 04/16/2010 01:56 AM, Ryan Schmidt wrote:


I think you should use log-police.py to make it a non-issue. This script 
ensures all log messages end with exactly one newline, regardless how many were 
there originally. You can set it up as a hook script to auto-correct new 
commits as they happen, and run it once over all existing commits to fix them 
up as well.



I understand you can hack around such things with server hooks (if you 
have access to the server), but shouldn't this inconsistency be 
considered a (minor) bug that should be fixed?