From: Felipe Contreras <hidden> Date: 2021-08-16 09:10:29
These should be pretty obvious and straightforward.
This is exactly the same as v3, which has been sent 4 times, and already
included the minor adjustment to the commit message of one patch as
suggested by SZEDER Gábor, which was done nine minutes after in June 8,
but for some reason they had trouble getting into 'seen'. So I'm sending
it yet again.
Felipe Contreras (4):
completion: bash: fix prefix detection in branch.*
completion: bash: fix for suboptions with value
completion: bash: fix for multiple dash commands
completion: bash: add correct suffix in variables
contrib/completion/git-completion.bash | 14 +++++++-------
t/t9902-completion.sh | 15 +++++++++++++++
2 files changed, 22 insertions(+), 7 deletions(-)
Range-diff:
1: 4b73b26338 = 1: e699c8be36 completion: bash: fix prefix detection in branch.*
2: cb2fc1a7f2 = 2: 7e800faaf1 completion: bash: fix for suboptions with value
3: ece06463a2 = 3: 523906fe1a completion: bash: fix for multiple dash commands
4: f9db132cbd = 4: 1cb7457af9 completion: bash: add correct suffix in variables
--
2.32.0.48.g096519100f
From: Felipe Contreras <hidden> Date: 2021-08-16 09:10:30
Otherwise we are completely ignoring the --cur argument.
The issue can be tested with:
git clone --config=branch.<tab>
Reviewed-by: SZEDER Gábor <redacted>
Tested-by: David Aguilar <redacted>
Signed-off-by: Felipe Contreras <redacted>
---
contrib/completion/git-completion.bash | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
From: Felipe Contreras <hidden> Date: 2021-08-16 09:10:34
Otherwise options of commands like 'for-each-ref' are not completed.
Tested-by: David Aguilar <redacted>
Signed-off-by: Felipe Contreras <redacted>
---
contrib/completion/git-completion.bash | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
From: Felipe Contreras <hidden> Date: 2021-08-16 09:10:34
We need to ignore options that don't start with -- as well.
Depending on the value of COMP_WORDBREAKS the last word could be
duplicated otherwise.
Can be tested with:
git merge -X diff-algorithm=<tab>
Tested-by: David Aguilar <redacted>
Signed-off-by: Felipe Contreras <redacted>
---
contrib/completion/git-completion.bash | 2 +-
t/t9902-completion.sh | 15 +++++++++++++++
2 files changed, 16 insertions(+), 1 deletion(-)
From: Felipe Contreras <hidden> Date: 2021-08-16 09:10:47
__gitcomp automatically adds a suffix, but __gitcomp_nl and others
don't, we need to specify a space by default.
Can be tested with:
git config branch.autoSetupMe<tab>
This fix only works for versions of bash greater than 4.0, before that
"local sfx" creates an empty string, therefore the unset expansion
doesn't work. The same happens in zsh.
Therefore we don't add the test for that for now.
The correct fix for all shells requires semantic changes in __gitcomp,
but that can be done later.
Cc: SZEDER Gábor <redacted>
Tested-by: David Aguilar <redacted>
Signed-off-by: Felipe Contreras <redacted>
---
contrib/completion/git-completion.bash | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)