Skip to content

Commit 4333267

Browse files
phil-blaingitster
authored andcommitted
completion: improve doc for complex aliases
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 43c8a30 commit 4333267

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

contrib/completion/git-completion.bash

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
# completion style. For example '!f() { : git commit ; ... }; f' will
2929
# tell the completion to use commit completion. This also works with aliases
3030
# of form "!sh -c '...'". For example, "!sh -c ': git commit ; ... '".
31+
# Be sure to add a space between the command name and the ';'.
3132
#
3233
# If you have a command that is not part of git, but you would still
3334
# like completion, you can use __git_complete:

0 commit comments

Comments
 (0)