{"thread":{"id":"19744","subject":"[PATCH 1/2] Documentation: mention 'git stash pop --index' option explicitly","startedAt":"2009-06-08T16:27:52Z","lastAt":"2009-06-09T07:18:56Z","messageCount":9,"participants":["SZEDER Gábor","Brandon Casey","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"115815","messageId":"27f7124b574aa6ac4391b9bd029242ceb5874447.1244475542.git.szeder@ira.uka.de","threadId":"19744","inReplyTo":null,"subject":"[PATCH 1/2] Documentation: mention 'git stash pop --index' option explicitly","fromName":"SZEDER Gábor","fromEmail":"szeder@ira.uka.de","sentAt":"2009-06-08T16:27:52Z","receivedAt":"2009-06-08T16:27:52Z","isPatch":true,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"'git stash pop' supports the '--index' option since its initial\nimplementation (bd56ff54, git-stash: add new 'pop' subcommand,\n2008-02-22), but its documentation does not mention it explicitly.\nMoreover, both the usage shown by 'git stash -h' and the synopsis\nsection in the man page imply that 'git stash pop' does not have any\noptions besides the stash to pop.\n\nFirst, this patch corrects the usage and the synopsis section by listing\nthe '--index' option for the 'pop' subcommand explicitly.\n\nSecond, the patch moves the description of the '--index' option to the\n'git stash pop' section in the documentation, and refers to it from\nthe 'git stash apply' section.  This way it follows the intentions of\ncommit d1836637 (Documentation: teach stash/pop workflow instead of\nstash/apply, 2009-05-28), as all 'git stash pop'-related documentation\nwill be in one place without references to 'git stash apply'.\n\nSigned-off-by: SZEDER Gábor <szeder@ira.uka.de>\n---\n Documentation/git-stash.txt |   15 ++++++++-------\n git-stash.sh                |    3 ++-\n 2 files changed, 10 insertions(+), 8 deletions(-)\n\ndiff --git a/Documentation/git-stash.txt b/Documentation/git-stash.txt\nindex 1cc24cc..de90550 100644\n--- a/Documentation/git-stash.txt\n+++ b/Documentation/git-stash.txt\n@@ -9,7 +9,8 @@ SYNOPSIS\n --------\n [verse]\n 'git stash' list [<options>]\n-'git stash' (show | drop | pop ) [<stash>]\n+'git stash' (show | drop ) [<stash>]\n+'git stash' pop [--index] [<stash>]\n 'git stash' apply [--index] [<stash>]\n 'git stash' branch <branchname> [<stash>]\n 'git stash' [save [--keep-index] [<message>]]\n@@ -86,16 +87,16 @@ Applying the state can fail with conflicts; in this case, it is not\n removed from the stash list. You need to resolve the conflicts by hand\n and call `git stash drop` manually afterwards.\n +\n-When no `<stash>` is given, `stash@\\{0}` is assumed. See also `apply`.\n-\n-apply [--index] [<stash>]::\n-\n-\tLike `pop`, but do not remove the state from the stash list.\n-+\n If the `--index` option is used, then tries to reinstate not only the working\n tree's changes, but also the index's ones. However, this can fail, when you\n have conflicts (which are stored in the index, where you therefore can no\n longer apply the changes as they were originally).\n++\n+When no `<stash>` is given, `stash@\\{0}` is assumed.\n+\n+apply [--index] [<stash>]::\n+\n+\tLike `pop`, but do not remove the state from the stash list.\n \n branch <branchname> [<stash>]::\n \ndiff --git a/git-stash.sh b/git-stash.sh\nindex b9ace99..94f1d3a 100755\n--- a/git-stash.sh\n+++ b/git-stash.sh\n@@ -3,7 +3,8 @@\n \n dashless=$(basename \"$0\" | sed -e 's/-/ /')\n USAGE=\"list [<options>]\n-   or: $dashless (show | drop | pop ) [<stash>]\n+   or: $dashless (show | drop ) [<stash>]\n+   or: $dashless pop [--index] [<stash>]\n    or: $dashless apply [--index] [<stash>]\n    or: $dashless branch <branchname> [<stash>]\n    or: $dashless [save [--keep-index] [<message>]]\n-- \n1.6.3.2.247.gc361f.dirty\n"},{"id":"115816","messageId":"3456b3a568969b2e0451cdc7a9beebfeb5763039.1244475542.git.szeder@ira.uka.de","threadId":"19744","inReplyTo":"27f7124b574aa6ac4391b9bd029242ceb5874447.1244475542.git.szeder@ira.uka.de","subject":"[PATCH 2/2] bash: add support for 'git stash pop --index' option","fromName":"SZEDER Gábor","fromEmail":"szeder@ira.uka.de","sentAt":"2009-06-08T16:28:51Z","receivedAt":"2009-06-08T16:28:51Z","isPatch":true,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>\n---\n contrib/completion/git-completion.bash |    5 ++++-\n 1 files changed, 4 insertions(+), 1 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex fa899eb..480d85e 100755\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -1887,7 +1887,10 @@ _git_stash ()\n \t\tapply,--*)\n \t\t\t__gitcomp \"--index\"\n \t\t\t;;\n-\t\tshow,--*|drop,--*|pop,--*|branch,--*)\n+\t\tpop,--*)\n+\t\t\t__gitcomp \"--index\"\n+\t\t\t;;\n+\t\tshow,--*|drop,--*|branch,--*)\n \t\t\tCOMPREPLY=()\n \t\t\t;;\n \t\tshow,*|apply,*|drop,*|pop,*|branch,*)\n-- \n1.6.3.2.247.gc361f.dirty\n"},{"id":"115818","messageId":"g-qSjt6xP9cc8knb-2r7SsV783h1R4c8UDJrPsaIHkYcoFwgq_Dt_Q@cipher.nrlssc.navy.mil","threadId":"19744","inReplyTo":"3456b3a568969b2e0451cdc7a9beebfeb5763039.1244475542.git.szeder@ira.uka.de","subject":"Re: [PATCH 2/2] bash: add support for 'git stash pop --index' option","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2009-06-08T16:42:15Z","receivedAt":"2009-06-08T16:42:15Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"SZEDER Gábor wrote:\n> Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>\n> ---\n>  contrib/completion/git-completion.bash |    5 ++++-\n>  1 files changed, 4 insertions(+), 1 deletions(-)\n> \n> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\n> index fa899eb..480d85e 100755\n> --- a/contrib/completion/git-completion.bash\n> +++ b/contrib/completion/git-completion.bash\n> @@ -1887,7 +1887,10 @@ _git_stash ()\n>  \t\tapply,--*)\n>  \t\t\t__gitcomp \"--index\"\n>  \t\t\t;;\n> -\t\tshow,--*|drop,--*|pop,--*|branch,--*)\n> +\t\tpop,--*)\n> +\t\t\t__gitcomp \"--index\"\n> +\t\t\t;;\n> +\t\tshow,--*|drop,--*|branch,--*)\n>  \t\t\tCOMPREPLY=()\n>  \t\t\t;;\n>  \t\tshow,*|apply,*|drop,*|pop,*|branch,*)\n\npop takes the same options as apply, so you may want to have just one\ncase statement for the two options.  Like:\n\n    apply,--*|pop,--*)\n\n-brandon\n"},{"id":"115829","messageId":"sHD5HzzlpP8aQrH5W2epWAWTSUBcvKbn_nPuGJaIzd_TgO7ILnnVDQ@cipher.nrlssc.navy.mil","threadId":"19744","inReplyTo":"27f7124b574aa6ac4391b9bd029242ceb5874447.1244475542.git.szeder@ira.uka.de","subject":"Re: [PATCH 1/2] Documentation: mention 'git stash pop --index' option explicitly","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2009-06-08T18:24:56Z","receivedAt":"2009-06-08T18:24:56Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"\nSorry, I didn't read this first patch of yours before I submitted my\nown patch to do basically the same thing.  I wasn't trying to trump\nyou.\n\n-brandon\n\n\nSZEDER Gábor wrote:\n> 'git stash pop' supports the '--index' option since its initial\n> implementation (bd56ff54, git-stash: add new 'pop' subcommand,\n> 2008-02-22), but its documentation does not mention it explicitly.\n> Moreover, both the usage shown by 'git stash -h' and the synopsis\n> section in the man page imply that 'git stash pop' does not have any\n> options besides the stash to pop.\n> \n> First, this patch corrects the usage and the synopsis section by listing\n> the '--index' option for the 'pop' subcommand explicitly.\n> \n> Second, the patch moves the description of the '--index' option to the\n> 'git stash pop' section in the documentation, and refers to it from\n> the 'git stash apply' section.  This way it follows the intentions of\n> commit d1836637 (Documentation: teach stash/pop workflow instead of\n> stash/apply, 2009-05-28), as all 'git stash pop'-related documentation\n> will be in one place without references to 'git stash apply'.\n> \n> Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>\n> ---\n>  Documentation/git-stash.txt |   15 ++++++++-------\n>  git-stash.sh                |    3 ++-\n>  2 files changed, 10 insertions(+), 8 deletions(-)\n> \n> diff --git a/Documentation/git-stash.txt b/Documentation/git-stash.txt\n> index 1cc24cc..de90550 100644\n> --- a/Documentation/git-stash.txt\n> +++ b/Documentation/git-stash.txt\n> @@ -9,7 +9,8 @@ SYNOPSIS\n>  --------\n>  [verse]\n>  'git stash' list [<options>]\n> -'git stash' (show | drop | pop ) [<stash>]\n> +'git stash' (show | drop ) [<stash>]\n> +'git stash' pop [--index] [<stash>]\n>  'git stash' apply [--index] [<stash>]\n>  'git stash' branch <branchname> [<stash>]\n>  'git stash' [save [--keep-index] [<message>]]\n> @@ -86,16 +87,16 @@ Applying the state can fail with conflicts; in this case, it is not\n>  removed from the stash list. You need to resolve the conflicts by hand\n>  and call `git stash drop` manually afterwards.\n>  +\n> -When no `<stash>` is given, `stash@\\{0}` is assumed. See also `apply`.\n> -\n> -apply [--index] [<stash>]::\n> -\n> -\tLike `pop`, but do not remove the state from the stash list.\n> -+\n>  If the `--index` option is used, then tries to reinstate not only the working\n>  tree's changes, but also the index's ones. However, this can fail, when you\n>  have conflicts (which are stored in the index, where you therefore can no\n>  longer apply the changes as they were originally).\n> ++\n> +When no `<stash>` is given, `stash@\\{0}` is assumed.\n> +\n> +apply [--index] [<stash>]::\n> +\n> +\tLike `pop`, but do not remove the state from the stash list.\n>  \n>  branch <branchname> [<stash>]::\n>  \n> diff --git a/git-stash.sh b/git-stash.sh\n> index b9ace99..94f1d3a 100755\n> --- a/git-stash.sh\n> +++ b/git-stash.sh\n> @@ -3,7 +3,8 @@\n>  \n>  dashless=$(basename \"$0\" | sed -e 's/-/ /')\n>  USAGE=\"list [<options>]\n> -   or: $dashless (show | drop | pop ) [<stash>]\n> +   or: $dashless (show | drop ) [<stash>]\n> +   or: $dashless pop [--index] [<stash>]\n>     or: $dashless apply [--index] [<stash>]\n>     or: $dashless branch <branchname> [<stash>]\n>     or: $dashless [save [--keep-index] [<message>]]\n"},{"id":"115843","messageId":"7viqj6xvv8.fsf@alter.siamese.dyndns.org","threadId":"19744","inReplyTo":"27f7124b574aa6ac4391b9bd029242ceb5874447.1244475542.git.szeder@ira.uka.de","subject":"Re: [PATCH 1/2] Documentation: mention 'git stash pop --index' option explicitly","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-06-08T21:23:55Z","receivedAt":"2009-06-08T21:23:55Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"SZEDER Gábor <szeder@ira.uka.de> writes:\n\n> -'git stash' (show | drop | pop ) [<stash>]\n> +'git stash' (show | drop ) [<stash>]\n> +'git stash' pop [--index] [<stash>]\n>  'git stash' apply [--index] [<stash>]\n\nWhy not \"(pop | apply) [--index]\"?\n\nOther than that looks sensible.\n"},{"id":"115846","messageId":"20090608214243.GK13773@neumann","threadId":"19744","inReplyTo":"7viqj6xvv8.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 1/2] Documentation: mention 'git stash pop --index' option explicitly","fromName":"SZEDER Gábor","fromEmail":"szeder@ira.uka.de","sentAt":"2009-06-08T21:42:43Z","receivedAt":"2009-06-08T21:42:43Z","isPatch":true,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"On Mon, Jun 08, 2009 at 02:23:55PM -0700, Junio C Hamano wrote:\n> SZEDER Gábor <szeder@ira.uka.de> writes:\n> \n> > -'git stash' (show | drop | pop ) [<stash>]\n> > +'git stash' (show | drop ) [<stash>]\n> > +'git stash' pop [--index] [<stash>]\n> >  'git stash' apply [--index] [<stash>]\n> \n> Why not \"(pop | apply) [--index]\"?\n> \n> Other than that looks sensible.\n\nDunno.  I didn't like it somehow, but could not tell why.  But even\nthen, I should have followed the convention of (show | drop).\n\nWill resend both patch after dinner.\n"},{"id":"115858","messageId":"d07a10275620808bc378340cc8450d3e8de8cf7e.1244501726.git.szeder@ira.uka.de","threadId":"19744","inReplyTo":"20090608214243.GK13773@neumann","subject":"[PATCH v2 1/2] Documentation: mention 'git stash pop --index' option explicitly","fromName":"SZEDER Gábor","fromEmail":"szeder@ira.uka.de","sentAt":"2009-06-08T22:57:06Z","receivedAt":"2009-06-08T22:57:06Z","isPatch":true,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"'git stash pop' supports the '--index' option since its initial\nimplementation (bd56ff54, git-stash: add new 'pop' subcommand,\n2008-02-22), but its documentation does not mention it explicitly.\nMoreover, both the usage shown by 'git stash -h' and the synopsis\nsection in the man page imply that 'git stash pop' does not have an\n'--index' option.\n\nFirst, this patch corrects the usage and the synopsis section.\n\nSecond, the patch moves the description of the '--index' option to the\n'git stash pop' section in the documentation, and refers to it from\nthe 'git stash apply' section.  This way it follows the intentions of\ncommit d1836637 (Documentation: teach stash/pop workflow instead of\nstash/apply, 2009-05-28), as all 'git stash pop'-related documentation\nwill be in one place without references to 'git stash apply'.\n\nSigned-off-by: SZEDER Gábor <szeder@ira.uka.de>\n---\n Documentation/git-stash.txt |   16 ++++++++--------\n git-stash.sh                |    4 ++--\n 2 files changed, 10 insertions(+), 10 deletions(-)\n\ndiff --git a/Documentation/git-stash.txt b/Documentation/git-stash.txt\nindex 1cc24cc..a42d4c8 100644\n--- a/Documentation/git-stash.txt\n+++ b/Documentation/git-stash.txt\n@@ -9,8 +9,8 @@ SYNOPSIS\n --------\n [verse]\n 'git stash' list [<options>]\n-'git stash' (show | drop | pop ) [<stash>]\n-'git stash' apply [--index] [<stash>]\n+'git stash' ( show | drop ) [<stash>]\n+'git stash' ( pop | apply ) [--index] [<stash>]\n 'git stash' branch <branchname> [<stash>]\n 'git stash' [save [--keep-index] [<message>]]\n 'git stash' clear\n@@ -86,16 +86,16 @@ Applying the state can fail with conflicts; in this case, it is not\n removed from the stash list. You need to resolve the conflicts by hand\n and call `git stash drop` manually afterwards.\n +\n-When no `<stash>` is given, `stash@\\{0}` is assumed. See also `apply`.\n-\n-apply [--index] [<stash>]::\n-\n-\tLike `pop`, but do not remove the state from the stash list.\n-+\n If the `--index` option is used, then tries to reinstate not only the working\n tree's changes, but also the index's ones. However, this can fail, when you\n have conflicts (which are stored in the index, where you therefore can no\n longer apply the changes as they were originally).\n++\n+When no `<stash>` is given, `stash@\\{0}` is assumed.\n+\n+apply [--index] [<stash>]::\n+\n+\tLike `pop`, but do not remove the state from the stash list.\n \n branch <branchname> [<stash>]::\n \ndiff --git a/git-stash.sh b/git-stash.sh\nindex b9ace99..e6a5867 100755\n--- a/git-stash.sh\n+++ b/git-stash.sh\n@@ -3,8 +3,8 @@\n \n dashless=$(basename \"$0\" | sed -e 's/-/ /')\n USAGE=\"list [<options>]\n-   or: $dashless (show | drop | pop ) [<stash>]\n-   or: $dashless apply [--index] [<stash>]\n+   or: $dashless ( show | drop ) [<stash>]\n+   or: $dashless ( pop | apply ) [--index] [<stash>]\n    or: $dashless branch <branchname> [<stash>]\n    or: $dashless [save [--keep-index] [<message>]]\n    or: $dashless clear\"\n-- \n1.6.3.2.252.g5b6b0\n"},{"id":"115859","messageId":"e380823e9e6c895eeb375b2c5f021ff022798d30.1244501726.git.szeder@ira.uka.de","threadId":"19744","inReplyTo":"d07a10275620808bc378340cc8450d3e8de8cf7e.1244501726.git.szeder@ira.uka.de","subject":"[PATCH v2 2/2] bash: add support for 'git stash pop --index' option","fromName":"SZEDER Gábor","fromEmail":"szeder@ira.uka.de","sentAt":"2009-06-08T22:57:39Z","receivedAt":"2009-06-08T22:57:39Z","isPatch":true,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>\n---\n contrib/completion/git-completion.bash |    4 ++--\n 1 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex fa899eb..edeedda 100755\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -1884,10 +1884,10 @@ _git_stash ()\n \t\tsave,--*)\n \t\t\t__gitcomp \"--keep-index\"\n \t\t\t;;\n-\t\tapply,--*)\n+\t\tapply,--*|pop,--*)\n \t\t\t__gitcomp \"--index\"\n \t\t\t;;\n-\t\tshow,--*|drop,--*|pop,--*|branch,--*)\n+\t\tshow,--*|drop,--*|branch,--*)\n \t\t\tCOMPREPLY=()\n \t\t\t;;\n \t\tshow,*|apply,*|drop,*|pop,*|branch,*)\n-- \n1.6.3.2.252.g5b6b0\n"},{"id":"115879","messageId":"7vy6s1swm7.fsf@alter.siamese.dyndns.org","threadId":"19744","inReplyTo":"e380823e9e6c895eeb375b2c5f021ff022798d30.1244501726.git.szeder@ira.uka.de","subject":"Re: [PATCH v2 2/2] bash: add support for 'git stash pop --index' option","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-06-09T07:18:56Z","receivedAt":"2009-06-09T07:18:56Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thanks; I'll pick up both patches.\n"}]}