git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] bash completion: Add --autostash and --no-autostash to pull
@ 2017-11-20 15:07 Albert Astals Cid
  2017-11-20 23:14 ` Eric Sunshine
  0 siblings, 1 reply; 5+ messages in thread
From: Albert Astals Cid @ 2017-11-20 15:07 UTC (permalink / raw)
  To: git@vger.kernel.org

Ideally we should only autocomplete if pull has --rebase since
they only work with it but could not figure out how to do that
and the error message of doing git pull --autostash points out
that you need --rebase so i guess it's good enough
---
 contrib/completion/git-completion.bash | 1 +
 1 file changed, 1 insertion(+)

diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-
completion.bash
index 539d7f84f..7ded58f38 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1923,6 +1923,7 @@ _git_pull ()
 	--*)
 		__gitcomp "
 			--rebase --no-rebase
+			--autostash --no-autostash
 			$__git_merge_options
 			$__git_fetch_options
 		"
-- 
2.15.0



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

* Re: [PATCH] bash completion: Add --autostash and --no-autostash to pull
  2017-11-20 15:07 [PATCH] bash completion: Add --autostash and --no-autostash to pull Albert Astals Cid
@ 2017-11-20 23:14 ` Eric Sunshine
  2017-11-21 14:39   ` Albert Astals Cid
  0 siblings, 1 reply; 5+ messages in thread
From: Eric Sunshine @ 2017-11-20 23:14 UTC (permalink / raw)
  To: Albert Astals Cid; +Cc: git@vger.kernel.org

On Mon, Nov 20, 2017 at 10:07 AM, Albert Astals Cid
<albert.astals.cid@kdab.com> wrote:
> Ideally we should only autocomplete if pull has --rebase since
> they only work with it but could not figure out how to do that
> and the error message of doing git pull --autostash points out
> that you need --rebase so i guess it's good enough

Missing Signed-off-by:. See Documentation/SubmittingPatches. Thanks.

> ---
> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-
> completion.bash
> index 539d7f84f..7ded58f38 100644
> --- a/contrib/completion/git-completion.bash
> +++ b/contrib/completion/git-completion.bash
> @@ -1923,6 +1923,7 @@ _git_pull ()
>         --*)
>                 __gitcomp "
>                         --rebase --no-rebase
> +                       --autostash --no-autostash
>                         $__git_merge_options
>                         $__git_fetch_options
>                 "

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

* [PATCH] bash completion: Add --autostash and --no-autostash to pull
@ 2017-11-21 14:39 Albert Astals Cid
  2017-11-24 18:09 ` SZEDER Gábor
  0 siblings, 1 reply; 5+ messages in thread
From: Albert Astals Cid @ 2017-11-21 14:39 UTC (permalink / raw)
  To: git@vger.kernel.org

Ideally we should only autocomplete if pull has --rebase since
they only work with it but could not figure out how to do that
and the error message of doing git pull --autostash points out
that you need --rebase so i guess it's good enough

Signed-off-by: Albert Astals Cid <albert.astals.cid@kdab.com>
---
 contrib/completion/git-completion.bash | 1 +
 1 file changed, 1 insertion(+)

diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-
completion.bash
index 539d7f84f..7ded58f38 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1923,6 +1923,7 @@ _git_pull ()
 	--*)
 		__gitcomp "
 			--rebase --no-rebase
+			--autostash --no-autostash
 			$__git_merge_options
 			$__git_fetch_options
 		"
-- 
2.15.0



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

* Re: [PATCH] bash completion: Add --autostash and --no-autostash to pull
  2017-11-20 23:14 ` Eric Sunshine
@ 2017-11-21 14:39   ` Albert Astals Cid
  0 siblings, 0 replies; 5+ messages in thread
From: Albert Astals Cid @ 2017-11-21 14:39 UTC (permalink / raw)
  To: Eric Sunshine; +Cc: git@vger.kernel.org

El dimarts, 21 de novembre de 2017, a les 0:14:24 CET, Eric Sunshine va 
escriure:
> On Mon, Nov 20, 2017 at 10:07 AM, Albert Astals Cid
> 
> <albert.astals.cid@kdab.com> wrote:
> > Ideally we should only autocomplete if pull has --rebase since
> > they only work with it but could not figure out how to do that
> > and the error message of doing git pull --autostash points out
> > that you need --rebase so i guess it's good enough
> 
> Missing Signed-off-by:. See Documentation/SubmittingPatches. Thanks.

Added.

Cheers,
  Albert

> 
> > ---
> > diff --git a/contrib/completion/git-completion.bash
> > b/contrib/completion/git- completion.bash
> > index 539d7f84f..7ded58f38 100644
> > --- a/contrib/completion/git-completion.bash
> > +++ b/contrib/completion/git-completion.bash
> > @@ -1923,6 +1923,7 @@ _git_pull ()
> > 
> >         --*)
> >         
> >                 __gitcomp "
> >                 
> >                         --rebase --no-rebase
> > 
> > +                       --autostash --no-autostash
> > 
> >                         $__git_merge_options
> >                         $__git_fetch_options
> >                 
> >                 "


-- 
Albert Astals Cid | albert.astals.cid@kdab.com | Software Engineer
Klarälvdalens Datakonsult AB, a KDAB Group company
Tel: Sweden (HQ) +46-563-540090, USA +1-866-777-KDAB(5322)
KDAB - The Qt, C++ and OpenGL Experts

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

* Re: [PATCH] bash completion: Add --autostash and --no-autostash to pull
  2017-11-21 14:39 Albert Astals Cid
@ 2017-11-24 18:09 ` SZEDER Gábor
  0 siblings, 0 replies; 5+ messages in thread
From: SZEDER Gábor @ 2017-11-24 18:09 UTC (permalink / raw)
  To: Albert Astals Cid; +Cc: SZEDER Gábor, git@vger.kernel.org

> Ideally we should only autocomplete if pull has --rebase since
> they only work with it but could not figure out how to do that
> and the error message of doing git pull --autostash points out
> that you need --rebase so i guess it's good enough

You could use the completion script's __git_find_on_cmdline() helper
function to easily check whether the '--rebase' option is already
present on the command line.

Having said that, I don't think we should go there, it feels that's
trying to be overly and unnecessarily clever.  After all, the order of
command line options doesn't matter, and 'git pull --autostash
--rebase' is a perfectly legit command.


> Signed-off-by: Albert Astals Cid <albert.astals.cid@kdab.com>
> ---
>  contrib/completion/git-completion.bash | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-
> completion.bash
> index 539d7f84f..7ded58f38 100644
> --- a/contrib/completion/git-completion.bash
> +++ b/contrib/completion/git-completion.bash
> @@ -1923,6 +1923,7 @@ _git_pull ()
>  	--*)
>  		__gitcomp "
>  			--rebase --no-rebase
> +			--autostash --no-autostash
>  			$__git_merge_options
>  			$__git_fetch_options
>  		"
> -- 
> 2.15.0
> 
> 
> 

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

end of thread, other threads:[~2017-11-24 18:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-20 15:07 [PATCH] bash completion: Add --autostash and --no-autostash to pull Albert Astals Cid
2017-11-20 23:14 ` Eric Sunshine
2017-11-21 14:39   ` Albert Astals Cid
  -- strict thread matches above, loose matches on Subject: below --
2017-11-21 14:39 Albert Astals Cid
2017-11-24 18:09 ` SZEDER Gábor

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).