Skip to content

completion bash: add more options and commands

[email protected] git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest7 patches 2 repliesIn review

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7completion: teach submodule subcommands to complete optionscontrib/completion/git-completion.bash+30 -20 replies
2/7completion: add subcommand completion for rererecontrib/completion/git-completion.bash+11 -00 replies
3/7completion: improve bash completion for git-addcontrib/completion/git-completion.bash+7 -30 replies
4/7completion: teach ls-remote to complete optionscontrib/completion/git-completion.bash+6 -00 replies
5/7completion: teach replace to complete optionscontrib/completion/git-completion.bash+6 -00 replies
6/7completion: teach remote subcommands to complete optionscontrib/completion/git-completion.bash+38 -70 replies
7/7completion: recognize more long-optionscontrib/completion/git-completion.bash+20 -90 replies

Reviews trailers per patch

All 7 patches have a Reviewed-by or Acked-by.

PatchSZEDER GáborJohannes Sixt
1/7R-b
2/7R-b
3/7R-b
4/7R-b
5/7R-b
6/7R-b
7/7R-b Helped-by

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/7] completion bash: add more options and commands

From: Cornelius Weig <[email protected]>

This is the re-roll of patch series <[email protected]>.

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:

contrib/completion/git-completion.bash +12 -3
index 87d3d2c..3545f6a 100644
@@ -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
Signature · 1 line
2.10.2