From: Linus Torvalds Date: Sun, 24 Apr 2005 17:35:40 GMT Subject: Re: [PATCH] make git-prune-script actually work Message-ID: In-Reply-To: <1114351135.4997.18.camel@mulgrave> On Sun, 24 Apr 2005, James Bottomley wrote: > > I find this script very useful to get back to where I started from after > test merges, and also for cloning trees from a non-current base. The > functionality is altered so it now takes an optional commit argument > (and a -q flag to make it be quiet). Hmm.. You should probably rename it to "git-reset-script" or something, and any time you reset the head, you should also amke sure to reset the index, because otherwise your index file may actually be referencing objects that no longer even exist, and that's going to be very very painful. So > +echo $head > .git/HEAD should probably be followed by read-tree -m $head update-cache --refresh which will also tell the user what files he has that are now "dirty" (and he can decide whether he wants to commit his changes, or whether he wants to do a "checkout-cache -f -a" to just get rid of it all). Linus