diff options
| author | Junio C Hamano <gitster@pobox.com> | 2024-02-27 16:04:32 -0800 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-02-27 16:04:32 -0800 |
| commit | f71ed54f4dce1f2c0ccf07fb6bcf0128414272f9 (patch) | |
| tree | dc14c9889a9acc4ef99b7f879a7e0db062622431 | |
| parent | Merge branch 'km/mergetool-vimdiff-layout-fallback' (diff) | |
| parent | completion: use awk for filtering the config entries (diff) | |
| download | git-f71ed54f4dce1f2c0ccf07fb6bcf0128414272f9.tar.gz git-f71ed54f4dce1f2c0ccf07fb6bcf0128414272f9.zip | |
Merge branch 'bb/completion-no-grep-into-awk'
Some parts of command line completion script (in contrib/) have
been micro-optimized.
* bb/completion-no-grep-into-awk:
completion: use awk for filtering the config entries
| -rw-r--r-- | contrib/completion/git-completion.bash | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 444b3efa63..fcf1afd75d 100644 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -2673,7 +2673,8 @@ __git_compute_first_level_config_vars_for_section () __git_compute_config_vars local this_section="__git_first_level_config_vars_for_section_${section}" test -n "${!this_section}" || - printf -v "__git_first_level_config_vars_for_section_${section}" %s "$(echo "$__git_config_vars" | grep -E "^${section}\.[a-z]" | awk -F. '{print $2}')" + printf -v "__git_first_level_config_vars_for_section_${section}" %s \ + "$(echo "$__git_config_vars" | awk -F. "/^${section}\.[a-z]/ { print \$2 }")" } __git_compute_second_level_config_vars_for_section () @@ -2682,7 +2683,8 @@ __git_compute_second_level_config_vars_for_section () __git_compute_config_vars_all local this_section="__git_second_level_config_vars_for_section_${section}" test -n "${!this_section}" || - printf -v "__git_second_level_config_vars_for_section_${section}" %s "$(echo "$__git_config_vars_all" | grep -E "^${section}\.<" | awk -F. '{print $3}')" + printf -v "__git_second_level_config_vars_for_section_${section}" %s \ + "$(echo "$__git_config_vars_all" | awk -F. "/^${section}\.</ { print \$3 }")" } __git_config_sections= |
