From: Neal Kreitzinger Date: Wed, 29 Feb 2012 19:34:25 GMT Subject: Re: Stash during incomplete merge Message-ID: <4F4E7DC1.1050700@gmail.com> In-Reply-To: <4F4D5408.3060505@gmail.com> On 2/28/2012 4:24 PM, Neal Kreitzinger wrote: > On 2/28/2012 2:22 PM, Neal Kreitzinger wrote: >> >> You may also want to consider the --keep-index option on your "git >> stash save" if your "testing" workflow doesn't involve adds or >> commits before the git stash apply/pop. >> > the very limited case I had in mind (and probably incorrect > assumption) about your "testing" workflow was: > > hack merge-conflicts $ git add conflict-resolution > (conflict-resolution is in worktree and index) hack > conflict-resolution with extra stuff (original conflict-resolution > is still in index) uh-oh, i got carried away and started doing extra > stuff (evil merge) and forgot to finish testing just the > conflict-resolutions (pure merge-commit) $ git stash --keep-index > (conflict-resolution is still in index and now back in wokrtree) > finish testing just the conflict-resolutions (merge-commit-to-be) > (conflict resolutions worked (I knew they would)) $ git stash pop > (original conflict resolution is still in index, but extra-stuff is > back in worktree) $ git commit (commit the > conflict-resolutions/merge-commit) $ git add foo $ git commit (new > foo stuff committed after merge commit) > This imaginary scenario I proposed for --keep-index can get a merge-conflict on the pop so its invalid. Please disregard it. Sorry for the bum scoop. v/r, neal