Re: [PATCH] git-commit: Reformat log messages provided on commandline
- From
Matthieu Moy <matthieu.moy@imag.fr>
- Date
- May 9, 2007, 14:59 UTC
- Message-ID
- <vpqps5ajb60.fsf@bauges.imag.fr>
- In-Reply-To
- <20070509142426.GV4489@pasky.or.cz>
Petr Baudis <pasky@suse.cz> 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