use constant ZBARIMG => 'zbarimg';
use constant CONVERT => 'convert';
use constant CROP => '56x57+194+81';
+use constant GIT_REMOTE => 'http://bicyclesonthemoon.info/git/cresnov/imagimoth-family-tree';
use constant ATTACHMENT_URL_BASE => 'https://cresnov.com/attachments/';
use constant TREE_PATH => '/home/b/cresnov/imagimoth/tree/';
use constant TREE_MOTH_PATH => '/home/b/cresnov/imagimoth/tree/moth.png';
goto_branch($parent_a);
}
-
+elsif ($action eq 'pushout') {
+ goto_tree();
+ push_out();
+}
else {
print STDERR "Invalid action: $action.\n";
exit 1;
}
my $r = system_encoded(GIT(), (
GIT(), 'merge',
- '--no-commit', '--allow-unrelated-histories', # '--no-verify',
+ '--no-commit', '--allow-unrelated-histories', '--no-ff', # '--no-verify',
'-s', 'ours', # hack
'-m', $text,
$name,
print STDERR "Copy QR fail.\n";
exit 1;
}
- my $r = my $r = system_encoded(GIT(), (
+ my $r = system_encoded(GIT(), (
GIT(), 'add', '.'
));
if ($r != 0) {
sub commit {
(my $text) = @_;
- my $r = my $r = system_encoded(GIT(), (
+ my $r = system_encoded(GIT(), (
GIT(), 'commit', '--allow-empty-message', '-m', $text
));
if ($r != 0) {
exit 1;
}
}
+
+sub push_out {
+ my $r;
+
+ $r = system_encoded(GIT(), (
+ GIT(), 'remote', 'add', 'origin', GIT_REMOTE()
+ ));
+ if ($r != 0) {
+ print STDERR "Git remote add fail.\n";
+ exit 1;
+ }
+
+ $r = system_encoded(GIT(), (
+ GIT(), 'push', '--all', '--force'
+ ));
+ if ($r != 0) {
+ print STDERR "Git push fail.\n";
+ exit 1;
+ }
+
+ $r = system_encoded(GIT(), (
+ GIT(), 'remote', 'remove', 'origin'
+ ));
+ if ($r != 0) {
+ print STDERR "Git remote remove fail.\n";
+ exit 1;
+ }
+}
\ No newline at end of file