my @choices = ( $self->section_choices, $self->action_choices );
$self->_iterate_commits(
sub {
- my $log = shift;
- say "";
+ my ($log, $i, $count) = @_;
+ say "\n### Commit @{[$i+1]} of $count ###";
say "-" x 75;
$self->show_header($log);
$self->show_body($log, 1);
my @choices = ( $self->review_choices, $self->action_choices );
$self->_iterate_commits(
sub {
- my $log = shift;
- say "";
+ my ($log, $i, $count) = @_;
+ say "\n### Commit @{[$i+1]} of $count ###";
say "-" x 75;
$self->show_header($log);
$self->show_notes($log, 1);
my ($self, $fcn) = @_;
my $type = $self->opt('type');
say STDERR "Scanning for $type commits since " . $self->last_tag . "...";
- for my $log ( $self->find_commits($type) ) {
- redo unless $fcn->($log);
+ my $list = [ $self->find_commits($type) ];
+ my $count = @$list;
+ while ( my ($i,$log) = each @$list ) {
+ redo unless $fcn->($log, $i, $count);
}
return 1;
}
$args //= {};
my $tempfh = File::Temp->new;
$tempfh->printflush( $text );
- if ( my (@editor) = $ENV{VISUAL} || $ENV{EDITOR} ) {
+ if ( my @editor = split /\s+/, ($ENV{VISUAL} || $ENV{EDITOR}) ) {
push @editor, "-f" if $editor[0] =~ /^gvim/;
system(@editor, "$tempfh");
}
my ($self, $log) = @_;
my $header = $log->short_id;
$header .= " " . $log->subject if length $log->subject;
+ $header .= sprintf(' (%s)', $log->author) if $log->author;
say colored( $header, "yellow");
return;
}
my $section = _strip_parens($choice->{name});
my $subject = $log->subject;
my $body = $log->body;
- my $id = $log->short_id;
my $template = $self->note_template( $log,
- "perldelta: $section [pending]\n\n=head2 $subject\n\n$body ($id)\n"
+ "perldelta: $section [pending]\n\n=head2 $subject\n\n$body\n"
);
my $note = $self->edit_text( $template );
my $section = _strip_parens($choice->{name});
my $subject = $log->subject;
my $body = $log->body;
- my $id = $log->short_id;
my $template = $self->note_template( $log,
- "perldelta: $section [pending]\n\n=head3 L<LINK>\n\n=over\n\n=item *\n\n$subject ($id)\n\n$body\n\n=back\n"
+ "perldelta: $section [pending]\n\n=head3 L<LINK>\n\n=over\n\n=item *\n\n$subject\n\n$body\n\n=back\n"
);
my $note = $self->edit_text($template);
my $section = _strip_parens($choice->{name});
my $subject = $log->subject;
my $body = $log->body;
- my $id = $log->short_id;
my $template = $self->note_template( $log,
- "perldelta: $section [pending]\n\n=item *\n\n$subject ($id)\n\n$body\n"
+ "perldelta: $section [pending]\n\n=item *\n\n$subject\n\n$body\n"
);
my $note = $self->edit_text($template);
my $section = _strip_parens($choice->{name});
my $subject = $log->subject;
my $body = $log->body;
- my $id = $log->short_id;
my $template = $self->note_template( $log,
- "perldelta: $section [pending]\n\n=item PLATFORM-NAME\n\n$subject ($id)\n\n$body\n"
+ "perldelta: $section [pending]\n\n=item PLATFORM-NAME\n\n$subject\n\n$body\n"
);
my $note = $self->edit_text($template);
my $section = _strip_parens($choice->{name});
my $subject = $log->subject;
my $body = $log->body;
- my $id = $log->short_id;
my $template = $self->note_template( $log, << "HERE" );
perldelta: $section [pending]
$subject
-$body ($id)
+$body
HERE
my $note = $self->edit_text( $template );
sub subject { shift->attr->{subject} }
sub body { shift->attr->{body} }
sub short_id { shift->attr->{short_id} }
+sub author { shift->attr->{author} }
sub from_log {
my ($class, $log) = @_;