[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]

 



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.

Signed-off-by: Sebastian Schuberth <sschuberth@xxxxxxxxx>
---
 builtin-commit.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/builtin-commit.c b/builtin-commit.c
index f4c7344..8a68dd3 100644
--- a/builtin-commit.c
+++ b/builtin-commit.c
@@ -584,7 +584,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
 	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);
 
 	if (signoff) {
-- 
1.7.0.2.msysgit.0.8.g888e.dirty



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