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