Skip to content

git-completion.bash: fixes on top of 'dl/complete-stash'

Denton Liu git 2 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest4 patches 0 repliesNew
  2. v15 patches 7 repliesSuperseded

Changes in v2 from the cover letter

* Make the commit message for "git-completion.bash: rename to $__git_cmd_idx" descriptive and accurate

* Drop "git-completion.bash: consolidate no-subcommand case for _git_stash()"

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4git-completion.bash: separate some commands onto their own linecontrib/completion/git-completion.bash+28 -90 replies
2/4git-completion.bash: rename to $__git_cmd_idxcontrib/completion/git-completion.bash+10 -100 replies
3/4git-completion.bash: use $__git_cmd_idx in more placescontrib/completion/git-completion.bash t/t9902-completion.sh+33 -120 replies
4/4git-completion.bash: consolidate cases in _git_stash()contrib/completion/git-completion.bash+2 -190 replies

Reviews trailers per patch

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

Read the v2 thread

Cover letter [PATCH v2 0/4] git-completion.bash: fixes on top of 'dl/complete-stash'

Gábor pointed out some potential fixes what's currently queued in 'dl/complete-stash'[0][1][2][3]. This series addresses those concerns.

Changes since v1:

* Make the commit message for "git-completion.bash: rename to $__git_cmd_idx" descriptive and accurate

* Drop "git-completion.bash: consolidate no-subcommand case for _git_stash()"

[0]: https://lore.kernel.org/git/[email protected]/
[1]: https://lore.kernel.org/git/[email protected]/
[2]: https://lore.kernel.org/git/[email protected]/
[3]: https://lore.kernel.org/git/[email protected]/

Denton Liu (4):
git-completion.bash: separate some commands onto their own line git-completion.bash: rename to $__git_cmd_idx git-completion.bash: use $__git_cmd_idx in more places git-completion.bash: consolidate cases in _git_stash()

 contrib/completion/git-completion.bash | 98 ++++++++++++++------------
 t/t9902-completion.sh                  | 19 +++++
 2 files changed, 70 insertions(+), 47 deletions(-)

Range-diff against v1:

1:  65c485ea0c = 1:  65c485ea0c git-completion.bash: separate some commands onto their own line
2:  7c7d6de380 ! 2:  76328e3123 git-completion.bash: rename to $__git_cmd_idx

@@ Commit message

In e94fb44042 (git-completion.bash: pass $__git_subcommand_idx from __git_main(), 2021-03-24), the $__git_subcommand_idx variable was
- introduced. Naming it after the index of the subcommand is flat-out
- wrong as this variable really holds the index of the git comand (e.g.
- "stash").
+ introduced. Naming it after the index of the subcommand is needlessly
+ confusing as, when this variable is used, it is in the completion
+ functions for commands (e.g. _git_remote()) where for git remote add,
+ the remote is referred to as the command and add is referred to as
+ the subcommand.

Rename this variable so that it's obvious it's about git commands. While we're at it, shorten up its name so that it's still readable without

3:  63a6992585 = 3:  70fda62db1 git-completion.bash: use $__git_cmd_idx in more places
4:  4f8d015d54 = 4:  103d38e293 git-completion.bash: consolidate cases in _git_stash()
5:  b4a9b0afa7 < -:  ---------- git-completion.bash: consolidate no-subcommand case for _git_stash()
Signature · 1 line
2.31.1.499.g90b4fd31cd