History

Tweaks to git/walk, git/commit, delete git/checkout

Ori Bernstein committed 7 years ago

Commit 0fa9fa71 parent a7602ec6 files · +47 −51Browse files

Showing the changes to commit (1 of 6 files). Show all

Unified · Split

commit+18−4
@@ -2,6 +2,9 @@ · 1 unmodified line
22
33 rfork ne
44
5+nl='
6+'
7+
58 fn whoami{
69 name=`{git/conf user.name}
710 email=`{git/conf user.email}
@@ -36,14 +39,14 @@ fn findbranch{ · 28 unmodified lines
3639 echo invalid branch $branch >[1=2]
3740 exit badbranch
3841 }
39−
42+
4043 }
4144
4245 fn editmsg{
4346 echo '' > $msgfile.tmp
4447 echo '# Commit message goes here.' >> $msgfile.tmp
4548 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
4750 sam $msgfile.tmp
4851 if(! test -s $msgfile.tmp || ~ `{wc -l <{grep -v '^[ ]*[\n#]' $msgfile.tmp}} 0){
4952 echo 'cancelling commit: empty message' >[1=2]
@@ -68,12 +71,21 @@ fn commit{ · 18 unmodified lines
6871 hash=`{git/save -n $"name -e $"email -m $"msg $pflags}
6972 st=$status
7073 if(~ $hash '')
71− exit $st
74+ exit nocommit
7275 }
7376
7477 fn update{
7578 mkdir -p `{basename -d $refpath}
7679 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+
7789 }
7890
7991 fn cleanup{
@@ -92,6 +104,8 @@ if(git/walk -q){ · 12 unmodified lines
92104 exit clean
93105 }
94106 @{
107+ flag e +
108+ flag x +
95109 whoami
96110 findbranch
97111 parents
@@ -101,7 +115,7 @@ if(git/walk -q){ · 3 unmodified lines
101115 cleanup
102116 }
103117 st=$status
104−if not{
118+if(! ~ $status ''){
105119 echo 'could not commit:' $st >[1=2]
106120 exit $st
107121 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t