Skip to content

completion.commands: fix multiple command removals

Todd Zullinger git 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest4 patches 3 repliesIn review
  2. v24 patches 1 replySuperseded

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4git: read local config in --list-cmdsgit.c help.c+7 -70 replies
2/4t9902: test multiple removals via completion.commandst/t9902-completion.sh+6 -00 replies
3/4completion: fix multiple command removalshelp.c t/t9902-completion.sh+3 -30 replies
4/4completion: use __git when calling --list-cmdscontrib/completion/git-completion.bash+4 -40 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCH v3 0/4] completion.commands: fix multiple command removals

Hi,

Quoted 2 lines · Duy Nguyen

You probably want to drop the comment block about repository setup inside list_cmds_by_config() too.

You're right, of course. Thanks Duy. :)

That's the only change since v2.

Other than a follow-up to update the commit reference in 4/4 after 1/4 is in the final form on pu, I think this might be good. If it's easier, we can skip 4/4 and I'll resend it after the others are on pu.

Jeff King (2):
git: read local config in --list-cmds
completion: fix multiple command removals

Todd Zullinger (2):
t9902: test multiple removals via completion.commands
completion: use __git when calling --list-cmds

 contrib/completion/git-completion.bash |  8 ++++----
 git.c                                  |  7 +++++++
 help.c                                 | 11 ++---------
 t/t9902-completion.sh                  |  6 ++++++
 4 files changed, 19 insertions(+), 13 deletions(-)

Range-diff against v2:
1: e51bdea6d3 ! 1: 6e9872b0e3 git: read local config in --list-cmds
@@ -33,3 +33,21 @@

while (*spec) {
const char *sep = strchrnul(spec, ',');
+
+ diff --git a/help.c b/help.c
+ --- a/help.c
+ +++ b/help.c
+@@
+ {
+ const char *cmd_list;
+
+- /*
+- * There's no actual repository setup at this point (and even
+- * if there is, we don't really care; only global config
+- * matters). If we accidentally set up a repository, it's ok
+- * too since the caller (git --list-cmds=) should exit shortly
+- * anyway.
+- */
+ if (git_config_get_string_const("completion.commands", &cmd_list))
+ return;
+

2:  2f5e9da9de = 2:  6873ae3868 t9902: test multiple removals via completion.commands
3:  7548dcc23f = 3:  f66bbc0b55 completion: fix multiple command removals
4:  26bef0b2af = 4:  197b176483 completion: use __git when calling --list-cmds