git: 9front

Download patch

ref: ed46b91adca518163561728716e803016d6d519d
parent: 62aaf5a789f5c33fda1995bac94bba3d8ffd3d07
author: Ori Bernstein <ori@eigenstate.org>
date: Sat Feb 26 23:27:56 EST 2022

git/revert: update modification time on revert

when reverting files, 'cp -x' updates the mtime
to the time the file was committed. this prevents
'mk' from rebuilding the file, leading to stale
builds.

this change touches the file on revert, so that
we rebuild the file.

--- a/sys/src/cmd/git/revert
+++ b/sys/src/cmd/git/revert
@@ -16,6 +16,7 @@
 for(f in `$nl{cd $commit/tree/ && walk -f ./$files}){
 	mkdir -p `{basename -d $f}
 	cp -x -- $commit/tree/$f $f
+	touch $f
 	git/add $f
 }
 exit ''
--