shithub: riscv

ref: 3858b49942afb68d29e1ad02e6210bc5aba84c6e
dir: /sys/src/cmd/git/revert/

View raw version
#!/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 ''