Skip to content

Commit 2675ea1

Browse files
szedergitster
authored andcommitted
completion: use 'sort -u' to deduplicate config variable names
The completion script runs the classic '| sort | uniq' pipeline to deduplicate the output of 'git help --config-for-completion'. 'sort -u' does the same, but uses one less external process and pipeline stage. Not a bit win, as it's only run once as the list of supported configuration variables is initialized, but at least it sets a better example for others to follow. Signed-off-by: SZEDER Gábor <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent d943887 commit 2675ea1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

contrib/completion/git-completion.bash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2225,7 +2225,7 @@ __git_config_vars=
22252225
__git_compute_config_vars ()
22262226
{
22272227
test -n "$__git_config_vars" ||
2228-
__git_config_vars="$(git help --config-for-completion | sort | uniq)"
2228+
__git_config_vars="$(git help --config-for-completion | sort -u)"
22292229
}
22302230

22312231
_git_config ()

0 commit comments

Comments
 (0)