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-Status: No, score=-3.7 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_PASS, SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id 13B061F9FD for ; Tue, 2 Mar 2021 12:00:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345736AbhCAXdF (ORCPT ); Mon, 1 Mar 2021 18:33:05 -0500 Received: from mail-ed1-f54.google.com ([209.85.208.54]:32909 "EHLO mail-ed1-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344126AbhCAWtW (ORCPT ); Mon, 1 Mar 2021 17:49:22 -0500 Received: by mail-ed1-f54.google.com with SMTP id c6so22942454ede.0 for ; Mon, 01 Mar 2021 14:48:15 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=bkRJlPCo/8+zkV6ArXpbI7j+v2NbAXXtYdcmeVgI2RA=; b=ipTldYhe+O+tUGaVjnIva64sAJazIk7t2mHnRPuqn8JvFkF8+guhzj/C7Pa1e4OnvM qrnF8NcFEoJ8AlhEVTOMrd65Q8rbaFb7v4NxJHjTeGCdxKEhYiRHj+QrdI46kLJ7hg6A /hVFG/pXW8ldxMUF+JkyiZpTIbGGNxM7QRTsbKLvUU8ftc0ThDaiGNua9W6Eqcg2rLfE xcgaiu4C2vrDe47rQe91tA1pLT5g2xI9J8vJOaoA7qqTfDK/zXcyyK41nIT12h4Uw1FE bNW43t4X6gaL67C/qhI0H81MjlG+y40OfVdNsBy/DHnTbe8WXqe4OC3jaDcoIognVLsP fBXw== X-Gm-Message-State: AOAM533170b5syGWN8v28kZ1ck4pYyfF3dziWKqJhPNOIHDCp5iBlcHx BZ137q3RXg07x9MMyr07VdQXxFDDrqsC3CSOhx8= X-Google-Smtp-Source: ABdhPJzKgwn/nSQ6d5kzjJ1eBaZToH8oUDVAri5Y/7jPtejVUbldL4jOV/W4SZ1JwEd+4r9MyZs/nEjbAhgTvZx0owg= X-Received: by 2002:aa7:c944:: with SMTP id h4mr18253871edt.233.1614638869313; Mon, 01 Mar 2021 14:47:49 -0800 (PST) MIME-Version: 1.0 References: <20210301084512.27170-1-charvi077@gmail.com> <20210301084512.27170-3-charvi077@gmail.com> In-Reply-To: From: Eric Sunshine Date: Mon, 1 Mar 2021 17:47:38 -0500 Message-ID: Subject: Re: [PATCH v3 2/6] commit: add amend suboption to --fixup to create amend! commit To: Junio C Hamano Cc: 20210217072904.16257-1-charvi077@gmail.com, Git List , Christian Couder , Phillip Wood , Charvi Mendiratta , Christian Couder , Phillip Wood Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Mon, Mar 1, 2021 at 5:32 PM Junio C Hamano wrote: > Eric Sunshine writes: > > if (skip_prefix(msg, "amend:", &arg) || > > skip_prefix(msg, "reword:", &arg)) { > > ... > > } > > You still need to compute "len" because you'd want to tell between > --fixup="HEAD^{/^area: string}" and --fixup=bogus:HEAD (the latter > would want to say "no such variant 'bogus' for --fixup", but the > colon in the former is not the end of the name of variant. I see what you mean. I vaguely recall quickly scanning over that earlier discussion about ":" being otherwise legitimate when embedded in the argument as you demonstrate, but didn't think about it when reading this code. Perhaps the comment which this code adds: * As `amend` suboption contains only alpha * character. So check if first non alpha * character in fixup_message is ':'. could be extended a bit to mention that briefly since, without it, the significance of "alpha-only characters followed by colon" is not immediately obvious.