From 8fc2c2d08093c7d2a7370b2aa4a4aff8027c02d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jesper=20S=C3=A4rnesj=C3=B6?= Date: Wed, 16 Jul 2014 11:24:18 +1000 Subject: [PATCH 1/2] Only require commit message to be non-empty. --- Classes/Controllers/PBGitCommitController.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/Controllers/PBGitCommitController.m b/Classes/Controllers/PBGitCommitController.m index 062cbd205..9c36ac0e9 100644 --- a/Classes/Controllers/PBGitCommitController.m +++ b/Classes/Controllers/PBGitCommitController.m @@ -159,7 +159,7 @@ - (void) commitWithVerification:(BOOL) doVerify } NSString *commitMessage = [commitMessageView string]; - if ([commitMessage length] < 3) { + if ([commitMessage length] == 0) { [[repository windowController] showMessageSheet:@"Commitmessage missing" infoText:@"Please enter a commit message before committing"]; return; } From fde62d8abf1270048ac33e533faadc495bfd926d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jesper=20S=C3=A4rnesj=C3=B6?= Date: Wed, 16 Jul 2014 11:25:09 +1000 Subject: [PATCH 2/2] Only replace commit message if empty when amending. --- Classes/Controllers/PBGitCommitController.m | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Classes/Controllers/PBGitCommitController.m b/Classes/Controllers/PBGitCommitController.m index 9c36ac0e9..69d3a9795 100644 --- a/Classes/Controllers/PBGitCommitController.m +++ b/Classes/Controllers/PBGitCommitController.m @@ -213,9 +213,8 @@ - (void)commitHookFailed:(NSNotification *)notification - (void)amendCommit:(NSNotification *)notification { - // Replace commit message with the old one if it's less than 3 characters long. - // This is just a random number. - if ([[commitMessageView string] length] > 3) + // Replace commit message with the old one if it's empty. + if ([[commitMessageView string] length] > 0) return; NSString *message = [[notification userInfo] objectForKey:@"message"];