From: Martin von Zweigbergk Date: Wed, 17 Aug 2011 14:13:08 GMT Subject: Re: [PATCH] update-index: add --swap to swap index and worktree content Message-ID: In-Reply-To: <20110817021727.GA29585@sigill.intra.peff.net> Hi, On Tue, Aug 16, 2011 at 10:17 PM, Jeff King wrote: > On Wed, Aug 17, 2011 at 09:11:32AM +0700, Nguyen Thai Ngoc Duy wrote: > >> Two reasons. I already mentioned the ability to quickly checkout index >> for a quick test (though there could be more problems down that road). > > That's a good thought. However, in practice, I find I also need other > files from the index to do a successful test. So I end up just > committing what I think is right, and then afterwards do: Maybe a stupid question, but "update-index --swap" would swap all files, right? So what "other files from the index" would there be? Maybe the above shows that I'm missing something. Still, would it be possible to achieve the use case with something like the following? git stash --keep-index # fix up files, test etc. git add .... git commit git cherry-pick --strategy=theirs stash && git stash drop Martin