Add commit-template support

Reviewed-by: Rohan McGovern
This commit is contained in:
Alex 2011-05-11 15:24:41 +10:00
parent b984a0da2b
commit e36ef7a76e
2 changed files with 21 additions and 0 deletions

10
.commit-template Normal file
View File

@ -0,0 +1,10 @@
# ===[ Subject ]==========[ one line, please wrap at 72 characters ]===|
# ---[ Details ]---------[ remember extra blank line after subject ]---|
# ---[ Fields ]-----------------[ uncomment and edit as applicable ]---|
#Task-number:
#Reviewed-by:
# ==================================[ please wrap at 72 characters ]===|

View File

@ -180,6 +180,7 @@ use Carp qw( confess );
use English qw( -no_match_vars );
use Getopt::Long qw( GetOptionsFromArray );
use Pod::Usage qw( pod2usage );
use Cwd qw( getcwd );
my %PROTOCOLS = (
'internal' => 'git://scm.dev.nokia.troll.no/' ,
@ -332,6 +333,11 @@ sub git_submodule_init
}
$self->exe('git', 'submodule', 'init', @init_args);
my $template = getcwd()."/.commit-template";
if (-e $template) {
$self->exe('git', 'config', 'commit.template', $template);
}
return;
}
@ -478,6 +484,11 @@ sub git_clone_one_submodule
$self->exe('git', 'fetch', ($mirror ? $mirror : $url));
}
my $template = getcwd()."/../.commit-template";
if (-e $template) {
$self->exe('git', 'config', 'commit.template', $template);
}
if ($mirror) {
$self->exe('git', 'config', 'remote.origin.url', $url);