Re: [PATCH] git-add -p: be able to undo a given hunk
- From
Thomas Rast <trast@student.ethz.ch>
- Date
- Jul 25, 2009, 09:35 UTC
- Message-ID
- <200907251135.33164.trast@student.ethz.ch>
- In-Reply-To
- <7v1vo537m0.fsf@alter.siamese.dyndns.org>
Junio C Hamano wrote:
Show 7 quoted lines
> > Yeah, such a stash entry would be more like "trash can". It is not > "to-be-deleted" but "have been deleted, but you _could_ resurrect". > > It may not be a bad idea to do it that way, or perhaps "git checkout -p" > can automatically create such a trash can while undoing the local changes > in the work tree.
I'd rather implement this as part of the generic "worktree/index log" that was proposed a while back, where any index- or worktree-overwriting operation that actually discards data would save the lost state in a special reflog. That way people won't complain because 'git checkout -p -- $file' <press a> saved their state, but 'git checkout -- $file' didn't, even though they should be equivalent.
--
Thomas Rast
trast@{inf,student}.ethz.ch