App-Git-Workflow-Command-BranchConflicts
view release on metacpan or search on metacpan
293031323334353637383940414243444546474849Added 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
67891011121314151617181920212223242526# $Revision$, $HeadURL$, $Date$
# $Revision$, $Source$, $Date$
use
strict;
use
warnings;
use
Pod::Usage ();
use
App::Git::Workflow;
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
525354555657585960616263646566676869707172
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
) {
"Conflicting branches:\n"
;
for
my
$branch
(
sort
keys
%conflicts
) {
" $branch\n"
,
map
{
" $_\n"
} @{
$conflicts
{
$branch
} };
}
}
lib/App/Git/Workflow/Command/BranchConflicts.pm view on Meta::CPAN
7778798081828384858687888990919293949596979899100101102103104105106107108109
$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 )