From: Junio C Hamano Date: Mon, 12 Feb 2024 21:16:10 +0000 (-0800) Subject: Merge branch 'bk/complete-bisect' X-Git-Tag: v2.44.0-rc1~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=46761378c3ba8915fd5a52995c8f6c1a847bed84;p=thirdparty%2Fgit.git Merge branch 'bk/complete-bisect' Command line completion support (in contrib/) has been updated for "git bisect". * bk/complete-bisect: completion: bisect: recognize but do not complete view subcommand completion: bisect: complete log opts for visualize subcommand completion: new function __git_complete_log_opts completion: bisect: complete missing --first-parent and - -no-checkout options completion: bisect: complete custom terms and related options completion: bisect: complete bad, new, old, and help subcommands completion: tests: always use 'master' for default initial branch name --- 46761378c3ba8915fd5a52995c8f6c1a847bed84 diff --cc contrib/completion/git-completion.bash index c3408d4143,0734debc11..1a7bc05a72 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@@ -2105,13 -2100,15 +2144,15 @@@ __git_diff_merges_opts="off none on fir __git_log_pretty_formats="oneline short medium full fuller reference email raw format: tformat: mboxrd" __git_log_date_formats="relative iso8601 iso8601-strict rfc2822 short local default human raw unix auto: format:" - _git_log () + # Complete porcelain (i.e. not git-rev-list) options and at least some + # option arguments accepted by git-log. Note that this same set of options + # are also accepted by some other git commands besides git-log. + __git_complete_log_opts () { - __git_has_doubledash && return - __git_find_repo_path + COMPREPLY=() local merge="" - if [ -f "$__git_repo_path/MERGE_HEAD" ]; then + if __git_pseudoref_exists MERGE_HEAD; then merge="--merge" fi case "$prev,$cur" in diff --cc t/t9902-completion.sh index 35eb534fdd,70557eb684..d744883d5c --- a/t/t9902-completion.sh +++ b/t/t9902-completion.sh @@@ -5,12 -5,11 +5,17 @@@ test_description='test bash completion' +# The Bash completion scripts must not print anything to either stdout or +# stderr, which we try to verify. When tracing is enabled without support for +# BASH_XTRACEFD this assertion will fail, so we have to mark the test as +# untraceable with such ancient Bash versions. +test_untraceable=UnfortunatelyYes + + # Override environment and always use master for the default initial branch + # name for these tests, so that rev completion candidates are as expected. + GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./lib-bash.sh complete ()