Re: [PATCH] bash completion: offer more options for gitk
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 15, 2009, 09:33 UTC
- Message-ID
- <7vfxigniws.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <1234641270-14342-1-git-send-email-trast@student.ethz.ch>
Thomas Rast <trast@student.ethz.ch> writes:
Show 13 quoted lines
> Add some more git-log options to the gitk completion. Not all of them > make sense, unfortunately. > > Signed-off-by: Thomas Rast <trast@student.ethz.ch> > --- > > 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.
Show 9 quoted lines
> + __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.
Show 5 quoted lines
> return > ;; > esac > -- > 1.6.2.rc0.293.g947001