On Thu, Aug 13, 2009 at 02:29:38PM +0200, Thomas Rast wrote:
Thanks for following up on this. This is something I've wanted for a
while, and now my procrastination is paying off. ;)
Makes sense.
Actually, it says "Unstage this hunk", but I like that even better.
This doesn't make sense to me. For example:
$ git show HEAD^:file
content
$ git show :file
content
with some changes
$ git reset -p HEAD^
diff --git a/file b/file
index d95f3ad..60a1a4e 100644
--- a/file
+++ b/file
@@ -1 +1,2 @@
content
+with some changes
Apply this hunk to index [y,n,q,a,d,/,e,?]?
The hunk is _already_ in the index. You are really asking to remove it
from the index. So shouldn't it say something like "Unstage this hunk"
or "Remove this hunk from the index"?
Or did you intend to reverse the diff, as with "checkout -p" below?
Good, that addresses my earlier confusion.
Good. I like how it clarifies what is being touched.
I really expected this to just be the same as the "HEAD" case. That is,
with "git checkout -p HEAD", you are saying "I'm not interested in these
bits, discard to return back to HEAD". So if I do "git checkout -p
HEAD^", that is conceptually the same thing, except going back further
in time.
But I guess you are thinking of it as "pull these changes out of
'other'", in which case showing the reverse diff makes sense.
I think this may be a situation where the user has one of two mental
models in issuing the command, and we don't necessarily know which. So I
guess what you have is fine, but I wanted to register my surprise.
Getting greedy, is there a reason not to have "stash apply -p" as well?
-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html