{"thread":{"id":"59975","subject":"Possible typo in git stash doc page","startedAt":"2023-07-12T15:01:37Z","lastAt":"2023-07-12T15:49:20Z","messageCount":2,"participants":["Manuel Ricci","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"479406","messageId":"CAMvNOSqDgDnchNdNq7AvBYbMTFfy0mWMygHnX_8HjTAnBA=AnQ@mail.gmail.com","threadId":"59975","inReplyTo":null,"subject":"Possible typo in git stash doc page","fromName":"Manuel Ricci","fromEmail":"manuelricciwc@gmail.com","sentAt":"2023-07-12T15:01:29Z","receivedAt":"2023-07-12T15:01:37Z","isPatch":false,"sender":{"key":"manuelricciwc@gmail.com","avatar":null},"body":"Hi,\n\nIn the doc page about git stash, specifically where there're the\ndetails about git stash push\nhttps://git-scm.com/docs/git-stash#Documentation/git-stash.txt-push-p--patch-S--staged-k--no-keep-index-u--include-untracked-a--all-q--quiet-m--messageltmessagegt--pathspec-from-fileltfilegt--pathspec-file-nul--ltpathspecgt82308203\n\nThere's a reference about --staged or -S. I tried to execute the\ncommand with that flag and the output is like this one:\n\nerror: unknown switch `S'\nusage: git stash [push [-p|--patch] [-k|--[no-]keep-index] [-q|--quiet]\n          [-u|--include-untracked] [-a|--all] [-m|--message <message>]\n          [--] [<pathspec>...]]\n\n    -k, --keep-index      keep index\n    -p, --patch           stash in patch mode\n    -q, --quiet           quiet mode\n    -u, --include-untracked\n                          include untracked files in stash\n    -a, --all             include ignore files\n    -m, --message <message>\n                          stash message\n\nEven if the flag is --staged\n\nerror: unknown option `staged'\nusage: git stash [push [-p|--patch] [-k|--[no-]keep-index] [-q|--quiet]\n          [-u|--include-untracked] [-a|--all] [-m|--message <message>]\n          [--] [<pathspec>...]]\n\n    -k, --keep-index      keep index\n    -p, --patch           stash in patch mode\n    -q, --quiet           quiet mode\n    -u, --include-untracked\n                          include untracked files in stash\n    -a, --all             include ignore files\n    -m, --message <message>\n                          stash message\n\nAt the start of the same page, --staged is not present in the push\narguments, so I think that is a typo.\n\nHave a good day\n\nManuel\n"},{"id":"479410","messageId":"xmqq1qhduo3r.fsf@gitster.g","threadId":"59975","inReplyTo":"CAMvNOSqDgDnchNdNq7AvBYbMTFfy0mWMygHnX_8HjTAnBA=AnQ@mail.gmail.com","subject":"Re: Possible typo in git stash doc page","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2023-07-12T15:49:12Z","receivedAt":"2023-07-12T15:49:20Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Manuel Ricci <manuelricciwc@gmail.com> writes:\n\n> In the doc page about git stash, specifically where there're the\n> details about git stash push\n> https://git-scm.com/docs/git-stash#Documentation/git-stash.txt-push-p--patch-S--staged-k--no-keep-index-u--include-untracked-a--all-q--quiet-m--messageltmessagegt--pathspec-from-fileltfilegt--pathspec-file-nul--ltpathspecgt82308203\n>\n> There's a reference about --staged or -S. I tried to execute the\n> command with that flag and the output is like this one:\n>\n> error: unknown switch `S'\n> usage: git stash [push [-p|--patch] [-k|--[no-]keep-index] [-q|--quiet]\n> ...\n> Even if the flag is --staged\n>\n> error: unknown option `staged'\n> usage: git stash [push [-p|--patch] [-k|--[no-]keep-index] [-q|--quiet]\n> ...\n\nThis is not a very reproducibly-helpful bug report.  Re-reading the\nabove, we do not even learn what exact command you typed, and what\nthe state the repository you saw the error message was in.\n\nIn a random repository I happened to be in, that had Makefile tracked,\nI did this:\n\n    $ git version\n    git version 2.41.0-327-gaa9166bcc0\n    $ git stash -S\n    No local changes to save.\n    $ echo \"# junk\" >>Makefile\n    $ git stash -S\n    No staged changes.\n    $ git add Makefile\n    $ git stash -S\n    Saved working directory and index state WIP on ...\n\nThe commands in various state seem to be working as expected.  It\nwould complain when there is nothing to save, it complains\ndifferently when there is something to save but the change is not in\nthe index, and it reports what it did when it did save.\n\nThe option was implemented with 41a28eb6 (stash: implement\n'--staged' option for 'push' and 'save', 2021-10-18) that first\nappeared in Git 2.35, so it is possible that the version of Git\nyou are using is too old to have it, but from your bug report we\ncannot tell if that is the case.\n\nHTH?\n"}]}