App-Gitc
view release on metacpan or search on metacpan
bin/gitc-promote view on Meta::CPAN
# calculate the changeset list based on --except
my $source = environment_preceding($target);
my @available = unpromoted( "origin/$source", "origin/$target" );
if ($except) {
die "You gave --except and a list of changesets. You may only specify "
. "one or the other\n"
if @refs;
my %except = map { $_ => 1 } split /,/, $except;
@refs = map { $except{$_} ? () : full_changeset_name($_) } @available;
die "It looks like you excluded all the changesets\n" if not @refs;
}
my $cherry_pick = @refs ? 1 : 0;
# handle dependencies for cherry pick promotions
if ($cherry_pick) {
if ( not $ignore_dependencies ) {
while ( my @missing = find_missing_dependencies( $target, @refs ) ) {
@refs = handle_missing_dependencies( \@refs, \@missing );
}
}
lib/App/Gitc/Util.pm view on Meta::CPAN
}
sub guarantee_a_clean_working_directory {
my $arguments = "diff -C -M --name-status";
my $staged = git "$arguments --cached";
my $changed = git $arguments;
return if not $staged and not $changed;
# the tree is dirty, verify whether to continue
warn "It looks like you have uncommitted changes. If this is expected,\n"
. "type 'y' to continue. If it's not expected, type 'n'.\n"
. ( $staged ? "staged:\n$staged\n" : '' )
. ( $changed ? "changed:\n$changed\n" : '' )
;
die "Aborting at the user's request.\n" if not confirm('Continue?');
# stash the changes to let them be restored later
my $stash = git "stash create";
git "reset --hard";
return $stash;
( run in 0.396 second using v1.01-cache-2.11-cpan-64827b87656 )