git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH 1/2] Documentation: mention 'git stash pop --index' option explicitly
@ 2009-06-08 16:27 SZEDER Gábor
  2009-06-08 16:28 ` [PATCH 2/2] bash: add support for 'git stash pop --index' option SZEDER Gábor
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: SZEDER Gábor @ 2009-06-08 16:27 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, SZEDER Gábor

'git stash pop' supports the '--index' option since its initial
implementation (bd56ff54, git-stash: add new 'pop' subcommand,
2008-02-22), but its documentation does not mention it explicitly.
Moreover, both the usage shown by 'git stash -h' and the synopsis
section in the man page imply that 'git stash pop' does not have any
options besides the stash to pop.

First, this patch corrects the usage and the synopsis section by listing
the '--index' option for the 'pop' subcommand explicitly.

Second, the patch moves the description of the '--index' option to the
'git stash pop' section in the documentation, and refers to it from
the 'git stash apply' section.  This way it follows the intentions of
commit d1836637 (Documentation: teach stash/pop workflow instead of
stash/apply, 2009-05-28), as all 'git stash pop'-related documentation
will be in one place without references to 'git stash apply'.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
---
 Documentation/git-stash.txt |   15 ++++++++-------
 git-stash.sh                |    3 ++-
 2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/Documentation/git-stash.txt b/Documentation/git-stash.txt
index 1cc24cc..de90550 100644
--- a/Documentation/git-stash.txt
+++ b/Documentation/git-stash.txt
@@ -9,7 +9,8 @@ SYNOPSIS
 --------
 [verse]
 'git stash' list [<options>]
-'git stash' (show | drop | pop ) [<stash>]
+'git stash' (show | drop ) [<stash>]
+'git stash' pop [--index] [<stash>]
 'git stash' apply [--index] [<stash>]
 'git stash' branch <branchname> [<stash>]
 'git stash' [save [--keep-index] [<message>]]
@@ -86,16 +87,16 @@ Applying the state can fail with conflicts; in this case, it is not
 removed from the stash list. You need to resolve the conflicts by hand
 and call `git stash drop` manually afterwards.
 +
-When no `<stash>` is given, `stash@\{0}` is assumed. See also `apply`.
-
-apply [--index] [<stash>]::
-
-	Like `pop`, but do not remove the state from the stash list.
-+
 If the `--index` option is used, then tries to reinstate not only the working
 tree's changes, but also the index's ones. However, this can fail, when you
 have conflicts (which are stored in the index, where you therefore can no
 longer apply the changes as they were originally).
++
+When no `<stash>` is given, `stash@\{0}` is assumed.
+
+apply [--index] [<stash>]::
+
+	Like `pop`, but do not remove the state from the stash list.
 
 branch <branchname> [<stash>]::
 
diff --git a/git-stash.sh b/git-stash.sh
index b9ace99..94f1d3a 100755
--- a/git-stash.sh
+++ b/git-stash.sh
@@ -3,7 +3,8 @@
 
 dashless=$(basename "$0" | sed -e 's/-/ /')
 USAGE="list [<options>]
-   or: $dashless (show | drop | pop ) [<stash>]
+   or: $dashless (show | drop ) [<stash>]
+   or: $dashless pop [--index] [<stash>]
    or: $dashless apply [--index] [<stash>]
    or: $dashless branch <branchname> [<stash>]
    or: $dashless [save [--keep-index] [<message>]]
-- 
1.6.3.2.247.gc361f.dirty

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/2] bash: add support for 'git stash pop --index' option
  2009-06-08 16:27 [PATCH 1/2] Documentation: mention 'git stash pop --index' option explicitly SZEDER Gábor
@ 2009-06-08 16:28 ` SZEDER Gábor
  2009-06-08 16:42   ` Brandon Casey
  2009-06-08 18:24 ` [PATCH 1/2] Documentation: mention 'git stash pop --index' option explicitly Brandon Casey
  2009-06-08 21:23 ` Junio C Hamano
  2 siblings, 1 reply; 9+ messages in thread
From: SZEDER Gábor @ 2009-06-08 16:28 UTC (permalink / raw)
  To: Shawn O. Pearce; +Cc: Junio C Hamano, git, SZEDER Gábor

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
---
 contrib/completion/git-completion.bash |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index fa899eb..480d85e 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1887,7 +1887,10 @@ _git_stash ()
 		apply,--*)
 			__gitcomp "--index"
 			;;
-		show,--*|drop,--*|pop,--*|branch,--*)
+		pop,--*)
+			__gitcomp "--index"
+			;;
+		show,--*|drop,--*|branch,--*)
 			COMPREPLY=()
 			;;
 		show,*|apply,*|drop,*|pop,*|branch,*)
-- 
1.6.3.2.247.gc361f.dirty

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/2] bash: add support for 'git stash pop --index' option
  2009-06-08 16:28 ` [PATCH 2/2] bash: add support for 'git stash pop --index' option SZEDER Gábor
@ 2009-06-08 16:42   ` Brandon Casey
  0 siblings, 0 replies; 9+ messages in thread
From: Brandon Casey @ 2009-06-08 16:42 UTC (permalink / raw)
  To: SZEDER Gábor; +Cc: Shawn O. Pearce, Junio C Hamano, git

SZEDER Gábor wrote:
> Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
> ---
>  contrib/completion/git-completion.bash |    5 ++++-
>  1 files changed, 4 insertions(+), 1 deletions(-)
> 
> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
> index fa899eb..480d85e 100755
> --- a/contrib/completion/git-completion.bash
> +++ b/contrib/completion/git-completion.bash
> @@ -1887,7 +1887,10 @@ _git_stash ()
>  		apply,--*)
>  			__gitcomp "--index"
>  			;;
> -		show,--*|drop,--*|pop,--*|branch,--*)
> +		pop,--*)
> +			__gitcomp "--index"
> +			;;
> +		show,--*|drop,--*|branch,--*)
>  			COMPREPLY=()
>  			;;
>  		show,*|apply,*|drop,*|pop,*|branch,*)

pop takes the same options as apply, so you may want to have just one
case statement for the two options.  Like:

    apply,--*|pop,--*)

-brandon

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/2] Documentation: mention 'git stash pop --index' option explicitly
  2009-06-08 16:27 [PATCH 1/2] Documentation: mention 'git stash pop --index' option explicitly SZEDER Gábor
  2009-06-08 16:28 ` [PATCH 2/2] bash: add support for 'git stash pop --index' option SZEDER Gábor
@ 2009-06-08 18:24 ` Brandon Casey
  2009-06-08 21:23 ` Junio C Hamano
  2 siblings, 0 replies; 9+ messages in thread
From: Brandon Casey @ 2009-06-08 18:24 UTC (permalink / raw)
  To: SZEDER Gábor; +Cc: Junio C Hamano, git


Sorry, I didn't read this first patch of yours before I submitted my
own patch to do basically the same thing.  I wasn't trying to trump
you.

-brandon


SZEDER Gábor wrote:
> 'git stash pop' supports the '--index' option since its initial
> implementation (bd56ff54, git-stash: add new 'pop' subcommand,
> 2008-02-22), but its documentation does not mention it explicitly.
> Moreover, both the usage shown by 'git stash -h' and the synopsis
> section in the man page imply that 'git stash pop' does not have any
> options besides the stash to pop.
> 
> First, this patch corrects the usage and the synopsis section by listing
> the '--index' option for the 'pop' subcommand explicitly.
> 
> Second, the patch moves the description of the '--index' option to the
> 'git stash pop' section in the documentation, and refers to it from
> the 'git stash apply' section.  This way it follows the intentions of
> commit d1836637 (Documentation: teach stash/pop workflow instead of
> stash/apply, 2009-05-28), as all 'git stash pop'-related documentation
> will be in one place without references to 'git stash apply'.
> 
> Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
> ---
>  Documentation/git-stash.txt |   15 ++++++++-------
>  git-stash.sh                |    3 ++-
>  2 files changed, 10 insertions(+), 8 deletions(-)
> 
> diff --git a/Documentation/git-stash.txt b/Documentation/git-stash.txt
> index 1cc24cc..de90550 100644
> --- a/Documentation/git-stash.txt
> +++ b/Documentation/git-stash.txt
> @@ -9,7 +9,8 @@ SYNOPSIS
>  --------
>  [verse]
>  'git stash' list [<options>]
> -'git stash' (show | drop | pop ) [<stash>]
> +'git stash' (show | drop ) [<stash>]
> +'git stash' pop [--index] [<stash>]
>  'git stash' apply [--index] [<stash>]
>  'git stash' branch <branchname> [<stash>]
>  'git stash' [save [--keep-index] [<message>]]
> @@ -86,16 +87,16 @@ Applying the state can fail with conflicts; in this case, it is not
>  removed from the stash list. You need to resolve the conflicts by hand
>  and call `git stash drop` manually afterwards.
>  +
> -When no `<stash>` is given, `stash@\{0}` is assumed. See also `apply`.
> -
> -apply [--index] [<stash>]::
> -
> -	Like `pop`, but do not remove the state from the stash list.
> -+
>  If the `--index` option is used, then tries to reinstate not only the working
>  tree's changes, but also the index's ones. However, this can fail, when you
>  have conflicts (which are stored in the index, where you therefore can no
>  longer apply the changes as they were originally).
> ++
> +When no `<stash>` is given, `stash@\{0}` is assumed.
> +
> +apply [--index] [<stash>]::
> +
> +	Like `pop`, but do not remove the state from the stash list.
>  
>  branch <branchname> [<stash>]::
>  
> diff --git a/git-stash.sh b/git-stash.sh
> index b9ace99..94f1d3a 100755
> --- a/git-stash.sh
> +++ b/git-stash.sh
> @@ -3,7 +3,8 @@
>  
>  dashless=$(basename "$0" | sed -e 's/-/ /')
>  USAGE="list [<options>]
> -   or: $dashless (show | drop | pop ) [<stash>]
> +   or: $dashless (show | drop ) [<stash>]
> +   or: $dashless pop [--index] [<stash>]
>     or: $dashless apply [--index] [<stash>]
>     or: $dashless branch <branchname> [<stash>]
>     or: $dashless [save [--keep-index] [<message>]]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/2] Documentation: mention 'git stash pop --index' option explicitly
  2009-06-08 16:27 [PATCH 1/2] Documentation: mention 'git stash pop --index' option explicitly SZEDER Gábor
  2009-06-08 16:28 ` [PATCH 2/2] bash: add support for 'git stash pop --index' option SZEDER Gábor
  2009-06-08 18:24 ` [PATCH 1/2] Documentation: mention 'git stash pop --index' option explicitly Brandon Casey
@ 2009-06-08 21:23 ` Junio C Hamano
  2009-06-08 21:42   ` SZEDER Gábor
  2 siblings, 1 reply; 9+ messages in thread
From: Junio C Hamano @ 2009-06-08 21:23 UTC (permalink / raw)
  To: SZEDER Gábor; +Cc: git

SZEDER Gábor <szeder@ira.uka.de> writes:

> -'git stash' (show | drop | pop ) [<stash>]
> +'git stash' (show | drop ) [<stash>]
> +'git stash' pop [--index] [<stash>]
>  'git stash' apply [--index] [<stash>]

Why not "(pop | apply) [--index]"?

Other than that looks sensible.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/2] Documentation: mention 'git stash pop --index' option explicitly
  2009-06-08 21:23 ` Junio C Hamano
@ 2009-06-08 21:42   ` SZEDER Gábor
  2009-06-08 22:57     ` [PATCH v2 " SZEDER Gábor
  0 siblings, 1 reply; 9+ messages in thread
From: SZEDER Gábor @ 2009-06-08 21:42 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

On Mon, Jun 08, 2009 at 02:23:55PM -0700, Junio C Hamano wrote:
> SZEDER Gábor <szeder@ira.uka.de> writes:
> 
> > -'git stash' (show | drop | pop ) [<stash>]
> > +'git stash' (show | drop ) [<stash>]
> > +'git stash' pop [--index] [<stash>]
> >  'git stash' apply [--index] [<stash>]
> 
> Why not "(pop | apply) [--index]"?
> 
> Other than that looks sensible.

Dunno.  I didn't like it somehow, but could not tell why.  But even
then, I should have followed the convention of (show | drop).

Will resend both patch after dinner.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH v2 1/2] Documentation: mention 'git stash pop --index' option explicitly
  2009-06-08 21:42   ` SZEDER Gábor
@ 2009-06-08 22:57     ` SZEDER Gábor
  2009-06-08 22:57       ` [PATCH v2 2/2] bash: add support for 'git stash pop --index' option SZEDER Gábor
  0 siblings, 1 reply; 9+ messages in thread
From: SZEDER Gábor @ 2009-06-08 22:57 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, SZEDER Gábor

'git stash pop' supports the '--index' option since its initial
implementation (bd56ff54, git-stash: add new 'pop' subcommand,
2008-02-22), but its documentation does not mention it explicitly.
Moreover, both the usage shown by 'git stash -h' and the synopsis
section in the man page imply that 'git stash pop' does not have an
'--index' option.

First, this patch corrects the usage and the synopsis section.

Second, the patch moves the description of the '--index' option to the
'git stash pop' section in the documentation, and refers to it from
the 'git stash apply' section.  This way it follows the intentions of
commit d1836637 (Documentation: teach stash/pop workflow instead of
stash/apply, 2009-05-28), as all 'git stash pop'-related documentation
will be in one place without references to 'git stash apply'.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
---
 Documentation/git-stash.txt |   16 ++++++++--------
 git-stash.sh                |    4 ++--
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/Documentation/git-stash.txt b/Documentation/git-stash.txt
index 1cc24cc..a42d4c8 100644
--- a/Documentation/git-stash.txt
+++ b/Documentation/git-stash.txt
@@ -9,8 +9,8 @@ SYNOPSIS
 --------
 [verse]
 'git stash' list [<options>]
-'git stash' (show | drop | pop ) [<stash>]
-'git stash' apply [--index] [<stash>]
+'git stash' ( show | drop ) [<stash>]
+'git stash' ( pop | apply ) [--index] [<stash>]
 'git stash' branch <branchname> [<stash>]
 'git stash' [save [--keep-index] [<message>]]
 'git stash' clear
@@ -86,16 +86,16 @@ Applying the state can fail with conflicts; in this case, it is not
 removed from the stash list. You need to resolve the conflicts by hand
 and call `git stash drop` manually afterwards.
 +
-When no `<stash>` is given, `stash@\{0}` is assumed. See also `apply`.
-
-apply [--index] [<stash>]::
-
-	Like `pop`, but do not remove the state from the stash list.
-+
 If the `--index` option is used, then tries to reinstate not only the working
 tree's changes, but also the index's ones. However, this can fail, when you
 have conflicts (which are stored in the index, where you therefore can no
 longer apply the changes as they were originally).
++
+When no `<stash>` is given, `stash@\{0}` is assumed.
+
+apply [--index] [<stash>]::
+
+	Like `pop`, but do not remove the state from the stash list.
 
 branch <branchname> [<stash>]::
 
diff --git a/git-stash.sh b/git-stash.sh
index b9ace99..e6a5867 100755
--- a/git-stash.sh
+++ b/git-stash.sh
@@ -3,8 +3,8 @@
 
 dashless=$(basename "$0" | sed -e 's/-/ /')
 USAGE="list [<options>]
-   or: $dashless (show | drop | pop ) [<stash>]
-   or: $dashless apply [--index] [<stash>]
+   or: $dashless ( show | drop ) [<stash>]
+   or: $dashless ( pop | apply ) [--index] [<stash>]
    or: $dashless branch <branchname> [<stash>]
    or: $dashless [save [--keep-index] [<message>]]
    or: $dashless clear"
-- 
1.6.3.2.252.g5b6b0

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v2 2/2] bash: add support for 'git stash pop --index' option
  2009-06-08 22:57     ` [PATCH v2 " SZEDER Gábor
@ 2009-06-08 22:57       ` SZEDER Gábor
  2009-06-09  7:18         ` Junio C Hamano
  0 siblings, 1 reply; 9+ messages in thread
From: SZEDER Gábor @ 2009-06-08 22:57 UTC (permalink / raw)
  To: Shawn O. Pearce; +Cc: Junio C Hamano, git, SZEDER Gábor

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
---
 contrib/completion/git-completion.bash |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index fa899eb..edeedda 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1884,10 +1884,10 @@ _git_stash ()
 		save,--*)
 			__gitcomp "--keep-index"
 			;;
-		apply,--*)
+		apply,--*|pop,--*)
 			__gitcomp "--index"
 			;;
-		show,--*|drop,--*|pop,--*|branch,--*)
+		show,--*|drop,--*|branch,--*)
 			COMPREPLY=()
 			;;
 		show,*|apply,*|drop,*|pop,*|branch,*)
-- 
1.6.3.2.252.g5b6b0

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 2/2] bash: add support for 'git stash pop --index' option
  2009-06-08 22:57       ` [PATCH v2 2/2] bash: add support for 'git stash pop --index' option SZEDER Gábor
@ 2009-06-09  7:18         ` Junio C Hamano
  0 siblings, 0 replies; 9+ messages in thread
From: Junio C Hamano @ 2009-06-09  7:18 UTC (permalink / raw)
  To: SZEDER Gábor; +Cc: Shawn O. Pearce, Junio C Hamano, git

Thanks; I'll pick up both patches.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2009-06-09  7:19 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-08 16:27 [PATCH 1/2] Documentation: mention 'git stash pop --index' option explicitly SZEDER Gábor
2009-06-08 16:28 ` [PATCH 2/2] bash: add support for 'git stash pop --index' option SZEDER Gábor
2009-06-08 16:42   ` Brandon Casey
2009-06-08 18:24 ` [PATCH 1/2] Documentation: mention 'git stash pop --index' option explicitly Brandon Casey
2009-06-08 21:23 ` Junio C Hamano
2009-06-08 21:42   ` SZEDER Gábor
2009-06-08 22:57     ` [PATCH v2 " SZEDER Gábor
2009-06-08 22:57       ` [PATCH v2 2/2] bash: add support for 'git stash pop --index' option SZEDER Gábor
2009-06-09  7:18         ` Junio C Hamano

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).