]> git.mjollnir.org Git - cil.git/commitdiff
Lots of niceties fixed up to do with commit messages
authorAndrew Chilton <andychilton@gmail.com>
Sat, 23 Jan 2010 13:07:01 +0000 (02:07 +1300)
committerAndrew Chilton <andychilton@gmail.com>
Sat, 23 Jan 2010 13:07:01 +0000 (02:07 +1300)
lib/CIL/Command/Add.pm
lib/CIL/Command/Comment.pm
lib/CIL/Command/Edit.pm
lib/CIL/Command/Label.pm
lib/CIL/Command/Status.pm
lib/CIL/Command/Steal.pm
lib/CIL/VCS/Git.pm

index 07442548d7aa2190976d8c5e7149eb4ad903fba7..dd1b147e56f7e3bcd1e1beced85c11c309f45b1d 100644 (file)
@@ -54,7 +54,7 @@ sub run {
 
     # if we want to commit this issue
     if ( $args->{commit} ) {
-        $cil->vcs->commit( $cil, $issue );
+        $cil->vcs->commit( $cil, 'New Issue', $issue );
     }
 }
 
index 8bbf1e45a373f5a191a93b46a8a1fa7cb63d8e58..38288f90fbcbf44e6f77b5749b5099364daa1d08 100644 (file)
@@ -53,7 +53,7 @@ sub run {
 
     # if we want to commit this comment
     if ( $args->{commit} ) {
-        $cil->vcs->commit( $cil, $comment, $issue );
+        $cil->vcs->commit( $cil, 'New Comment', $issue, $comment );
     }
 }
 
index f5dacc7732e9ce4cfc623e4d5092d463dbf0ff9b..db531491f27cf09787a3f1d7292930ccad618149 100644 (file)
@@ -72,7 +72,7 @@ sub run {
 
     # if we want to commit this issue
     if ( $args->{commit} ) {
-        $cil->vcs->commit( $cil, $issue );
+        $cil->vcs->commit( $cil, 'Issue Edited', $issue );
     }
 
     CIL::Utils->display_issue($cil, $issue);
index 534a182ecd273eb6689b7a8d98bcc6cb71afe530..8687185ae35b2d640041cd47a8cb83ebf2c17be0 100644 (file)
@@ -37,6 +37,8 @@ sub run {
         CIL::Utils->fatal("provide a valid label to add to this issue");
     }
 
+    my @issues;
+
     # for every issue
     foreach my $issue_name ( @issue_names ) {
         # firstly, read the issue in
@@ -58,9 +60,16 @@ sub run {
             $cil->vcs->add( $cil, $issue );
         }
 
-        # if we want to commit this issue
-        if ( $args->{commit} ) {
-            $cil->vcs->commit( $cil, $issue );
+        push @issues, $issue;
+    }
+
+    # if we want to commit these issues
+    if ( $args->{commit} ) {
+        if ( $args->{remove} ) {
+            $cil->vcs->commit_multiple( $cil, "Removed label '$label'", @issues );
+        }
+        else {
+            $cil->vcs->commit_multiple( $cil, "Added label '$label'", @issues );
         }
     }
 }
index 60d72d25331c5457718a515b223efc8d5bdc2d21..23212efaee367d9252c5bd042752d89f0d147181 100644 (file)
@@ -37,6 +37,8 @@ sub run {
         CIL::Utils->fatal("provide a valid status to set this issue to");
     }
 
+    my @issues;
+
     # for every issue, read it it and set the Status
     foreach my $issue_name ( @issue_names ) {
         # firstly, read the issue in
@@ -51,10 +53,12 @@ sub run {
             $cil->vcs->add( $cil, $issue );
         }
 
-        # if we want to commit this issue
-        if ( $args->{commit} ) {
-            $cil->vcs->commit( $cil, $issue );
-        }
+        push @issues, $issue;
+    }
+
+    # if we want to commit these issues
+    if ( $args->{commit} ) {
+        $cil->vcs->commit_multiple( $cil, "Status changed to '$status'", @issues );
     }
 }
 
index d86f5493074f1d8cf77af8f4bb3e472734609334..e4d04f5d8512b1ab20f4af15ed399affaafcba82 100644 (file)
@@ -47,7 +47,7 @@ sub run {
 
     # if we want to commit this issue
     if ( $args->{commit} ) {
-        $cil->vcs->commit( $cil, $issue );
+        $cil->vcs->commit( $cil, 'Issue Stolen', $issue );
     }
 
     CIL::Utils->display_issue_full($cil, $issue);
index c082bc43b8ad7f51515022555204f6d0e64144ad..091585bd17e2abacf5642c72ce764a3b7a0ce88f 100644 (file)
@@ -120,7 +120,20 @@ sub add {
 }
 
 sub commit {
-    my ($self, $cil, @entities) = @_;
+    my ($self, $cil, $message, @entities) = @_;
+
+    my @filenames;
+    foreach my $entity ( @entities ) {
+        my $filename = $entity->filename($cil, $entity->name());
+        push @filenames, $filename;
+    }
+
+    $message = 'cil-' . $entities[0]->name . ": $message";
+    return $self->git->command('commit', '-m', $message, @filenames);
+}
+
+sub commit_multiple {
+    my ($self, $cil, $message, @entities) = @_;
 
     my @filenames;
     foreach my $entity ( @entities ) {
@@ -128,7 +141,6 @@ sub commit {
         push @filenames, $filename;
     }
 
-    my $message = 'cil-' . $entities[0]->name . ': New ' . $entities[0]->type;
     return $self->git->command('commit', '-m', $message, @filenames);
 }