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

Re: patch newline in log messages

From: <kfogel_at_collab.net>
Date: 2006-02-28 23:45:03 CET

Olleg Samoylov <olleg@mipt.ru> writes:
> Only for a subversion developer. :)
> When a common user write a log message in a text editor, for instance
> one line, user expect a one line log message, isn't it? After "svn
> log", user is very surprised when see two line log message, especially
> text string "|lines=2". This behaviour is unexpected and unpredictable
> for everyone, except subversion developers. Do you agree?
>
> This bug is not severe, but looked like an ink blot on a white shirt.

I agree the behavior is unexpected and mildly surprising. Ink blot on
a white shirt is a good analogy.

> > I'm not yet convinced there is a bug here worth fixing. Since this
> > thread's subject and body no longer contain the issue number, and
>
> According to rules issue must be placed after a dispute in a mail thread.

Sorry, I saw the word "issue" and assumed there was one filed already,
I understand what you meant now.

> > there is no description of your patch's behavior in your mail here,
> > it's difficult for me to track down exactly what your patch does.
>
> I'll explain. Log message in version 1.x may have (in case of text
> editor) or may have not (in case of "svn ci -m") trailing newline. And
> this is not issue of text editor, trailing newline is appeared after
> removing "--This line, and those below, will be ignored--", this issue
> is entirely of subversion.

Well, that depends how you define "line". If you define it to mean a
bunch of non-newline characters followed by a newline (as I was
proposing for a solution, in fact), then Subversion is doing exactly
what it promises to do.

> Old "svn log" behavior is always add one newline more to insure text
> will not be jammed.

Right.

> After patch "svn log" will check for trailing newline in log message
> and only when it's needed add newline and increment "lines".

So, my original objection to this patch was that it fixes the problem
by misrepresenting the data (in a trival way, I admit). Right now,
Subversion *always* adds a newline when displaying the log message, so
you can always know exactly what the person actually entered for the
log message. After this patch, that data is no longer recoverable.

On the other hand, I do favor enforcing the format of log messages on
the repository side instead (an idea first proposed by Greg Hudson, if
I remember correctly). In other words, on the repository side we'd do
the same thing: ensure there's always exactly one trailng newline on
the log message. This also munges the user's data, in the same way.
It would fix legacy svn:log properties too as necessary.

The server-side solution has the advantage of solving the problem for
all clients. I think I'd be +1 on your patch, as a compatibility
measure for older repositories, *if* we also implemented this behavior
on the server side. But doing only the client change seems wrong: log
messages are repository data, they should be in the correct format
when they are stored/retrieved in the repository.

Thoughts?

-Karl

-- 
www.collab.net  <>  CollabNet  |  Distributed Development On Demand
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Mar 1 01:30:38 2006

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