Re: [PATCH] Do not strip empty lines / trailing spaces from a commit message template

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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...

>  	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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]