App-Git-Workflow-Command-BranchConflicts

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
Added missing dependencies (Ivan Wills)
Fixed version numbers (Ivan Wills)
Fixed ignores (Ivan Wills)
Fixing tests (Ivan Wills)
Fixed skipping build files (Ivan Wills)
Removed incorrect to manifest files (Ivan Wills)
Updated mock data to match code changes (Ivan Wills)
Fixed up documentation (Ivan Wills)
Added ability to ignore certain file changes (Ivan Wills)
Added further cleaning up of branch before moving on (Ivan Wills)
Added capturing stderr from git to keep output clean (Ivan Wills)
Removed unneeded tag (Ivan Wills)
Added meta.json file (Ivan Wills)
Updated licence (Ivan Wills)
Fixed spelling (Ivan Wills)
Fixed module description (Ivan Wills)
Fixed test data (Ivan Wills)
Added ability to limit checked branches not merged to another branch or not modified after a certain date (Ivan Wills)
Added more content to skip file (Ivan Wills)
Fixed boilerplate test (Ivan Wills)
Fixed tests (Ivan Wills)

lib/App/Git/Workflow/Command/BranchConflicts.pm  view on Meta::CPAN

6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# $Revision$, $HeadURL$, $Date$
# $Revision$, $Source$, $Date$
 
use strict;
use Pod::Usage ();
use Data::Dumper qw/Dumper/;
use English qw/ -no_match_vars /;
use App::Git::Workflow::Command qw/get_options/;
use Capture::Tiny qw/capture_stderr/;
 
our $VERSION  = 0.6;
our $workflow = App::Git::Workflow->new;
our ($name)   = $PROGRAM_NAME =~ m{^.*/(.*?)$}mxs;
our %option;
 
sub run {
    my ($self) = @_;
 
    get_options(

lib/App/Git/Workflow/Command/BranchConflicts.pm  view on Meta::CPAN

52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
    for my $branch (@branches) {
        next if $option{since} && !$workflow->git->log(qw/-n1 --since/, $option{since}, $branch);
        if ( $self->merge_branch_conflicts($branch) ) {
            push @{ $conflicts{$first_branch} }, $branch;
        }
    }
 
    $workflow->git->reset('HEAD');
    $workflow->git->clean('-xfd');
    $workflow->git->checkout('.');
    capture_stderr {
        $workflow->git->checkout('-');
    };
}
 
if (%conflicts) {
    print "Conflicting branches:\n";
    for my $branch (sort keys %conflicts) {
        print "  $branch\n", map {"    $_\n"} @{ $conflicts{$branch} };
    }
}

lib/App/Git/Workflow/Command/BranchConflicts.pm  view on Meta::CPAN

77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
    $self->cleanup();
 
    return;
}
 
my @checkouts;
sub checkout_branch {
    my ($self, $branch) = @_;
 
    my $local = 'branch-conflicts-' . sprintf '%03i', scalar @checkouts;
    capture_stderr {
        $workflow->git->checkout('-b', $local, '--no-track', $branch);
    };
 
    push @checkouts, $local;
 
    return $local;
}
 
sub merge_branch_conflicts {
    my ($self, $branch) = @_;
 
    capture_stderr {
        eval { $workflow->git->merge('--no-commit', $branch) };
    };
    my $status = $workflow->git->status;
    eval { $workflow->git->merge('--abort'); };
 
    if ($option{ignore}) {
        $status =~ s/both (?:added|modified): \s+ $option{ignore}//;
    }
 
    return $status =~ /both (?:added|modified)/;



( run in 0.228 second using v1.01-cache-2.11-cpan-ec4f86ec37b )