Unified · Split
| @@ -16,17 +16,21 @@ fn usage { · 15 unmodified lines | |||
| 16 | exit usage | 16 | exit usage |
| 17 | } | 17 | } |
| 18 | 18 | ||
| 19 | remote='' | 19 | remote=() |
| 20 | sendall='' | 20 | sendall='' |
| 21 | remove=() | 21 | remove=() |
| 22 | upstream='origin' | 22 | upstream='origin' |
| 23 | branch=`{awk '$1=="branch"{print $2}' < /mnt/git/ctl} | 23 | branch=`{awk '$1=="branch"{print $2}' < /mnt/git/ctl} |
| 24 | while(~ $1 -* && ! ~ $1 --){ | 24 | while(~ $1 -* && ! ~ $1 --){ |
| 25 | echo branch | ||
| 26 | switch($1){ | 25 | switch($1){ |
| 27 | case -u; upstream=$1 | 26 | case -u; |
| 28 | case -a; sendall=true | 27 | shift |
| 29 | case -b; branch=$1 | 28 | upstream=$1 |
| 29 | case -a; | ||
| 30 | sendall=true | ||
| 31 | case -b; | ||
| 32 | shift | ||
| 33 | branch=$1 | ||
| 30 | case -r; | 34 | case -r; |
| 31 | shift | 35 | shift |
| 32 | remove=(-r$1 $remove); | 36 | remove=(-r$1 $remove); |
| @@ -34,10 +38,15 @@ while(~ $1 -* && ! ~ $1 --){ · 1 unmodified line | |||
| 34 | } | 38 | } |
| 35 | shift | 39 | shift |
| 36 | } | 40 | } |
| 37 | if(~ $remote '') | 41 | |
| 42 | if(~ $#remote 0) | ||
| 38 | remote=`{git/conf 'remote "'$upstream'".url'} | 43 | remote=`{git/conf 'remote "'$upstream'".url'} |
| 39 | if not | 44 | if(~ $#remote 0) |
| 40 | remote=$upstream | 45 | remote=$upstream |
| 46 | if(~ $#remote 0){ | ||
| 47 | echo 'no idea where to push' | ||
| 48 | exit upstream | ||
| 49 | } | ||
| 41 | if(~ $sendall '') | 50 | if(~ $sendall '') |
| 42 | git/send -b $branch $remove $remote | 51 | git/send -b $branch $remove $remote |
| 43 | if not | 52 | if not |