From: Thomas Rast Date: Sat, 25 Jul 2009 09:35:31 GMT Subject: Re: [PATCH] git-add -p: be able to undo a given hunk Message-ID: <200907251135.33164.trast@student.ethz.ch> In-Reply-To: <7v1vo537m0.fsf@alter.siamese.dyndns.org> Junio C Hamano wrote: > > 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' saved their state, but 'git checkout -- $file' didn't, even though they should be equivalent. -- Thomas Rast trast@{inf,student}.ethz.ch