diff options
-rwxr-xr-x | bin/43add | 22 | ||||
-rwxr-xr-x | bin/43commit | 29 | ||||
-rwxr-xr-x | bin/4add | 19 | ||||
-rwxr-xr-x | bin/4commit | 26 | ||||
-rwxr-xr-x | bin/4diff | 13 |
5 files changed, 109 insertions, 0 deletions
diff --git a/bin/43add b/bin/43add new file mode 100755 index 000000000..90d593554 --- /dev/null +++ b/bin/43add @@ -0,0 +1,22 @@ +#!/usr/bin/perl + +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 + +system join('', + "git add @ARGV ; ", + "( for file in @ARGV; do ", + "cp -i \$file /home/$USER/freeside4/$prefix/`dirname \$file`;", + "cp -i \$file /home/$USER/freeside3/$prefix/`dirname \$file`;", + "done ) && ", + "cd /home/$USER/freeside4/$prefix/ && ", + "git add @ARGV; ", + "cd /home/$USER/freeside3/$prefix/ && ", + "git add @ARGV" +); + diff --git a/bin/43commit b/bin/43commit new file mode 100755 index 000000000..7e3155f92 --- /dev/null +++ b/bin/43commit @@ -0,0 +1,29 @@ +#!/usr/bin/perl + +# usage: 43commit '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 ) && ", + "( cd /home/$USER/freeside3/$prefix; git pull ) && ", + "git diff -u @ARGV | ( cd /home/$USER/freeside4/$prefix; patch -p1 ) ", + " && git diff -u @ARGV | ( cd /home/$USER/freeside3/$prefix; patch -p1 ) ", + " && ( ( git pull && git commit -m $desc @ARGV && git push); ", + "( cd /home/$USER/freeside4/$prefix; git commit -m $desc @ARGV && git push); ", + "( cd /home/$USER/freeside3/$prefix; git commit -m $desc @ARGV && git push) )" +); + diff --git a/bin/4add b/bin/4add new file mode 100755 index 000000000..bc3b5ca83 --- /dev/null +++ b/bin/4add @@ -0,0 +1,19 @@ +#!/usr/bin/perl + +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 + +system join('', + "git add @ARGV ; ", + "( for file in @ARGV; do ", + "cp -i \$file /home/$USER/freeside4/$prefix/`dirname \$file`;", + "done ) && ", + "cd /home/$USER/freeside4/$prefix/ && ", + "git add @ARGV" +); + 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 ) )" +); + diff --git a/bin/4diff b/bin/4diff new file mode 100755 index 000000000..468325da9 --- /dev/null +++ b/bin/4diff @@ -0,0 +1,13 @@ +#!/usr/bin/perl + +my $file = shift; + +chomp(my $dir = `pwd`); +$dir =~ s/freeside(\/?)/freeside4$1/; +warn $dir; + +#$cmd = "diff -u $file $dir/$file"; +$cmd = "diff -ubBw $dir/$file $file"; +print "$cmd\n"; +system($cmd); + |