git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git show stash

From
しらいしななこ <nanako3@bluebottle.com>
Date
Dec 12, 2007, 08:02 UTC
Message-ID
<200712120802.lBC82YDQ008276@mi1.bluebottle.com>
In-Reply-To
<20071212073728.GA12058@glandium.org>
Quoting Mike Hommey <mh@glandium.org>:
Show 9 quoted lines
> 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
Previous: Mike Hommey
Message 3 of 3 in “git show stash”
  1. Mike HommeyDec 12, 2007
  2. Mike HommeyDec 12, 2007
  3. しらいしななこDec 12, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.