]> git.ipfire.org Git - thirdparty/git.git/commitdiff
completion: improve doc for complex aliases
authorPhilippe Blain <levraiphilippeblain@gmail.com>
Tue, 12 Sep 2023 17:02:15 +0000 (17:02 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 13 Sep 2023 00:46:01 +0000 (17:46 -0700)
The completion code can be told to use a particular completion for
aliases that shell out by using ': git <cmd> ;' as the first command of
the alias. This only works if <cmd> and the semicolon are separated by a
space, since if the space is missing __git_aliased_command returns (for
example) 'checkout;' instead of just 'checkout', and then
__git_complete_command fails to find a completion for 'checkout;'.

The examples have that space but it's not clear if it's just for
style or if it's mandatory. Explicitly mention it.

Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/completion/git-completion.bash

index 133ec92bfae72186721b4a51c50922f6d542be80..19139ac12163e487f8a54f28201e157ce1f60ea2 100644 (file)
@@ -28,6 +28,7 @@
 # completion style.  For example '!f() { : git commit ; ... }; f' will
 # tell the completion to use commit completion.  This also works with aliases
 # of form "!sh -c '...'".  For example, "!sh -c ': git commit ; ... '".
+# Be sure to add a space between the command name and the ';'.
 #
 # If you have a command that is not part of git, but you would still
 # like completion, you can use __git_complete: