[PATCH v4 0/5] Re: {checkout,reset,stash} --patch
- From
- Nicolas Sebrecht <nicolas.s.dev@gmx.fr>
- Date
- Aug 9, 2009, 16:32 UTC
- Message-ID
- <20090809163233.GA12911@vidovic>
- In-Reply-To
- <200908091117.19167.trast@student.ethz.ch>
The 09/08/09, Thomas Rast wrote:
Show 12 quoted lines
> Jeff King wrote: > > > > Shouldn't the diff be reversed? That is, I think what users would like > > to see is "bring this hunk over from the index to the working tree". But > > we have the opposite (a hunk that is in the working tree that we would > > like to undo). > > Well, my thinking for the initial (restricted; you couldn't say 'git > checkout -p HEAD~14') version went something like this: 'reset -p' > should be the opposite of 'add -p', so it offers the same hunks with > the question "Reset?". Then 'checkout -p' should somehow follow suit, > but asked "Discard?" (IIRC I even had it in all caps).
I agree this approach is fine. That said, I admit I've been confused at the beginning. FMPOV, asking "Discard this hunk?" is a real improvement.
In the same way I'd change "Reset?" of 'git reset -p' to "Unstage?". Otherwise, the end-user don't know if the command will discard the hunk from the WT too.
Also, I'd expect to have 'git reset --hard -p' discarding hunks from both the index and the WT (which is not possible for now unless I missed something).
-- Nicolas Sebrecht