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

Re: [PATCH] truncate EDITOR_EOF_PREFIX with previous EOL

From: <kfogel_at_collab.net>
Date: 2005-07-22 06:23:25 CEST

Olleg Samoylov <olleg@mipt.ru> writes:
> > * Problem (2) is that the Subversion command-line client
> > unconditionally adds a trailing eol when it *prints* log messages, to
> > make sure that multiple logs in sequence look pretty. Changing this
> > behavior is possible, but would need to be done carefully: we can't
> > just stop adding the eol, instead we'd have to refrain from adding it
> > when there is already at least one eol present anyway. Your patch
> > doesn't do this.
>
> It's not true:
> 12:24:20 olleg@archie ~/src/test
> $ svn log -r HEAD
> ------------------------------------------------------------------------
> r6 | olleg | 2005-07-18 22:59:37 +0400 (Mon, 18 Jul 2005) | 1 line
>
> test
> ------------------------------------------------------------------------
> 12:24:22 olleg@archie ~/src/test
> $
>
> Here is not trailing eol. Only blank line between revision and log
> message. You can test this by command
> svn ci -m test

(This reply is unrelated to the rest of the thread, I just want to
clarify for Olleg what I meant.)

Olleg, look at the output above:

You did "svn ci -m test" to create r6. As a result, Subversion prints
the log message for r6 as: the word "test", followed by a newline,
followed by the log message separator. That newline, the one I just
mentioned, is the one that Subversion unconditionally adds. Without
it, the output would look like this;

$ svn log -r HEAD
------------------------------------------------------------------------
r6 | olleg | 2005-07-18 22:59:37 +0400 (Mon, 18 Jul 2005) | 1 line

test------------------------------------------------------------------------

Do you see what I mean now?

The behavior change I describe above is simply to detect if the
message already ends with a newline, and not add any newline if so.
Thus, Subversion would do this (which I don't think is a good idea, by
the way):

$ echo -n "test" > logmsg
$ svn ci -F logmsg
[...]
Committed revision 6.
$ echo "test" > logmsg
$ svn ci -F logmsg
[...]
Committed revision 7.
$ svn log -r 7:6
------------------------------------------------------------------------
r7 | olleg | 2005-07-18 23:00:00 +0400 (Mon, 18 Jul 2005) | 1 line

test
------------------------------------------------------------------------
r6 | olleg | 2005-07-18 22:59:37 +0400 (Mon, 18 Jul 2005) | 1 line

test
------------------------------------------------------------------------
$

I am not proposing we do this. However, it has been discussed briefly
in the distant past, that's why I had it in mind when I was
determining what problem you had solved. Probably I shouldn't have
listed it, it only confused matters.

-Karl

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Jul 22 07:15:12 2005

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.