Re: [PATCH] Do not strip empty lines / trailing spaces from a commit message template
- From
Jeff King <peff@peff.net>
- Date
- Mar 11, 2010, 08:12 UTC
- Message-ID
- <20100311081213.GA13575@sigill.intra.peff.net>
- In-Reply-To
- <4B97C157.4020806@gmail.com>
On Wed, Mar 10, 2010 at 04:57:11PM +0100, Sebastian Schuberth wrote:
> Templates should be just that: Forms that the user fills out, and forms > have blanks. If people are attached to not having extra whitespace in the > editor, they can simply clean up their templates.
Rationale makes sense to me...
Show 6 quoted lines
> if (fp == NULL)
> die_errno("could not open '%s'", git_path(commit_editmsg));
>
> - if (cleanup_mode != CLEANUP_NONE)
> + if (cleanup_mode != CLEANUP_NONE && strcmp(hook_arg1, "template"))
> stripspace(&sb, 0);And the code looks OK, though admittedly I am not too familiar with this chunk of code (at first I was confused that you would have to look at hook_arg1, but apparently there is no other variable that contains the result of that big if-else chain).
How about a test to check the new behavior?
-Peff