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

Re: Bug? git show behaves incorrectly when called on a stash object

From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
Mar 20, 2013, 15:56 UTC
Message-ID
<vpqsj3qoyj2.fsf@grenoble-inp.fr>
In-Reply-To
<AF060B6D-27F7-45BE-9BC3-85FAF3487481@gmail.com>
Kirill Likhodedov <kirill.likhodedov@gmail.com> writes:
> The first gives the correct result, while the second doesn't show the addition.
> Is it a bug, or I'm just missing something?

stash objects are commits with 2 parents (ie. merge commits). One commit is the HEAD you stashed from, and the other is the saved state of the index. I'm not sure from the doc what the semantics of --name-status is for merge commits, but it seems it shows only files modified in both parents.

Use git show --first-parent --name-status, it should do what you expect (or -m instead of --first-parent).

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Previous: Kirill LikhodedovNext: Kirill Likhodedov
Message 2 of 3 in “Bug? git show behaves incorrectly when called on a stash object”
  1. Kirill LikhodedovMar 20, 2013
  2. Matthieu MoyMar 20, 2013
  3. Kirill LikhodedovMar 21, 2013

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.