ref: c2ea4015be2695c2115594e301e725dd9cdb0c32
parent: 24677b0d857051fc2a952c1dbceaeefa540d89d6
author: kvik <kvik@a-b.xyz>
date: Wed Apr 8 17:09:39 EDT 2020
Tidy up some bits and pieces
--- a/branch
+++ b/branch
@@ -10,11 +10,6 @@
-s create branch but stay on current one
'
-
-fn resolvebranch {
-
-}
-
gitup
stay=()
@@ -35,7 +30,6 @@
}
shift
}
-
if(~ $1 --)
shift
--- a/clone
+++ b/clone
@@ -26,9 +26,11 @@
cd $local
dircp /sys/lib/git/template .git
- echo '[remote "origin"]' >> .git/config
- echo ' url='$remote >> .git/config
- echo ' fetch=+refs/heads/*:refs/remotes/origin/*' >> .git/config
+ >>.git/config {
+ echo '[remote "origin"]'
+ echo ' url='$remote
+ echo ' fetch=+refs/heads/*:refs/remotes/origin/*'
+ }
{git/fetch $remote >[2=3] | awk '
/^remote/{
if($2=="HEAD"){
--- a/commit
+++ b/commit
@@ -22,7 +22,7 @@
}
fn findbranch{
- branch=`{awk '$1=="branch"{print $2}' < /mnt/git/ctl}
+ branch=`{git/branch}
if(test -e /mnt/git/branch/$branch/tree){
refpath=.git/refs/$branch
initial=false
--- a/import
+++ b/import
@@ -17,7 +17,7 @@
name=''
msg=''
parents='-p'^`{git/query HEAD}
- branch=`{awk '$1=="branch"{print $2}' < /mnt/git/ctl}
+ branch=`{git/branch}
if(test -e /mnt/git/branch/$branch/tree)
refpath=.git/refs/$branch
if not if(test -e /mnt/git/object/$branch/tree)
--- a/init
+++ b/init
@@ -37,12 +37,14 @@
mkdir -p $dir$sub
dircp /sys/lib/git/template $dir/$sub
-if(! ~ $#upstream 0){
- echo '[remote "origin"]' >> $dir/$sub/config
- echo ' url='$upstream >> $dir/$sub/config
-}
-echo '[branch "master"]' >> $dir/$sub/config
-echo ' remote = origin' >> $dir/$sub/config
-echo ' merge = refs/heads/master' >> $dir/$sub/config
mkdir -p $dir/$sub/refs/heads
mkdir -p $dir/$sub/refs/remotes
+>>$dir/$sub/config {
+ if(! ~ $#upstream 0){
+ echo '[remote "origin"]'
+ echo ' url='$upstream
+ }
+ echo '[branch "master"]'
+ echo ' remote = origin'
+ echo ' merge = refs/heads/master'
+}
--- a/push
+++ b/push
@@ -17,7 +17,7 @@
remove=()
force=()
upstream='origin'
-branch=-b`{awk '$1=="branch"{print $2}' < /mnt/git/ctl}
+branch=-b`{git/branch}
while(~ $1 -*){
switch($1){
case -u