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=-3.6 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 0E0B51F4CE for ; Thu, 7 Apr 2022 22:44:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232281AbiDGWpR (ORCPT ); Thu, 7 Apr 2022 18:45:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37414 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232297AbiDGWpO (ORCPT ); Thu, 7 Apr 2022 18:45:14 -0400 Received: from pb-smtp1.pobox.com (pb-smtp1.pobox.com [64.147.108.70]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F89C154715 for ; Thu, 7 Apr 2022 15:43:12 -0700 (PDT) Received: from pb-smtp1.pobox.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id 6609810D827; Thu, 7 Apr 2022 18:43:11 -0400 (EDT) (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; s=sasl; bh=JIQiLXVZmtETJk5TlpjxuVfKLzq6hCQgenl3gH qxLlY=; b=pi91ZIRDQ+rC0OE1NSxZwL3JLHNURkIHe9Y35hzoR2VDfXjPsDGrrg oTG9k17R5ilopbW6ELx0JeHYojF8alrN/Vx+K+URchMpKceSLH0h4XRq+uCvrg0G NV1Qqr3Z3GT+7aNfRR8IR8VYr/BCaNlOyGZDduC5rQKkkY0CCfkkE= Received: from pb-smtp1.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id 5D29910D825; Thu, 7 Apr 2022 18:43:11 -0400 (EDT) (envelope-from junio@pobox.com) Received: from pobox.com (unknown [35.230.65.123]) (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 C95B010D821; Thu, 7 Apr 2022 18:43:10 -0400 (EDT) (envelope-from junio@pobox.com) From: Junio C Hamano To: Johannes Schindelin Cc: Danny Lin , git develop Subject: Re: [PATCH] git-prompt: fix sequencer/todo detection References: <20220325145301.3370-1-danny0838@gmail.com> Date: Thu, 07 Apr 2022 15:43:09 -0700 In-Reply-To: (Johannes Schindelin's message of "Thu, 7 Apr 2022 23:45:20 +0200 (CEST)") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Pobox-Relay-ID: 1A0AA536-B6C4-11EC-8016-5E84C8D8090B-77302942!pb-smtp1.pobox.com Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Johannes Schindelin writes: >> > diff --git a/contrib/completion/git-prompt.sh b/contrib/completion/git-prompt.sh >> > index db7c0068fb..8ae341a306 100644 >> > --- a/contrib/completion/git-prompt.sh >> > +++ b/contrib/completion/git-prompt.sh >> > @@ -315,7 +315,7 @@ __git_sequencer_status () >> > elif __git_eread "$g/sequencer/todo" todo >> > then >> > case "$todo" in >> > - p[\ \ ]|pick[\ \ ]*) >> > + p[\ \ ]*|pick[\ \ ]*) >> > r="|CHERRY-PICKING" >> > return 0 >> > ;; >> ... > > It looks to me as if the abbreviated commands cannot be generated by Git > (the `replay_opts` in `builtin/revert.c` are all initialized to > `REPLAY_OPTS_INIT`, so there is not even any chance of uninitialized data > there). Good. Then the right "fix" would be to drop the misleading "We would also accept the abbreviated" side of the case arm, instead of fixing "if we were generating the abbreviated one, here is how we might support it" code, I guess. Thanks for sanity-checking my digging in the sequencer.c code.