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
Kirill Likhodedov <kirill.likhodedov@gmail.com>
Date
Mar 21, 2013, 08:10 UTC
Message-ID
<813B5421-0876-40B3-8152-9DCA5D234FD7@gmail.com>
In-Reply-To
<vpqsj3qoyj2.fsf@grenoble-inp.fr>
On 20.03.2013, at 19:56, Matthieu Moy wrote:
> 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.
...
> Use git show --first-parent --name-status, it should do what you expect

Thanks a lot for clarifying that. It is actually mentioned in git help stash, but I've missed this. With "--first-parent" I get the expected result. Thanks for your help.

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

I think I've found the reason of this behavior. git help show mentiones that:

> It also presents the merge commit in a special
> format as produced by git diff-tree --cc.
And git help diff-tree says that --cc implies -c, while -c "lists only files which were modified from all parents".
-- Kirill.
Previous: Matthieu Moy
Message 3 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.