Re: [PATCH v2] completion: adapt git-config(1) to complete subcommands

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, May 17, 2024 at 06:27:54PM +0200, Rubén Justo wrote:
> On Fri, May 17, 2024 at 08:13:36AM +0200, Patrick Steinhardt wrote:
[snip]
> I wonder, if we might consider the possibility of having "list" as
> a default command:
> 
> -	subcommand="$(__git_find_subcommand "$subcommands")"
> +	subcommand="$(__git_find_subcommand "$subcommands" list)"
> 
> These lines are only meant to express the idea, as other changes are
> also necessary and the documentation needs to be updated.  Of course, it
> could be done in a future series.
> 
> I think that "git config -h" is an intuitive enough way to offer the
> help text and that using 'git config' as a shortcut for 'git config
> list' can be convenient.

Hm. I don't really know whether it is sensible to second-guess what the
user wants to do. They may want to list variables, but they may just as
well not want to do that. I myself use tab completion to learn about
which subcommands exist quite often, even though there is `-h` to do
that for me. So I think I lean more towards not having a default
subcommand here.

> By the way, having used '__git_find_subcommand' instead of
> '__git_find_on_cmdline' is reassuring when it comes to having a default
> subcommand :-)
> 
> Anyway, as I said, this series looks good to me.  Thanks!

Thanks for your review!

Patrick

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux