[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH][REPOST] Don't add extra blank line to log messages

From: C. Michael Pilato <cmpilato_at_collab.net>
Date: 2004-03-27 22:10:39 CET

Patrik RÃ¥dman <pradman@abo.fi> writes:

> I didn't receive any comments to the first posting of this patch, so here
> it is again, this time with commented code, and a better
> explanation: :)

Your explanation was fine. I'd been meaning to respond, but obviously
did not.

The "bug" you're seeing is driver error. You can't compare the usage
of -m with an $EDITOR unless you make sure you don't add extra
newlines at the end of your $EDITOR message (or *do* add them at the
end of your -m message). Allow me to demonstrate.

### First, create a new repos, checkout a working copy, and enter the wc.

$ svnadmin create repos; svn co file://`pwd`/repos wc; cd wc
Checked out revision 0.

### Now, add a file, and commit with -m.

$ echo `date` > foo
$ svn add foo > /dev/null
$ svn ci -m "No extra lines, please" > /dev/null

### Now, change the file, and commit with an external message file.
### Note that I make the external message file using 'echo -n', which
### doesn't add an extra newline. This is consistent with our use of -m.

$ echo `date` > foo
$ echo -n "No extra lines, please" > msg
$ svn ci -F msg > /dev/null

### Finally, I change the file again, and commit using $EDITOR. My
### editor pops up and I type "No extra lines, please", then strip all
### the rest of the junk out of the file -- including the newline at
### the end of my message. Again, this is to ensure a fair comparison.

$ echo `date` > foo
$ svn ci > /dev/null

### Alrighty, the moment of truth. I update my working copy, and run
### 'svn log'...

$ svn up > /dev/null
$ svn log
------------------------------------------------------------------------
r3 | cmpilato | 2004-03-27 14:44:44 -0600 (Sat, 27 Mar 2004) | 1 line

No extra lines, please
------------------------------------------------------------------------
r2 | cmpilato | 2004-03-27 14:44:09 -0600 (Sat, 27 Mar 2004) | 1 line

No extra lines, please
------------------------------------------------------------------------
r1 | cmpilato | 2004-03-27 14:43:47 -0600 (Sat, 27 Mar 2004) | 1 line

No extra lines, please
------------------------------------------------------------------------
$

### And, as you can see, when comparing apples to apples, they look
### strangely similar.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Mar 27 22:12:34 2004

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.