From: Björn Steinbrink Date: Tue, 09 Jun 2009 21:18:06 GMT Subject: Re: EasyGit Integration Message-ID: <20090609211806.GC13781@atjola.homenet> In-Reply-To: <51419b2c0906091340i11965efcr5cf5bb4a71108fa6@mail.gmail.com> On 2009.06.09 14:40:33 -0600, Elijah Newren wrote: > Hi, > > 2009/6/9 Björn Steinbrink : > > On 2009.06.09 11:59:08 -0700, Scott Chacon wrote: > >> * breaks the various things that 'checkout' does into separate > >> commands - moves 'revert' to doing what 'checkout -- path' does > > > > Looking through the "eg revert" docs [1], I can't seem to find how you can > > do "checkout -- path" with it at all. "eg revert foo" seems to be "git > > checkout HEAD -- foo". > > If you want to revert only the unstaged changes to path: > "checkout -- path" OR "revert --unstaged path" > If you want to revert both staged and unstaged changes to foo: > "checkout HEAD -- foo" OR "revert foo" OK, so --unstaged doesn't just select the destination, but also the source, unless you explicitly override it, right? eg revert [--since HEAD] path ==> source: HEAD, destination: working tree, index eg revert --unstaged path ==> source: index, destination: working tree eg revert --unstaged --since HEAD path ==> source: HEAD, destination: working tree > > > The "eg revert" looks really confusing to me. > > "eg revert --unstaged --in HEAD~8". Hu? Revert unstaged changes in > > HEAD~8? Am I missing something? > > Hmm. Bad ordering, I guess -- it's revert changes in HEAD~8 to the > working copy only (by default, revert tries to apply changes to both > the working copy and the index). Yeah, it doesn't read very well. > > I'm not sure I like having "--in" as part of revert, partially because > of this confusion (and partially because I don't think it's > implementation is correct anyway). However, I do occasionally really > like being able to revert the change _to a single file_ made in some > previous commit, so I haven't removed it from eg (yet?). *shrug* I'm not sure that "--in" is the worst thing here. To me, --unstaged is worse, because I apply the attribute "unstaged" to the changes to be reverted. And that makes no sense when I supply a commit, a commit cannot have unstaged changes. I guess that if --unstaged wasn't used to select the destination, I might have come up with "eg revert --unstaged" myself, just from seeing the options. But seeing that --unstaged can be used with a commit confused me. Björn