Re: [PATCH] cmd_reset: don't trash uncommitted changes unless told to

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2008.06.26 13:07:40 +0100, Johannes Schindelin wrote:
> On Thu, 26 Jun 2008, Björn Steinbrink wrote:
> 
> > On 2008.06.25 10:22:08 -0700, Junio C Hamano wrote:
> > > Theodore Tso <tytso@xxxxxxx> 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 ;-)
> 
> While we are nit-picking: Ted's version does not respect autocrlf, while 
> Junio's does.
> 
> Oh, and Junio's version works with spaces and other funny stuff in file 
> names, while Ted's does not.
> 
> Oh, and error checking is correct in Junio's version.
> 
> I am sure there are more differences.

I didn't intend to nit-pick, sorry if it looked like that. Not touching
the index might have been a conscious decision, but obviously I must
have missed some email that made it clear that it was intended to also
revert the index entry. Very sorry...

Thanks for the information on autocrlf though, didn't know that show
doesn't care about that.

Björn
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux