goto_branch($new_name);
remove_branch($old_name);
}
-elsif ($action eq 'addname') {
+elsif ($action eq 'name') {
if ((scalar @ARGV) < 3) {
print STDERR "Name(s) missing.\n";
exit 1;
goto_tree();
goto_branch($name);
}
+elsif ($action eq 'tree') {
+ if ((scalar @ARGV) < 2) {
+ print STDERR "Name missing.\n";
+ exit 1;
+ }
+ my $name = $ARGV[1];
+ goto_tree();
+ goto_branch($name);
+ show_tree();
+}
elsif ($action eq 'rm') {
if ((scalar @ARGV) < 2) {
print STDERR "Name missing.\n";
}
$r = system_encoded(GIT(), (
- GIT(), 'push', '--all', '--force'
+ GIT(), 'push', '--mirror'
));
if ($r != 0) {
print STDERR "Git push fail.\n";
print STDERR "Git remote remove fail.\n";
exit 1;
}
-}
\ No newline at end of file
+}
+
+sub show_tree {
+ my $r = system_encoded(GIT(), (
+ GIT(), 'log', '--graph', '--oneline',
+ ));
+ if ($r != 0) {
+ print STDERR "Git log fail.\n";
+ exit 1;
+ }
+}