diff options
Diffstat (limited to 'bin/4commit')
-rwxr-xr-x | bin/4commit | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/bin/4commit b/bin/4commit new file mode 100755 index 000000000..aea15ec77 --- /dev/null +++ b/bin/4commit @@ -0,0 +1,26 @@ +#!/usr/bin/perl + +# usage: 4commit 'log message' filename filename ... + +use Cwd; +use String::ShellQuote; + +my $USER = $ENV{USER}; + +my $dir = getcwd; +( my $prefix = $dir ) =~ s(^/home/$USER/freeside/?)() or die $dir; #eventually from anywhere + +my $desc = shell_quote(shift @ARGV); # -m + +die "no files!" unless @ARGV; + +#warn "$prefix"; + +#print <<END; +system join('', + "( cd /home/$USER/freeside4/$prefix; git pull ) && ", + "git diff -u @ARGV | ( cd /home/$USER/freeside4/$prefix; patch -p1 ) ", + " && ( ( git pull && git commit -m $desc @ARGV && git push ); ", + "( cd /home/$USER/freeside4/$prefix; git commit -m $desc @ARGV && git push ) )" +); + |