git@vger.kernel.org mailing list mirror (one of many)
 help / Atom feed
* [PATCH v1 1/1] completion: add remaining flags to checkout
@ 2017-10-12 12:20 Thomas Braun
  2017-10-12 16:50 ` Johannes Sixt
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Braun @ 2017-10-12 12:20 UTC (permalink / raw)
  To: git; +Cc: gitster, Thomas Braun

In the commits 1d0fa898 (checkout: add --ignore-other-wortrees,
2015-01-03), 1fc458d9 (builtin/checkout: add --recurse-submodules switch,
2017-03-14), 870ebdb9 (checkout: add --progress option, 2015-11-01),
08d595dc (checkout: add --ignore-skip-worktree-bits in sparse checkout
mode, 2013-04-13), 1d0fa898 (checkout: add --ignore-other-wortrees,
2015-01-03), 32669671 (checkout: introduce --detach synonym for "git
checkout foo^{commit}", 2011-02-08) and db941099 (checkout -f: allow
ignoring unmerged paths when checking out of the index, 2008-08-30)
checkout gained new flags but the completion was not updated, although
these flags are useful completions. Add them.

Signed-off-by: Thomas Braun <thomas.braun@virtuell-zuhause.de>
---
 contrib/completion/git-completion.bash | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index d934417475..393d4ae230 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1250,7 +1250,9 @@ _git_checkout ()
 	--*)
 		__gitcomp "
 			--quiet --ours --theirs --track --no-track --merge
-			--conflict= --orphan --patch
+			--conflict= --orphan --patch --detach --progress --no-progress
+			--force --ignore-skip-worktree-bits --ignore-other-worktrees
+			--recurse-submodules --no-recurse-submodules
 			"
 		;;
 	*)
-- 
2.15.0.rc0.245.g6d586db062


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

* Re: [PATCH v1 1/1] completion: add remaining flags to checkout
  2017-10-12 12:20 [PATCH v1 1/1] completion: add remaining flags to checkout Thomas Braun
@ 2017-10-12 16:50 ` Johannes Sixt
  2017-10-12 20:30   ` Johannes Sixt
  0 siblings, 1 reply; 3+ messages in thread
From: Johannes Sixt @ 2017-10-12 16:50 UTC (permalink / raw)
  To: Thomas Braun; +Cc: git, gitster

Am 12.10.2017 um 14:20 schrieb Thomas Braun:
> In the commits 1d0fa898 (checkout: add --ignore-other-wortrees,
> 2015-01-03), 1fc458d9 (builtin/checkout: add --recurse-submodules switch,
> 2017-03-14), 870ebdb9 (checkout: add --progress option, 2015-11-01),
> 08d595dc (checkout: add --ignore-skip-worktree-bits in sparse checkout
> mode, 2013-04-13), 1d0fa898 (checkout: add --ignore-other-wortrees,
> 2015-01-03), 32669671 (checkout: introduce --detach synonym for "git
> checkout foo^{commit}", 2011-02-08) and db941099 (checkout -f: allow
> ignoring unmerged paths when checking out of the index, 2008-08-30)
> checkout gained new flags but the completion was not updated, although
> these flags are useful completions. Add them.
> 
> Signed-off-by: Thomas Braun <thomas.braun@virtuell-zuhause.de>
> ---
>   contrib/completion/git-completion.bash | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
> index d934417475..393d4ae230 100644
> --- a/contrib/completion/git-completion.bash
> +++ b/contrib/completion/git-completion.bash
> @@ -1250,7 +1250,9 @@ _git_checkout ()
>   	--*)
>   		__gitcomp "
>   			--quiet --ours --theirs --track --no-track --merge
> -			--conflict= --orphan --patch
> +			--conflict= --orphan --patch --detach --progress --no-progress
> +			--force --ignore-skip-worktree-bits --ignore-other-worktrees

Destructive and dangerous options are typically not offered by command 
completion. You should omit all three in the line above, IMO.

Furthermore, --progress and --no-progress are not useful in daily work 
on the command line, I think. By offering them, --p<TAB> would not 
complete to --patch anymore, you would need --pa<TAB>. You should omit 
them, too.

> +			--recurse-submodules --no-recurse-submodules
>   			"
>   		;;
>   	*)
> 

-- Hannes

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

* Re: [PATCH v1 1/1] completion: add remaining flags to checkout
  2017-10-12 16:50 ` Johannes Sixt
@ 2017-10-12 20:30   ` Johannes Sixt
  0 siblings, 0 replies; 3+ messages in thread
From: Johannes Sixt @ 2017-10-12 20:30 UTC (permalink / raw)
  To: Thomas Braun; +Cc: git, gitster

Am 12.10.2017 um 18:50 schrieb Johannes Sixt:
> Am 12.10.2017 um 14:20 schrieb Thomas Braun:
>> +            --force --ignore-skip-worktree-bits --ignore-other-worktrees
> 
> Destructive and dangerous options are typically not offered by command 
> completion. You should omit all three in the line above, IMO.

Ah, no, only --force and --ignore-other-worktrees are dangerous, 
--ignore-skip-worktree-bits is not.

-- Hannes

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

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-12 12:20 [PATCH v1 1/1] completion: add remaining flags to checkout Thomas Braun
2017-10-12 16:50 ` Johannes Sixt
2017-10-12 20:30   ` Johannes Sixt

git@vger.kernel.org mailing list mirror (one of many)

Archives are clonable:
	git clone --mirror https://public-inbox.org/git
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.version-control.git
	nntp://ou63pmih66umazou.onion/inbox.comp.version-control.git
	nntp://czquwvybam4bgbro.onion/inbox.comp.version-control.git
	nntp://hjrcffqmbrq6wope.onion/inbox.comp.version-control.git
	nntp://news.gmane.org/gmane.comp.version-control.git

 note: .onion URLs require Tor: https://www.torproject.org/
       or Tor2web: https://www.tor2web.org/

AGPL code for this site: git clone https://public-inbox.org/ public-inbox