From: Avery Pennarun Date: Mon, 26 Oct 2009 22:01:29 GMT Subject: Re: [PATCH 3/3] git checkout --nodwim Message-ID: <32541b130910261501n32046cc5s12283a8e3981d04e@mail.gmail.com> In-Reply-To: <20091026212628.GC27744@sigio.peff.net> On Mon, Oct 26, 2009 at 5:26 PM, Jeff King wrote: > On Mon, Oct 26, 2009 at 04:40:41PM -0400, Avery Pennarun wrote: >> I don't think there's actually a plumbing alternative to git-checkout, >> however.  My git-subtree script (and another script at work) have >> already had some bugs because of this (specifically, the differing >> behaviour of git-checkout with and without a path specified).  Is >> there something else I should be using in my scripts to be maximally >> safe? > > It's git-update-ref. That would be similar to git commit, not git checkout, right? Oh wait, I see the confusion: git checkout does two things. It switches branches, and it checks out files from the index into the work tree. I meant the latter meaning. > Consider "git commit", for example. Does anyone > actually script around "write-tree" and "commit-tree" these days, or do > they just script around "git commit"? Oh, I use those all the time. They're awesome! It allows you to create commits without having a working tree, which lets me do very interesting tricks. git-subtree uses this heavily. I'm probably a weirdo, though. Have fun, Avery