git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/7] completion bash: add more options and commands
@ 2017-01-22 22:57 bitte.keine.werbung.einwerfen
  2017-01-22 22:57 ` [PATCH 1/7] completion: teach options to submodule subcommands bitte.keine.werbung.einwerfen
                   ` (7 more replies)
  0 siblings, 8 replies; 42+ messages in thread
From: bitte.keine.werbung.einwerfen @ 2017-01-22 22:57 UTC (permalink / raw)
  To: git; +Cc: thomas.braun, szeder, john, Cornelius Weig

From: Cornelius Weig <cornelius.weig@tngtech.com>

The cli interface for git has the greatest versatility of all git tools.
Its productivity depends on how easy it is to type commands and to remember
options. The command line completion helps two-fold by easing input and
displaying possible options.

Bash completion lacks support for several options and some useful commands.
Although the selection of recognized options is always opinionated (e.g. the
documentation for git-completion.bash says that 'common' long options are
recognized), I think that extending the cli completion will always increase the
productivity.

To that end, the following commits add completion support for several existing
options and subcommands. For every command all options that are mentioned in
the introduction of its man page should now be available for completion.

Cornelius Weig (7):
  completion: teach options to submodule subcommands
  completion: add subcommand completion for rerere
  completion: improve bash completion for git-add
  completion: teach ls-remote to complete options
  completion: teach replace to complete options
  completion: teach remote subcommands option completion
  completion: recognize more long-options

 contrib/completion/git-completion.bash | 132 +++++++++++++++++++++++++++------
 1 file changed, 110 insertions(+), 22 deletions(-)

-- 
2.10.2


^ permalink raw reply	[flat|nested] 42+ messages in thread
* [PATCH v2 0/7] completion bash: add more options and commands
@ 2017-02-03 11:01 cornelius.weig
  2017-02-03 11:01 ` [PATCH v2 7/7] completion: recognize more long-options cornelius.weig
  0 siblings, 1 reply; 42+ messages in thread
From: cornelius.weig @ 2017-02-03 11:01 UTC (permalink / raw)
  To: git; +Cc: szeder.dev, j6t, Cornelius Weig

From: Cornelius Weig <cornelius.weig@tngtech.com>

This is the re-roll of patch series <20170122225724.19360-1-cornelius.weig@tngtech.com>.

This patch series adds all long-options that are mentioned in the synopsis of
the man-page for the respective git-command. There are only a few exceptions,
as discussed in the above thread. For example, no unsafe options should be
completed.
Furthermore, the patches add subommand option completion for git-submodule and
git-remote.

Changes wrt first submission:

 - improve completion for git-remote set-head & set-branches
 - remove completion of unsafe options
 - improve commit messages
 - added sign-off :)
 - rebase to current master

Cornelius Weig (7):
  completion: teach submodule subcommands to complete options
  completion: add subcommand completion for rerere
  completion: improve bash completion for git-add
  completion: teach ls-remote to complete options
  completion: teach replace to complete options
  completion: teach remote subcommands to complete options
  completion: recognize more long-options

 contrib/completion/git-completion.bash | 139 ++++++++++++++++++++++++++++-----
 1 file changed, 118 insertions(+), 21 deletions(-)


Interdiff since first iteration:
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 87d3d2c..3545f6a 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -936,7 +936,7 @@ _git_apply ()
 			--apply --no-add --exclude=
 			--ignore-whitespace --ignore-space-change
 			--whitespace= --inaccurate-eof --verbose
-			--recount --directory= --unsafe-paths
+			--recount --directory=
 			"
 		return
 	esac
@@ -1459,7 +1459,7 @@ _git_ls_remote ()
 {
 	case "$cur" in
 	--*)
-		__gitcomp "--heads --tags --refs --get-url"
+		__gitcomp "--heads --tags --refs --get-url --symref"
 		return
 		;;
 	esac
@@ -2415,9 +2415,18 @@ _git_remote ()
 		;;
 	add,*)
 		;;
+	set-head,--*)
+		__gitcomp "--auto --delete"
+		;;
+	set-branches,--*)
+		__gitcomp "--add"
+		;;
 	set-head,*|set-branches,*)
 		__git_complete_remote_or_refspec
 		;;
+	update,--*)
+		__gitcomp "--prune"
+		;;
 	update,*)
 		__gitcomp "$(__git_get_config_variables "remotes")"
 		;;
@@ -2494,7 +2503,7 @@ _git_rm ()
 {
 	case "$cur" in
 	--*)
-		__gitcomp "--cached --dry-run --ignore-unmatch --quiet --force"
+		__gitcomp "--cached --dry-run --ignore-unmatch --quiet"
 		return
 		;;
 	esac

-- 
2.10.2


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

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

Thread overview: 42+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-22 22:57 [PATCH 0/7] completion bash: add more options and commands bitte.keine.werbung.einwerfen
2017-01-22 22:57 ` [PATCH 1/7] completion: teach options to submodule subcommands bitte.keine.werbung.einwerfen
2017-01-22 22:57 ` [PATCH 2/7] completion: add subcommand completion for rerere bitte.keine.werbung.einwerfen
2017-02-02  0:57   ` SZEDER Gábor
2017-02-02  9:16     ` Cornelius Weig
2017-01-22 22:57 ` [PATCH 3/7] completion: improve bash completion for git-add bitte.keine.werbung.einwerfen
2017-01-22 22:57 ` [PATCH 4/7] completion: teach ls-remote to complete options bitte.keine.werbung.einwerfen
2017-02-02  1:40   ` SZEDER Gábor
2017-02-02  9:40     ` Cornelius Weig
2017-02-02 16:57       ` Junio C Hamano
2017-01-22 22:57 ` [PATCH 5/7] completion: teach replace " bitte.keine.werbung.einwerfen
2017-01-22 22:57 ` [PATCH 6/7] completion: teach remote subcommands option completion bitte.keine.werbung.einwerfen
2017-02-02  1:37   ` SZEDER Gábor
2017-02-02 10:29     ` Cornelius Weig
2017-01-22 22:57 ` [PATCH 7/7] completion: recognize more long-options bitte.keine.werbung.einwerfen
2017-01-24  7:15   ` Johannes Sixt
2017-01-24  8:14     ` Cornelius Weig
2017-01-24 23:24       ` Junio C Hamano
2017-01-24 23:33         ` Cornelius Weig
2017-01-24 23:43           ` Stefan Beller
2017-01-25  0:11             ` Cornelius Weig
2017-01-25  0:21               ` Stefan Beller
2017-01-25  0:43                 ` Cornelius Weig
2017-01-25  0:52                   ` Re: Stefan Beller
2017-01-25  0:54                 ` Re: Linus Torvalds
2017-01-25  1:32                   ` Re: Eric Wong
2017-01-25  6:54                 ` SubmittingPatches: drop temporal reference for PGP signing Philip Oakley
2017-01-25 22:38                   ` Stefan Beller
2017-01-26 13:30                     ` Cornelius Weig
2017-01-26 17:57                       ` Stefan Beller
2017-01-26 18:18                       ` Junio C Hamano
2017-01-26 20:58                         ` Philip Oakley
2017-01-27 10:49                           ` Cornelius Weig
2017-01-27 17:43                             ` Junio C Hamano
2017-01-27 21:17     ` [PATCH v2 0/7] completion: recognize more long-options cornelius.weig
2017-01-27 21:17       ` [PATCH v2 7/7] " cornelius.weig
2017-01-31 22:17         ` SZEDER Gábor
2017-02-01 16:49           ` Cornelius Weig
2017-02-02  2:00             ` SZEDER Gábor
2017-02-02 10:40               ` Cornelius Weig
2017-01-31 22:42 ` [PATCH 3/7] completion: improve bash completion for git-add SZEDER Gábor
2017-02-03 11:01 [PATCH v2 0/7] completion bash: add more options and commands cornelius.weig
2017-02-03 11:01 ` [PATCH v2 7/7] completion: recognize more long-options cornelius.weig

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 NNTP newsgroup(s).