summaryrefslogtreecommitdiff
path: root/commit.c
diff options
context:
space:
mode:
authorRubén Justo <rjusto@gmail.com>2024-03-02 15:37:34 +0100
committerJunio C Hamano <gitster@pobox.com>2024-03-03 14:21:38 -0800
commit85452a1d4b582701772b02b5a70b8bf5a82258bc (patch)
treea170e60caf61295e2e89ccc503b46365088d2fc2 /commit.c
parente02ecfcc534e2021aae29077a958dd11c3897e4c (diff)
completion: reflog with implicit "show"
When no subcommand is specified to "reflog", we assume "show" [1]: $ git reflog -h usage: git reflog [show] [<log-options>] [<ref>] ... This implicit "show" is not being completed correctly: $ git checkout -b default $ git reflog def<TAB><TAB> ... no completion options ... The expected result is: $ git reflog default This happens because we're completing references after seeing a valid subcommand in the command line. This prevents the implicit "show" from working properly, but also introduces a new problem: it keeps offering subcommand options when the subcommand is implicit: $ git checkout -b explore $ git reflog default ex<TAB> ... $ git reflog default expire The expected result is: $ git reflog default explore To fix this, complete references even if no subcommand is present, or in other words when the subcommand is implicit "show". Also, only include completion options for subcommands when completing the right position in the command line. 1. cf39f54efc (git reflog show, 2007-02-08) Signed-off-by: Rubén Justo <rjusto@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit.c')
0 files changed, 0 insertions, 0 deletions