Subject: Re: [PATCH] bash completion: offer more options for gitk

From: Junio C Hamano <[email-masked]>
Date: Sun, 15 Feb 2009 01:33:55 -0800

Thomas Rast <[email-masked]> writes:

> Add some more git-log options to the gitk completion.  Not all of them
> make sense, unfortunately.
>
> Signed-off-by: Thomas Rast <[email-masked]>
> ---
>
> I was simply too lazy to keep typing --simplify-by-decoration.
>
> I made two passes over the git-log manpage and simply selected all
> options that seemed to make sense, _seemed_ to work, and that didn't
> mangle the history view in horrible ways (such as disconnecting it
> into little pieces).  It does handle --left-right correctly, very
> nice!

The --left-right support in gitk was done in tandem with the low-level
support.

> +		__gitcomp "
> +			--not --all $merge
> +			--branches --tags --remotes
> +			--first-parent
> +			--dense --sparse --full-history
> +			--simplify-merges --simplify-by-decoration
> +			--since= --after= --until= --before=
> +			--left-right
> +			"

Many options you add here are useful for git-log and not present in its
completion, but as you point out not all git-log options necessarily make
sense for gitk.  I think it would make sense to introduce an extra
variable $__git_log_basic_options that holds the basic ones that can be in
both, and add the ones that are specific to gitk or git-log in their own
completion functions.  I suspect gitk's addition will be nil, while
git-log would add --graph, --walk-reflogs and --no-merges to the basic
set.

>  		return
>  		;;
>  	esac
> -- 
> 1.6.2.rc0.293.g947001