threads / discuss / 38300

Tab completion missing for --includes and branch description in git config

Subject: Tab completion missing for --includes and branch description in git config

## tl;dr

2 messages between Jan 7, 2015 and Jan 7, 2015.

replies: 1people: 2as markdown or json

Michael Paquier· Jan 7, 2015, 00:58 UTC · lore
Hi all,
While toying with the tab completion script for bash, I found a couple
of things missing that cannot be completed:
- git config --includes
- git config branch.$BRANCH_NAME.description
Attached are trivial patches based on master to fix those things.
Regards,
-- 
Michael


From cc463975e4a21dc523fa920db813eada881a0ccd Mon Sep 17 00:00:00 2001
From: Michael Paquier <michael@otacoo.com>
Date: Wed, 7 Jan 2015 09:43:29 +0900
Subject: [PATCH 1/2] Identify --includes for git config in tab completion

Signed-off-by: Michael Paquier <michael@otacoo.com>
---
 contrib/completion/git-completion.bash | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 23988ec..d6b0754 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1891,7 +1891,7 @@ _git_config ()
 	--*)
 		__gitcomp "
 			--system --global --local --file=
-			--list --replace-all
+			--includes --list --replace-all
 			--get --get-all --get-regexp
 			--add --unset --unset-all
 			--remove-section --rename-section
-- 
2.2.1



From c2323d093b3a3a9daf0cf7e17dddff6bc028bd0e Mon Sep 17 00:00:00 2001
From: Michael Paquier <michael@otacoo.com>
Date: Wed, 7 Jan 2015 09:48:10 +0900
Subject: [PATCH 2/2] Identify description for git config in tab completion

Signed-off-by: Michael Paquier <michael@otacoo.com>
---
 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 d6b0754..412f74b 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1900,7 +1900,9 @@ _git_config ()
 		;;
 	branch.*.*)
 		local pfx="${cur%.*}." cur_="${cur##*.}"
-		__gitcomp "remote pushremote merge mergeoptions rebase" "$pfx" "$cur_"
+		__gitcomp "
+			description remote pushremote merge mergeoptions rebase
+			" "$pfx" "$cur_"
 		return
 		;;
 	branch.*)
-- 
2.2.1
Stefan Beller· Jan 7, 2015, 18:14 UTC · re: Michael Paquier · lore

Re: Tab completion missing for --includes and branch description in git config

On Tue, Jan 6, 2015 at 4:58 PM, Michael Paquier <michael.paquier@gmail.com> wrote:

Show 10 quoted lines
> Hi all,
>
> While toying with the tab completion script for bash, I found a couple
> of things missing that cannot be completed:
> - git config --includes
> - git config branch.$BRANCH_NAME.description
> Attached are trivial patches based on master to fix those things.
> Regards,
> --
> Michael
Thanks for your effort on improving git!

Please have a look at Documentation/SubmittingPatches in git[1], specially section "(4) Sending your patches." so discussion on the patches is easier.

Show 10 quoted lines
>Do not attach the patch as a MIME attachment, compressed or not.
>Do not let your e-mail client send quoted-printable.  Do not let
>your e-mail client send format=flowed which would destroy
>whitespaces in your patches. Many
>popular e-mail applications will not always transmit a MIME
>attachment as plain text, making it impossible to comment on
>your code.  A MIME attachment also takes a bit more time to
>process.  This does not decrease the likelihood of your
>MIME-attached change being accepted, but it makes it more likely
>that it will be postponed.

The easiest way to comply with all these rules outlined in SubmittingPatches is to use git format-patch and git send-email (as they follow the best practice).

I recently wrote about my experiences when sending patches to the git mailing list, including how to configure git send-email[2], maybe that helps.

Thanks, Stefan

[1] for example it can be found at https://raw.githubusercontent.com/git/git/master/Documentation/SubmittingPatches

[2]http://thread.gmane.org/gmane.comp.version-control.git/261900

← back to recent threads