You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by DervishD <pr...@dervishd.net> on 2005/04/18 11:10:30 UTC

Log messages have an extra blank line when autoedited

    Hi all :)

    First of all, I'm using Subversion 1.1.4.

    This is really not a bug, just a cosmethic issue, but affects to
the XML output too, so I think it may be convenient to report.

    The fact is that if you add a comment when commiting using '-m'
or '-F', the log comment has exactly the contents you specify, it
doesn't have an extra blank line at the end if you don't put one
there. Using 'svnadmin setlog' acts exactly the same. The problem
arises when you do 'svn commit' and subversion starts your editor to
add the log comment, then a blank line is always added at the end of
the comment, and this is inconsistent which the other methods.

    The cause is at clients/cmdline/util.c, in function
truncate_buffer_at_prefix. After truncation it should remove the last
newline character, if any. Since this may have lateral effects I
don't provide a patch, I don't want to screw things O:)

    Thanks a lot in advance :)

    Raúl Núñez de Arenas Coronado

-- 
Linux Registered User 88736
http://www.dervishd.net & http://www.pleyades.net/
It's my PC and I'll cry if I want to...

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Log messages have an extra blank line when autoedited

Posted by Juanma Barranquero <le...@gmail.com>.
On 4/18/05, Max Bowsher <ma...@ukf.net> wrote:

> Do you mean *subversion* is adding an extra line, or *your editor* is adding
> an extra line?

When edited on an external editor, the log comment is bracketed (or,
more properly, finished) by this:

--This line, and those below, will be ignored--

I think the commit code won't recognize the bracket text if it doesn't
start on a new line, i.e., you cannot do:

 This is my log comment. --This line, and those below, will be ignored--

so it is hard to see how would the user keep the newline from being
there at the first place.

-- 
                    /L/e/k/t/u

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org


Re: Log messages have an extra blank line when autoedited

Posted by DervishD <pr...@dervishd.net>.
    Hi Max, and thanks for your answer :)

 * Max Bowsher <ma...@ukf.net> dixit:
> >   The cause is at clients/cmdline/util.c, in function
> >truncate_buffer_at_prefix. After truncation it should remove the last
> >newline character, if any. Since this may have lateral effects I
> >don't provide a patch, I don't want to screw things O:)
> Do you mean *subversion* is adding an extra line, or *your editor* is 
> adding an extra line?

    It's subversion, I'm sure of that. The editor cannot do it
because you edit something like that:

    Whatever comment
    --This line, and those below...

    If you put a blank line between the comment and the '--This
line' thing, then you get *two* blank lines in the log message. If
you don't put any (like in my example above) you still get one). The
editor could add empty blank lines at the end of the file (that is,
after the '--This line' separator and the rest of *ignored* lines).

    The editor can cause blank lines when using 'svn commit -F' or
'svnadmin setlog' because any blank line at the end of the used file
is obviously honored, but if you just do 'svn commit' and subversion
starts the editor, then no blank lines at the end of the file may
alter the log comment.

    The problem is that subversion starts the editor and filters the
contents of the saved file just removing from '--This line...' to the
end of the file. That means that the newline after 'comment' in my
example above is not removed and so it's present in the output of
'svn log', for example.

    I hope I've made it clear now :)

    Raúl Núñez de Arenas Coronado

-- 
Linux Registered User 88736
http://www.dervishd.net & http://www.pleyades.net/
It's my PC and I'll cry if I want to...

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Log messages have an extra blank line when autoedited

Posted by Max Bowsher <ma...@ukf.net>.
DervishD wrote:
>    Hi all :)
>
>    First of all, I'm using Subversion 1.1.4.
>
>    This is really not a bug, just a cosmethic issue, but affects to
> the XML output too, so I think it may be convenient to report.
>
>    The fact is that if you add a comment when commiting using '-m'
> or '-F', the log comment has exactly the contents you specify, it
> doesn't have an extra blank line at the end if you don't put one
> there. Using 'svnadmin setlog' acts exactly the same. The problem
> arises when you do 'svn commit' and subversion starts your editor to
> add the log comment, then a blank line is always added at the end of
> the comment, and this is inconsistent which the other methods.
>
>    The cause is at clients/cmdline/util.c, in function
> truncate_buffer_at_prefix. After truncation it should remove the last
> newline character, if any. Since this may have lateral effects I
> don't provide a patch, I don't want to screw things O:)

Do you mean *subversion* is adding an extra line, or *your editor* is adding 
an extra line?

Max.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Log messages have an extra blank line when autoedited

Posted by Vincent Lefevre <vi...@vinc17.org>.
On 2005-04-18 13:10:30 +0200, DervishD wrote:
>     The fact is that if you add a comment when commiting using '-m'
> or '-F', the log comment has exactly the contents you specify, it
> doesn't have an extra blank line at the end if you don't put one
> there. Using 'svnadmin setlog' acts exactly the same. The problem
> arises when you do 'svn commit' and subversion starts your editor to
> add the log comment, then a blank line is always added at the end of
> the comment, and this is inconsistent which the other methods.

I agree with you. I've always removed everything after my log message
before closing the editor, to avoid this extra \n.

-- 
Vincent Lefèvre <vi...@vinc17.org> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / SPACES project at LORIA

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org