Re: [PATCH 1/2] commit: do not cleanup template
- From
Sebastian Schuberth <sschuberth@gmail.com>
- Date
- May 8, 2011, 08:38 UTC
- Message-ID
- <4DC65684.1050606@gmail.com>
- In-Reply-To
- <7vwri2uv4m.fsf@alter.siamese.dyndns.org>
On 07.05.2011 22:13, Junio C Hamano wrote:
Show 8 quoted lines
> My gut feeling is that it is relatively easy to justify [1/2]. We prepare > the message file to be edited by the committer in sb by reading from > different message sources, and usually we would want to clean up what is > in sb before writing it out, but you may want to enforce a particular > format by using the template (such as having a leading whitespace) and the > way to tweak and fix that appearance should be by editing the template, > not by automatically running stripspace() here [*1*] when the message came > from the template.
FYI, Boris' patch pretty much matches the one I proposed back in [1] (or the slightly improved version in [2]). My commit message gives additional reasoning why whitespace in general should not be stripped from templates. IIRC, the only reason my patch was not accepted back then was that I was too lazy to write a test against it.
[1] http://kerneltrap.org/mailarchive/git/2010/3/10/25306 [2] http://repo.or.cz/w/git/mingw/4msysgit.git/commitdiff/39228f1b8af3eb6a6108c4fabf398d23a97a5993
-- Sebastian Schuberth