Re: [PATCH v4 0/5] {checkout,reset,stash} --patch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jul 28, 2009 at 11:20:06PM +0200, Thomas Rast wrote:

> Thomas Rast (6):
>   git-apply--interactive: Refactor patch mode code
>   builtin-add: refactor the meat of interactive_add()
>   Implement 'git reset --patch'
>   Implement 'git checkout --patch'
>   Implement 'git stash save --patch'
>   DWIM 'git stash save -p' for 'git stash -p'

I finally got a few minutes to look at this. I tried "checkout --patch"
first, which was very confusing:

  $ echo old content >file && git add file && git commit -m old
  $ echo new content >>file
  $ git checkout --patch file
  diff --git a/file b/file
  index 33194a0..805c3b0 100644
  --- a/file
  +++ b/file
  @@ -1 +1,2 @@
   old content
   +new content
  Check out this hunk [y,n,q,a,d,/,e,?]?

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).

Maybe it is just the use of the verb "check out". I think of it as
bringing _this_ hunk out. But it is really about erasing this hunk. "git
reset --patch" has the same behavior, but I don't find it as bothersome,
since it says "Reset this hunk".

And "stash --patch" doesn't have the issue because it goes from the
working tree to the stash already.

-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]