updated git and svn scripts
[xrzperl.git] / gsvn-commit
blobc4738d004efb0973def8ec8cef0ee363a18e9089
1 #!/usr/bin/perl -w
2 # $Id$
3 use strict;
4 require v5.10.0;
5 our $VERSION = 'v0.1';
7 my $idx = 1;
8 my $total = 2;
10 print "[$idx/$total] git commit ", (@ARGV ? join(" ",@ARGV) : ""), "\n";
11 my $NEED_COMMIT = `git diff`;
12 chomp($NEED_COMMIT);
13 if($NEED_COMMIT) {
14 if (system(qw/git commit/,@ARGV) != 0) {
15 die "[$idx/$total] git commit failed\n";
18 else {
19 system(qw/git commit/,@ARGV);
21 $idx++;
22 print "[$idx/$total] git svn dcommit\n";
23 if(system(qw/git svn dcommit/) != 0) {
24 die "[$idx/$total] git svn dcommit failed\n";
26 exit 0;
29 __END__
31 =pod
33 =head1 NAME
35 git-svn-commit - PERL script
37 =head1 SYNOPSIS
39 git-svn-commit [options] ...
41 =head1 OPTIONS
43 =over 12
45 =item B<--version>
47 Print version infomation.
49 =item B<-h>,B<--help>
51 Print a brief help message and exits.
53 =item B<--manual>,B<--man>
55 View application manual
57 =item B<--edit-me>
59 Invoke 'editor' against the source
61 =back
63 =head1 DESCRIPTION
65 ___DESC___
67 =head1 CHANGELOG
69 2010-10-31 xiaoranzzz <xiaoranzzz@myplace.hell>
71 * file created.
73 =head1 AUTHOR
75 xiaoranzzz <xiaoranzzz@myplace.hell>
77 =cut
79 # vim:filetype=perl