Re: An alternate model for preparing partial commits
- From
Jeff King <peff@peff.net>
- Date
- Jun 28, 2008, 08:53 UTC
- Message-ID
- <20080628085359.GA29619@sigill.intra.peff.net>
- In-Reply-To
- <9af502e50806280003p59d00444hd1914a28a3a71d7e@mail.gmail.com>
On Sat, Jun 28, 2008 at 12:03:54AM -0700, Robert Anderson wrote:
Show 7 quoted lines
> > Here's a somewhat hackish implementation of "git stash -i" that just relies > > on "add -i": > > Are all features for moving changes to stash bi-directional in your > implementation? Can we move a hunk out of stash, just as easily as we > can move one in? I think this is an essential property of a good > implementation of this workflow.
No, they're not bi-directional. You get the full power of "add -i" when moving things into the stash, but not out. It is the reverse of the situation with the index; we have good tools for staging things, but not for unstaging them.
But I agree that they _should_ be. Given the patch I posted already, probably the simplest way to do both at once would be to give "add -i" an "unstage" mode.
> It does seem to me at this point that extending stash functionality is > a reasonable way to approach supporting this type of workflow.
Actually, I oversimplified a little bit in my "buckets" description. Stash actually stashes two things: the current index and the current worktree. So in that sense, it is not just another bucket as I described. For the purposes of the workflow we're discussing, I think that is how we want it to function. But the implementation will be a bit trickier than it might otherwise be because of this. I just didn't want to have to introduce another, slightly different type of stash.
-Peff