git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git show stash
@ 2007-12-12  7:28 Mike Hommey
  2007-12-12  7:37 ` Mike Hommey
  0 siblings, 1 reply; 3+ messages in thread
From: Mike Hommey @ 2007-12-12  7:28 UTC (permalink / raw)
  To: git

Hi,

Is there a particular reason why git show stash displays 2 signs at the
beginning of changed lines, contrary to git show anyotherref that shows
only one ? (the diff header is also different)

Mike

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: git show stash
  2007-12-12  7:28 git show stash Mike Hommey
@ 2007-12-12  7:37 ` Mike Hommey
  2007-12-12  8:02   ` しらいしななこ
  0 siblings, 1 reply; 3+ messages in thread
From: Mike Hommey @ 2007-12-12  7:37 UTC (permalink / raw)
  To: git

On Wed, Dec 12, 2007 at 08:28:36AM +0100, Mike Hommey wrote:
> Hi,
> 
> Is there a particular reason why git show stash displays 2 signs at the
> beginning of changed lines, contrary to git show anyotherref that shows
> only one ? (the diff header is also different)

I got a hint by opening my eyes: the stash is a merge commit (why is
that so, by the way ?).

Mike

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: git show stash
  2007-12-12  7:37 ` Mike Hommey
@ 2007-12-12  8:02   ` しらいしななこ
  0 siblings, 0 replies; 3+ messages in thread
From: しらいしななこ @ 2007-12-12  8:02 UTC (permalink / raw)
  To: Mike Hommey; +Cc: git

Quoting Mike Hommey <mh@glandium.org>:

> On Wed, Dec 12, 2007 at 08:28:36AM +0100, Mike Hommey wrote:
>> Hi,
>> 
>> Is there a particular reason why git show stash displays 2 signs at the
>> beginning of changed lines, contrary to git show anyotherref that shows
>> only one ? (the diff header is also different)
>
> I got a hint by opening my eyes: the stash is a merge commit (why is
> that so, by the way ?).

Because it needs to record changes between your HEAD and your index, and changes between your HEAD and your working files.

              .-----STASH
             /     /
        HEAD ---INDEX

A stash is a merge between your HEAD (first parent) and a commit that records your index state (second parent).  The latter commit is a child of your HEAD.  If you never run "git add" and always commit with "git commit -a", it is most likely that "git stash show -p" will show two plus signs or minus signs and nothing else, but if you use "git add" to add your changes incrementally to your index you will see the difference.

-- 
Nanako Shiraishi
http://ivory.ap.teacup.com/nanako3/

----------------------------------------------------------------------
Get a free email address with REAL anti-spam protection.
http://www.bluebottle.com/tag/1

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-12-12  8:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-12  7:28 git show stash Mike Hommey
2007-12-12  7:37 ` Mike Hommey
2007-12-12  8:02   ` しらいしななこ

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).