{"thread":{"id":"33240","subject":"Bug? git show behaves incorrectly when called on a stash object","startedAt":"2013-03-20T15:08:58Z","lastAt":"2013-03-21T08:10:34Z","messageCount":3,"participants":["Kirill Likhodedov","Matthieu Moy"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"211758","messageId":"AF060B6D-27F7-45BE-9BC3-85FAF3487481@gmail.com","threadId":"33240","inReplyTo":null,"subject":"Bug? git show behaves incorrectly when called on a stash object","fromName":"Kirill Likhodedov","fromEmail":"kirill.likhodedov@gmail.com","sentAt":"2013-03-20T15:08:58Z","receivedAt":"2013-03-20T15:08:58Z","isPatch":false,"sender":{"key":"kirill.likhodedov@gmail.com","avatar":"https://gravatar.com/avatar/2b7db7c43bdd506a2045f8d0aa738c4cee6dcaaac813b76615e5224305a7e4d2?d=mp&s=160"},"body":"Hi,\n\nI experience difference in behavior between `git stash show stash@{0}` and `git show stash@{0}`:\n\n-----------------------------------------------------\n\n# git stash show --name-status stash@{0}\nA       a\nM       conflict.js\n# git show --name-status stash@{0}\ncommit 05aa170746dc4e060f10710a92aed4592276f2d4\nMerge: 737f544 7c2160f\nAuthor: Kirill Likhodedov <Kirill.Likhodedov@gmail.com>\nDate:   Wed Mar 20 18:56:28 2013 +0400\n\n   WIP on master: 737f544 master\n\nMM      conflict.js\n\n-----------------------------------------------------\n\nThe first gives the correct result, while the second doesn't show the addition.\nIs it a bug, or I'm just missing something?\n\nThanks a lot!\nKirill."},{"id":"211761","messageId":"vpqsj3qoyj2.fsf@grenoble-inp.fr","threadId":"33240","inReplyTo":"AF060B6D-27F7-45BE-9BC3-85FAF3487481@gmail.com","subject":"Re: Bug? git show behaves incorrectly when called on a stash object","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2013-03-20T15:56:33Z","receivedAt":"2013-03-20T15:56:33Z","isPatch":false,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Kirill Likhodedov <kirill.likhodedov@gmail.com> writes:\n\n> The first gives the correct result, while the second doesn't show the addition.\n> Is it a bug, or I'm just missing something?\n\nstash objects are commits with 2 parents (ie. merge commits). One commit\nis the HEAD you stashed from, and the other is the saved state of the\nindex. I'm not sure from the doc what the semantics of --name-status is\nfor merge commits, but it seems it shows only files modified in both\nparents.\n\nUse git show --first-parent --name-status, it should do what you expect\n(or -m instead of --first-parent).\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"211843","messageId":"813B5421-0876-40B3-8152-9DCA5D234FD7@gmail.com","threadId":"33240","inReplyTo":"vpqsj3qoyj2.fsf@grenoble-inp.fr","subject":"Re: Bug? git show behaves incorrectly when called on a stash object","fromName":"Kirill Likhodedov","fromEmail":"kirill.likhodedov@gmail.com","sentAt":"2013-03-21T08:10:34Z","receivedAt":"2013-03-21T08:10:34Z","isPatch":false,"sender":{"key":"kirill.likhodedov@gmail.com","avatar":"https://gravatar.com/avatar/2b7db7c43bdd506a2045f8d0aa738c4cee6dcaaac813b76615e5224305a7e4d2?d=mp&s=160"},"body":"\nOn 20.03.2013, at 19:56, Matthieu Moy wrote:\n\n> stash objects are commits with 2 parents (ie. merge commits). One commit\n> is the HEAD you stashed from, and the other is the saved state of the\n> index.\n...\n> Use git show --first-parent --name-status, it should do what you expect\n\nThanks a lot for clarifying that. It is actually mentioned in git help stash, but I've missed this.\nWith \"--first-parent\" I get the expected result. Thanks for your help.\n\n> I'm not sure from the doc what the semantics of --name-status is\n> for merge commits, but it seems it shows only files modified in both\n> parents.\n\nI think I've found the reason of this behavior.\ngit help show mentiones that:\n> It also presents the merge commit in a special\n> format as produced by git diff-tree --cc.\nAnd git help diff-tree says that --cc implies -c, while -c \"lists only files which were modified from all parents\".\n\n-- Kirill.\n"}]}