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.8 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 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 2AA571F403 for ; Fri, 21 Oct 2022 17:54:56 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (1024-bit key; unprotected) header.d=pobox.com header.i=@pobox.com header.b="my3FT02p"; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230187AbiJURyx (ORCPT ); Fri, 21 Oct 2022 13:54:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230150AbiJURyu (ORCPT ); Fri, 21 Oct 2022 13:54:50 -0400 Received: from pb-smtp20.pobox.com (pb-smtp20.pobox.com [173.228.157.52]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 86A8242ACD for ; Fri, 21 Oct 2022 10:54:44 -0700 (PDT) Received: from pb-smtp20.pobox.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id 70A001B21A2; Fri, 21 Oct 2022 13:54:44 -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=aLsQ7js7R0k76PZIVw4DKojvrRmstJvhrwFXhh ikOlk=; b=my3FT02pzgvJF7uJtvsT6uEc1zxFwRwYfv+i+CCYdsbk74NsRJJ81e yvTpLi2RS0gAmuFtXI6/wWnPf3oTJvr3fUaZ1FELwEpEG4eD3/uv/dXo9PpMvc4y VgifC+dFmS0+wqFUJeepbo9EAbyVmM+J/pRdyeuR0rvA0MUghiGhA= Received: from pb-smtp20.sea.icgroup.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id 67D2B1B21A1; Fri, 21 Oct 2022 13:54:44 -0400 (EDT) (envelope-from junio@pobox.com) Received: from pobox.com (unknown [34.83.5.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp20.pobox.com (Postfix) with ESMTPSA id 966F11B21A0; Fri, 21 Oct 2022 13:54:41 -0400 (EDT) (envelope-from junio@pobox.com) From: Junio C Hamano To: "Phillip Wood via GitGitGadget" Cc: git@vger.kernel.org, Phillip Wood , Christian Couder , Elijah Newren , =?utf-8?B?w4Z2YXIgQXJuZmrDtnLDsA==?= Bjarmason , Calvin Wan , Emily Shaffer , Glen Choo , Victoria Dye , Phillip Wood Subject: Re: [PATCH v4 8/8] rebase: cleanup action handling References: Date: Fri, 21 Oct 2022 10:54:40 -0700 In-Reply-To: (Phillip Wood via GitGitGadget's message of "Fri, 21 Oct 2022 09:21:48 +0000") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Pobox-Relay-ID: 70540D84-5169-11ED-9143-C2DA088D43B2-77302942!pb-smtp20.pobox.com Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org "Phillip Wood via GitGitGadget" writes: > From: Phillip Wood > > Treating the action as a string is a hang over from the scripted > rebase. The last commit removed the only remaining use of the action > that required a string so lets convert the other action users to use > the existing action enum instead. If we ever need the action name as a > string in the future the action_names array exists exactly for that > purpose. Nice. #leftoverbit Perhaps a clean-up worth making after the dust settles from this series would be to use designated initialisers to avoid names and their string values going out of sync, perhaps like static const char *action_names[] = { [ACTION_NONE] = "undefined", [ACTION_CONTINUE] = "continue", ... [ACTION_SHOW_CURRENT_PATCH] = "show_current_patch", }; Unless the final element is something that must stay at the end even when adding new member to a collection, it is a good idea to keep a (seemingly unnecessary) comma at the end. That would make it easier to add a new member without unnecessary patch noise.