Subject: Re: [PATCH] git-commit: Reformat log messages provided on commandline

From: Matthieu Moy <[email-masked]>
Date: Wed, 09 May 2007 16:59:03 +0200

Petr Baudis <[email-masked]> writes:

> -	echo "$log_message"
> +	echo "$log_message" | fmt

I wouldn't do that for the first line of the message.

Someone typing

$ git commit -m "a very very very very very very very very very very very very long summary" \
             -m "a longer description of the above summary"

Probably doesn't want his first line to be broken (otherwise,
git-format-patch and other tools would be confused).

So, that would be more like

echo "$log_message" | (read first_line; echo "$first_line"; fmt)

Perhaps another option would be to provide, say, a -M option, doing

log_message="$log_message

$(echo $1 | fmt)"

to allow people to explicitely say whether they want reformatting. But
that's probably overkill.

-- 
Matthieu