From: Petr Baudis Date: Wed, 09 May 2007 15:11:48 GMT Subject: Re: [PATCH] git-commit: Reformat log messages provided on commandline Message-ID: <20070509151148.GW4489@pasky.or.cz> In-Reply-To: On Wed, May 09, 2007 at 04:59:03PM CEST, Matthieu Moy wrote: > Petr Baudis 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) Hmm, I don't really know if it's more evil to split an extra-long line to two or keep it longer than the maximum sane width. Since I'm torn, I'd prefer to go for the version that's simpler (also, avoids weird results for those who for some reason chose not to follow the usual convention, but that's a minor point). I don't really care, but if noone else does either, I'd stay with the current simple version. :) -- Petr "Pasky" Baudis Stuff: http://pasky.or.cz/ Ever try. Ever fail. No matter. // Try again. Fail again. Fail better. -- Samuel Beckett