Showing the changes to commit (1 of 6 files). Show all
Unified · Split
| @@ -2,6 +2,9 @@ · 1 unmodified line | |||
| 2 | 2 | ||
| 3 | rfork ne | 3 | rfork ne |
| 4 | 4 | ||
| 5 | nl=' | ||
| 6 | ' | ||
| 7 | |||
| 5 | fn whoami{ | 8 | fn whoami{ |
| 6 | name=`{git/conf user.name} | 9 | name=`{git/conf user.name} |
| 7 | email=`{git/conf user.email} | 10 | email=`{git/conf user.email} |
| @@ -36,14 +39,14 @@ fn findbranch{ · 28 unmodified lines | |||
| 36 | echo invalid branch $branch >[1=2] | 39 | echo invalid branch $branch >[1=2] |
| 37 | exit badbranch | 40 | exit badbranch |
| 38 | } | 41 | } |
| 39 | 42 | ||
| 40 | } | 43 | } |
| 41 | 44 | ||
| 42 | fn editmsg{ | 45 | fn editmsg{ |
| 43 | echo '' > $msgfile.tmp | 46 | echo '' > $msgfile.tmp |
| 44 | echo '# Commit message goes here.' >> $msgfile.tmp | 47 | echo '# Commit message goes here.' >> $msgfile.tmp |
| 45 | echo '# Author: '$name' <'$email'>' >> $msgfile.tmp | 48 | echo '# Author: '$name' <'$email'>' >> $msgfile.tmp |
| 46 | git/walk | grep -v '^T' | sed 's/^/# /g' >> $msgfile.tmp | 49 | echo '#' $nl'# ' ^ `$nl{git/walk -fADR} >> $msgfile.tmp |
| 47 | sam $msgfile.tmp | 50 | sam $msgfile.tmp |
| 48 | if(! test -s $msgfile.tmp || ~ `{wc -l <{grep -v '^[ ]*[\n#]' $msgfile.tmp}} 0){ | 51 | if(! test -s $msgfile.tmp || ~ `{wc -l <{grep -v '^[ ]*[\n#]' $msgfile.tmp}} 0){ |
| 49 | echo 'cancelling commit: empty message' >[1=2] | 52 | echo 'cancelling commit: empty message' >[1=2] |
| @@ -68,12 +71,21 @@ fn commit{ · 18 unmodified lines | |||
| 68 | hash=`{git/save -n $"name -e $"email -m $"msg $pflags} | 71 | hash=`{git/save -n $"name -e $"email -m $"msg $pflags} |
| 69 | st=$status | 72 | st=$status |
| 70 | if(~ $hash '') | 73 | if(~ $hash '') |
| 71 | exit $st | 74 | exit nocommit |
| 72 | } | 75 | } |
| 73 | 76 | ||
| 74 | fn update{ | 77 | fn update{ |
| 75 | mkdir -p `{basename -d $refpath} | 78 | mkdir -p `{basename -d $refpath} |
| 76 | echo $hash > $refpath | 79 | echo $hash > $refpath |
| 80 | for(f in `$nl{git/walk -cfAD}){ | ||
| 81 | mkdir -p `{basename -d $f} | ||
| 82 | walk -eq $f > .git/index9/tracked/$f | ||
| 83 | } | ||
| 84 | for(f in `$nl{git/walk -cfR}){ | ||
| 85 | rm -f .git/index9/tracked/$f | ||
| 86 | rm -f .git/index9/removed/$f | ||
| 87 | } | ||
| 88 | |||
| 77 | } | 89 | } |
| 78 | 90 | ||
| 79 | fn cleanup{ | 91 | fn cleanup{ |
| @@ -92,6 +104,8 @@ if(git/walk -q){ · 12 unmodified lines | |||
| 92 | exit clean | 104 | exit clean |
| 93 | } | 105 | } |
| 94 | @{ | 106 | @{ |
| 107 | flag e + | ||
| 108 | flag x + | ||
| 95 | whoami | 109 | whoami |
| 96 | findbranch | 110 | findbranch |
| 97 | parents | 111 | parents |
| @@ -101,7 +115,7 @@ if(git/walk -q){ · 3 unmodified lines | |||
| 101 | cleanup | 115 | cleanup |
| 102 | } | 116 | } |
| 103 | st=$status | 117 | st=$status |
| 104 | if not{ | 118 | if(! ~ $status ''){ |
| 105 | echo 'could not commit:' $st >[1=2] | 119 | echo 'could not commit:' $st >[1=2] |
| 106 | exit $st | 120 | exit $st |
| 107 | } | 121 | } |