From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS3215 2.6.0.0/16 X-Spam-Status: No, score=0.9 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by dcvr.yhbt.net (Postfix) with ESMTP id 5FE721F852 for ; Sun, 6 Feb 2022 20:09:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243308AbiBFUJi (ORCPT ); Sun, 6 Feb 2022 15:09:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53082 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231982AbiBFUJh (ORCPT ); Sun, 6 Feb 2022 15:09:37 -0500 Received: from pb-smtp1.pobox.com (pb-smtp1.pobox.com [64.147.108.70]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 42E0CC043184 for ; Sun, 6 Feb 2022 12:09:37 -0800 (PST) Received: from pb-smtp1.pobox.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id 9516610FD9A; Sun, 6 Feb 2022 15:09:36 -0500 (EST) (envelope-from junio@pobox.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; s=sasl; bh=2e84XM7KDFMo szCbStr7Sv7m+L/HKn6a7qjbTl7WeQY=; b=PAZ1mSqcFLYGZEpKujIVd0r5vf41 5OEsmf+Hcv0lOocpg9lKd4mkLykr7qb20uqp8U04bAa9gklZAc6D1QM2vfvT6dwt JAjLxySAtLHc0R8nivafMqbtgLIPNmW9SvWMUMR8JwqB9wbJXeR5jKH9xnwTi5g/ +cM0C4bJpAn577U= Received: from pb-smtp1.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id 8BA6610FD98; Sun, 6 Feb 2022 15:09:36 -0500 (EST) (envelope-from junio@pobox.com) Received: from pobox.com (unknown [34.145.213.122]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp1.pobox.com (Postfix) with ESMTPSA id 1553B10FD97; Sun, 6 Feb 2022 15:09:36 -0500 (EST) (envelope-from junio@pobox.com) From: Junio C Hamano To: SZEDER =?utf-8?Q?G=C3=A1bor?= Cc: =?utf-8?B?w4Z2YXIgQXJuZmrDtnLDsA==?= Bjarmason , git@vger.kernel.org, Hongyi Zhao , Philippe Blain , =?utf-8?Q?Jo=C3=A3o?= Victor Bonfim Subject: Re: [PATCH v2 2/2] completion: add a GIT_COMPLETION_SHOW_ALL_COMMANDS References: <20220206133026.GB1936@szeder.dev> Date: Sun, 06 Feb 2022 12:09:35 -0800 In-Reply-To: <20220206133026.GB1936@szeder.dev> ("SZEDER =?utf-8?Q?G=C3=A1?= =?utf-8?Q?bor=22's?= message of "Sun, 6 Feb 2022 14:30:26 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 X-Pobox-Relay-ID: B4D91694-8788-11EC-9A36-5E84C8D8090B-77302942!pb-smtp1.pobox.com Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org SZEDER G=C3=A1bor writes: > To complete only rarely used plumbing commands in a non-intrusive way, > in my experience, it's best to first attempt to complete only > porcelains and aliases, and fall back to complete all commands, > plumbing included, only when no porcelains match the current word to > be completed. E.g.: > > $ git d > describe diff difftool > $ git diff- > diff-files diff-index diff-tree So after getting $ git diff diff difftool you _have_ to know, if you are not happy with these two, that the next letter in the name of the command you forgot is a dash, to be able to say $ git diff- which is a bit unfortunate, but I agree that it is much nicer than getting all the plumbing when trying to complete "git d". I wonder if we can do better, and teach the completion logic an ability to say this: "I gave 'diff and difftool' after being asked for 'git diff' and then the user is asking the same again without choosing either. Perhaps I should add less frequent one to the mix"? I.e. the end-user session may look like $ git diff diff difftool $ git diff diff difftool diff-files diff-index diff-tree ?