{"thread":{"id":"53257","subject":"[docs] git stash show also accepts -p|--patch option","startedAt":"2020-04-20T07:34:12Z","lastAt":"2020-04-20T16:19:43Z","messageCount":2,"participants":["Elijah Lynn","Martin Ågren"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"395730","messageId":"CAJ9KuXwmk377rEPVrwwpWmwzyO8N20OZUkUTBRoQoo3OuVYbGw@mail.gmail.com","threadId":"53257","inReplyTo":null,"subject":"[docs] git stash show also accepts -p|--patch option","fromName":"Elijah Lynn","fromEmail":"elijah@elijahlynn.net","sentAt":"2020-04-20T07:33:51Z","receivedAt":"2020-04-20T07:34:12Z","isPatch":false,"sender":{"key":"elijah@elijahlynn.net","avatar":null},"body":"Was reading `git help stash`and noticed the --patch option says:\n\n> This option is only valid for `push` and `save` commands.\n\nBut this isn't true, the `git stash show` command also accepts the\n--patch command and is very useful as it shows the diff of the stash\nwhereas without --patch it just shows the filenames that changed. I\nsee this text in master too\nhttps://github.com/git/git/blob/master/Documentation/git-stash.txt.\n\nI can gladly submit a patch if this will be acceptable to update the\ndocs to state that -p|--patch is applicable to the `show` command as\nwell.\n\nElijah Lynn\nwww.elijahlynn.net\n"},{"id":"395745","messageId":"CAN0heSpO3bsi9dc2p1W_DJf1i2kH+Y8XjGo2bvqLkYTPSsfxWw@mail.gmail.com","threadId":"53257","inReplyTo":"CAJ9KuXwmk377rEPVrwwpWmwzyO8N20OZUkUTBRoQoo3OuVYbGw@mail.gmail.com","subject":"Re: [docs] git stash show also accepts -p|--patch option","fromName":"Martin Ågren","fromEmail":"martin.agren@gmail.com","sentAt":"2020-04-20T16:19:29Z","receivedAt":"2020-04-20T16:19:43Z","isPatch":false,"sender":{"key":"martin.agren@gmail.com","avatar":null},"body":"Hi Elijah,\n\nWelcome to the list. :-)\n\nOn Mon, 20 Apr 2020 at 09:36, Elijah Lynn <elijah@elijahlynn.net> wrote:\n>\n> Was reading `git help stash`and noticed the --patch option says:\n>\n> > This option is only valid for `push` and `save` commands.\n>\n> But this isn't true, the `git stash show` command also accepts the\n> --patch command and is very useful as it shows the diff of the stash\n> whereas without --patch it just shows the filenames that changed. I\n> see this text in master too\n> https://github.com/git/git/blob/master/Documentation/git-stash.txt.\n\nInteresting!\n\nThere are two *different* \"--patch\" involved here. One is used to\ninteractively select hunks with \"push\" and \"save\". Another is the one\nfrom the \"git-log/diff\" machinery. This is the one that can be used with\n\"git stash show\" and \"git stash list\". That is, \"git stash show\" doesn't\nreally know about it -- it just passes on \"--patch\" and other arguments.\n\nFor example, for \"list\", the manpage for git-stash says \"The command\ntakes options applicable to the git log command to control what is shown\nand how. See git-log(1).\"\n\nSo there are in a sense lots of options that aren't documented in\ngit-stash(1). But certainly \"--patch\" is a bit special in that there are\nbasically two *different* options by the same name.\n\n> I can gladly submit a patch if this will be acceptable to update the\n> docs to state that -p|--patch is applicable to the `show` command as\n> well.\n\nI think it could be useful to be a bit clearer about this. One question\nis how... :-) Maybe under \"--patch\" one could make some short mention of\nthis. Perhaps\n\n  (`--patch` can also be used with \"show\" and \"list\", but that is\n  'another' `--patch`, see ....)\n\n? Maybe you have other ideas?\n\nThanks\nMartin\n"}]}