Git: git9

git9 @ ca837be27a257b8dff9df887fe751f46136c17d3

#!/bin/rc
rfork e
. /sys/lib/git/common.rc

gitup

flagfmt='c:query query' args='file ...'
eval `''{aux/getflags $*} || exec aux/usage

commit=/mnt/git/HEAD
if(~ $#query 1)
	commit=`{git/query -p $query}

for(f in `$nl{cd $commit/tree/ && walk -f ./$gitrel/$*}){
	mkdir -p `{basename -d $f}
	cp -- $commit/tree/$f $f
	git/add $f
}
exit ''