]> git.mjollnir.org Git - cil.git/commitdiff
cil-c77fae7c: Now does a nicer commit message for multiple issue changes
authorAndrew Chilton <andychilton@gmail.com>
Fri, 29 Jan 2010 05:45:50 +0000 (18:45 +1300)
committerAndrew Chilton <andychilton@gmail.com>
Fri, 29 Jan 2010 05:45:50 +0000 (18:45 +1300)
issues/i_c77fae7c.cil
lib/CIL/Command/Status.pm
lib/CIL/Git.pm

index 08705275852d5b54415bb45f5c3dede31f69c0bf..cc55b9f5c5ea67935f7416de2cc2785d55ce8d0e 100644 (file)
@@ -1,10 +1,10 @@
 Summary: Make commit messages nicer when multiple issues are updated
-Status: New
+Status: Finished
 CreatedBy: Andrew Chilton <andychilton@gmail.com>
 AssignedTo: Andrew Chilton <andychilton@gmail.com>
 Label: Milestone-v0.07
 Inserted: 2010-01-27T23:59:52
-Updated: 2010-01-27T23:59:52
+Updated: 2010-01-29T05:40:37
 
 When updating the status, label, depends on or precedes (and other things which
 can happen to multiple issues at any one time), the commit message doesn't say
index 35fe88518ff905c850e38cb610faba0d269898e2..b74f2ae94a4344ce612ca90a542c015ea55c6af9 100644 (file)
@@ -61,7 +61,8 @@ sub run {
     if ( $cil->UseGit ) {
         # if we want to commit these issues
         if ( $args->{commit} ) {
-            $cil->git->commit_multiple( $cil, "Status changed to '$status'", @issues );
+            my $message = "Status changed to '$status'";
+            $cil->git->commit_multiple( $cil, $message, @issues );
         }
     }
 }
index 1dec72061376b9b41cc6c3dede864dfc95379668..a38323ca75f3856356e06e6b2e5cdbdbefd39d87 100644 (file)
@@ -24,6 +24,7 @@ package CIL::Git;
 use strict;
 use warnings;
 use Carp;
+use List::Util qw(reduce);
 use Git;
 
 use base qw(Class::Accessor);
@@ -128,7 +129,9 @@ sub commit_multiple {
         push @filenames, $filename;
     }
 
-    return $self->git->command('commit', '-m', $message, @filenames);
+    my $commit_list_string = reduce { $a . $b } map { "* cil-" . $_->name . "\n" } @entities;
+
+    return $self->git->command('commit', '-m', "$message\n\n$commit_list_string", @filenames);
 }
 
 ## ----------------------------------------------------------------------------