| 1 | package Git::CPAN::Patch::Command::Squash; | ||||||||||
| 2 | 1 | our $AUTHORITY = 'cpan:YANICK'; | |||||||||
| 3 | #ABSTRACT: Combine multiple commits into one patch | ||||||||||
| 4 | 1 | $Git::CPAN::Patch::Command::Squash::VERSION = '2.5.2'; | |||||||||
| 5 | 1 | ▶ | use 5.10.0; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | |||||||||||
| 10 | 1 | ▶ | use Git::Repository; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | |||||||||||
| 12 | 1 | ▶ | use MooseX::App::Command; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 13 | |||||||||||
| 14 | 1 | with 'Git::CPAN::Patch::Role::Git'; | |||||||||
| 15 | |||||||||||
| 16 | 1 | ▶ | use experimental qw/ | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 17 | signatures | ||||||||||
| 18 | postderef | ||||||||||
| 19 | 1 | /; | |||||||||
| 20 | |||||||||||
| 21 | 1 | has first_arg => ( | |||||||||
| 22 | is => 'ro', | ||||||||||
| 23 | isa => 'Str', | ||||||||||
| 24 | required => 0, | ||||||||||
| 25 | ); | ||||||||||
| 26 | |||||||||||
| 27 | has branch => ( | ||||||||||
| 28 | is => 'ro', | ||||||||||
| 29 | isa => 'Str', | ||||||||||
| 30 | lazy => 1, | ||||||||||
| 31 | 0 | ▶ | default => sub ($self) { | ||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=17.9
| |||||||||||
| 32 | 0 | ▶ | $self->first_arg || 'patch'; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 33 | }, | ||||||||||
| 34 | 1 | ); | |||||||||
| 35 | |||||||||||
| 36 | 0 | ▶ | sub run ($self) { | ||||||||
|
Subroutine
run: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||
| 37 | 0 | my $head = $self->git_run("rev-parse", "--verify", "HEAD"); | |||||||||
| 38 | |||||||||||
| 39 | 0 | say for $self->git_run("checkout", "-b", $self->branch, "cpan/master"); | |||||||||
| 40 | |||||||||||
| 41 | 0 | say for $self->git_run("merge", "--squash", $head); | |||||||||
| 42 | |||||||||||
| 43 | 0 | say ""; | |||||||||
| 44 | |||||||||||
| 45 | 0 | say "Changes squashed onto working directory, commit and run git-cpan send_patch"; | |||||||||
| 46 | } | ||||||||||
| 47 | |||||||||||
| 48 | 1 | __PACKAGE__->meta->make_immutable; | |||||||||
| 49 | |||||||||||
| 50 | 1 | 1; | |||||||||
| 51 | |||||||||||
| 52 | __END__ | ||||||||||