[PATCH] Use the first line of commit message in "log --line"

Alexander Belchenko bialix at ukr.net
Tue May 30 11:39:49 BST 2006


Matthieu Moy пишет:
> I started a discussion some time ago about enforcing the convention in
> bzr that the first line of commit messages would be the patch summary,
> and the following would be the detailed log.
> 
> There were two things to do for that:
> 
> 1) Make "bzr log --line" show only the first line
> 
> 2) Allow someone to enter a multi-line comment with -m "something".
>    (without relying on the shell's multi-line support)
> 
> The following path does this. For 2), I've simply allowed "\n" to be
> used as a line separator in the argument of -m.
> 
> For example:
> 
> moy at moy:/tmp/proj$ bzr commit -m "first line\nsecond line"
> added foo                                                                                                                                   
> Committed revision 1.                                                                                                                       
> moy at moy:/tmp/proj$ bzr log --short
>     1 Matthieu Moy      2006-05-28                                                                                                          
>       first line
>       second line
> 
> moy at moy:/tmp/proj$ bzr log --line
> 1: Matthieu Moy 2006-05-28 first line                                                                                                       
> 
> 
> It also does this (for free!) for merge summary in "bzr status".
> 
> Martin agreed on the principle. Now looking for +1's

I'm still -0.

Because it affects already existing history and pending merge status, it
is not backward compatible. Because from the start bzr does not have
idea of summary in log messages. May be better make this idea more
straightforward and add some UI (per example, option '-s' for commit
command)? I think, Gnu arch's way is better because it clearly distinct
between summary and log message. Why bzr cannot save summary as separate
metadata of revision?

May I propose to interprete first line as summary *only* if there is no
second line, or if the second line is empty string (or probably contains
only spaces/tabs characters)? In this case 2 varinats of log history:

1:
first line started
and continued on next line

2:
first line

other lines...

So variant 1 will be interpreted as log message *without* summary,
and variant 2 will be interpeted as log *with* summary in first line.

--
Alexander





More information about the bazaar mailing list