From: Björn Steinbrink Date: Thu, 26 Jun 2008 11:55:50 GMT Subject: Re: [PATCH] cmd_reset: don't trash uncommitted changes unless told to Message-ID: <20080626115550.GA23058@atjola.homenet> In-Reply-To: <7v63rx2zwf.fsf@gitster.siamese.dyndns.org> On 2008.06.25 10:22:08 -0700, Junio C Hamano wrote: > Theodore Tso writes: > > > I used to argue for this, but gave up, because no one seemed to agree > > with me. So now I just have the following in > > /home/tytso/bin/git-revert-file and I am very happy: > > > > #!/bin/sh > > # > > prefix=$(git rev-parse --show-prefix) > > > > for i in $* > > do > > git show HEAD:$prefix$i > $i > > done > > Isn't that this? > > #!/bin/sh > exec git checkout HEAD -- "$@" I thought so at first, too, but there's one difference. Ted's version doesn't affect the index, while yours does. Of course I cannot tell if Ted actually intended not to touch the index ;-) Björn