plan9fox/sys/src/cmd/git/revert

20 lines
338 B
Text
Raw Normal View History

#!/bin/rc
rfork en
. /sys/lib/git/common.rc
gitup
flagfmt='c:query query' args='file ...'
eval `''{aux/getflags $*} || exec aux/usage
commit=$gitfs/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 ''