From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-3.9 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by dcvr.yhbt.net (Postfix) with ESMTP id DA5A61F47D for ; Sun, 26 Feb 2023 10:29:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229550AbjBZK3f (ORCPT ); Sun, 26 Feb 2023 05:29:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229507AbjBZK3e (ORCPT ); Sun, 26 Feb 2023 05:29:34 -0500 Received: from cloud.peff.net (cloud.peff.net [104.130.231.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 42623269A for ; Sun, 26 Feb 2023 02:29:33 -0800 (PST) Received: (qmail 28680 invoked by uid 109); 26 Feb 2023 10:29:32 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with ESMTP; Sun, 26 Feb 2023 10:29:32 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 29428 invoked by uid 111); 26 Feb 2023 10:29:30 -0000 Received: from coredump.intra.peff.net (HELO sigill.intra.peff.net) (10.0.0.2) by peff.net (qpsmtpd/0.94) with (TLS_AES_256_GCM_SHA384 encrypted) ESMTPS; Sun, 26 Feb 2023 05:29:30 -0500 Authentication-Results: peff.net; auth=none Date: Sun, 26 Feb 2023 05:29:29 -0500 From: Jeff King To: Phillip Wood via GitGitGadget Cc: git@vger.kernel.org, Johannes Schindelin , Phillip Wood Subject: Re: [PATCH 1/2] rebase -i: match whole word in is_command() Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Thu, Feb 23, 2023 at 08:55:00PM +0000, Phillip Wood via GitGitGadget wrote: > Fix this by ensuring the match is follow by whitespace or the end of the > string as we already do for abbreviated commands. The (*bol = p) at the > end of the condition is a bit cute for my taste but I decided to leave > it be for now. Rather than add new tests the existing tests for bad > commands are adapted to use a bad command name that triggers the prefix > matching bug. FWIW, coverity complained about the (*bol = p) assignment in the conditional, since "p" must be non-NULL at this point. So this is email is a combination of: - a data point that it is not just you that finds it a bit cute (in case you do want to change it later); and - a hearty thank you for mentioning it in the commit message, since just looking at the code left me scratching my head at whether this was a bug. -Peff