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.4 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, 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 540481F729 for ; Fri, 10 Jun 2022 00:26:40 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="GcgLVwlj"; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345236AbiFJA0c (ORCPT ); Thu, 9 Jun 2022 20:26:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236283AbiFJA03 (ORCPT ); Thu, 9 Jun 2022 20:26:29 -0400 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 23E7953729 for ; Thu, 9 Jun 2022 17:26:27 -0700 (PDT) Received: by mail-wm1-x329.google.com with SMTP id n185so13160686wmn.4 for ; Thu, 09 Jun 2022 17:26:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=PFQNog4dekWVD0soIGWRjEv+FE5TKkozPtY4iVt7lRw=; b=GcgLVwljhq+EA3u0ccmJvsEXAaVrksuWRoSWmiz605hNPzaZ0WcoCBcf27Y9XfZGXz lsm6CRZXRfpuOG6LfkQPD7KQ3rz8fzUaJGMeeIWbB5PJP/P0lIS3cHdfJzPFdqIoE+ty uoEIwQoNCbv3Xsj413h8U7TF5xUUEliHyypRLL3W+MaS/8MVf99YFOZ7V6IhNyzx/Ku8 5bKfoNVUj+tU4UzQYAK0lwD/YR+Pg4Lhgfim4h6Px3YAwTgJF39HsfNv/YR5pkVTExBK Ercsm5zdeOsVPGqjG0rfGjc60Ser2O0f/r0F3x+ADHRW2CZ0XCC9WhF3aXHPQs1RpGBA 2/zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=PFQNog4dekWVD0soIGWRjEv+FE5TKkozPtY4iVt7lRw=; b=NkKjEChnqivHalij31646QmofNNdVPASSgHtGji4N76XMHcVAoqKKN7Wr8VIlbOh8p 66PZPxPArFLlenxPLue0Dmjs66na61HUlJ8/cVLSvjkUssctz+jJ7HJcqlShiNLLoDpJ r6UeNz/lgcmS70syMmNCxjQMeCHjXuHVTzSe8k32s0oJuKCxqILRdzNbjOLo1tTW6n6I TIpu7/gfbnRb4n058L1mQnnGqzuB/5OS0F/1AHhzj/irnJoC1cZNhwyz/WiiS7rC65Wd 7mN8tviBXSD8JMv5EGZWT49r7d7NgKsn6GAUvmoogrBclQaAF5myULjIaGWccxnBggmr B/lw== X-Gm-Message-State: AOAM531K3Aagvqnm8oJIcWBiCidIgM2yHlgE+IKBqb76gC0oHyLjwy1P /l4DUV2j7u1km4dfu9nja4I/mtaxIe+a0uY6 X-Google-Smtp-Source: ABdhPJxT8TruzkGfilUvxNUUh9aUUpdwxxnukuAGnr6yKac08F4P8s5rwcaz/S7MFg8QrAVVbRTCLA== X-Received: by 2002:a05:600c:2297:b0:39c:511d:4b6 with SMTP id 23-20020a05600c229700b0039c511d04b6mr5870328wmf.188.1654820785253; Thu, 09 Jun 2022 17:26:25 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id u7-20020a05600c19c700b003973b9d0447sm1025508wmq.36.2022.06.09.17.26.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jun 2022 17:26:24 -0700 (PDT) Message-Id: <058d84864120844e70f3a2dc65432d6327d63bea.1654820781.git.gitgitgadget@gmail.com> In-Reply-To: References: From: "Glen Choo via GitGitGadget" Date: Fri, 10 Jun 2022 00:26:15 +0000 Subject: [PATCH 2/8] submodule update: pass options containing "[no-]" Fcc: Sent Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit MIME-Version: 1.0 To: git@vger.kernel.org Cc: =?UTF-8?Q?=C3=86var_Arnfj=C3=B6r=C3=B0?= Bjarmason , Atharva Raykar , Glen Choo , Glen Choo Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Glen Choo "git submodule--helper update" understands these options, so append them to `opts` and remove their intermediate variables. As a result, we now pass every instance of the option and its "no-" variant to "git submodule--helper update" instead of only passing the last instance. As we noted in the previous commit, this is good because this makes our options parsing consistent. Signed-off-by: Glen Choo --- git-submodule.sh | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/git-submodule.sh b/git-submodule.sh index f4679e0db80..8c46eac22e8 100755 --- a/git-submodule.sh +++ b/git-submodule.sh @@ -296,10 +296,10 @@ cmd_update() update="checkout" ;; --recommend-shallow) - recommend_shallow="--recommend-shallow" + opts="$opts $1" ;; --no-recommend-shallow) - recommend_shallow="--no-recommend-shallow" + opts="$opts $1" ;; --depth) case "$2" in '') usage ;; esac @@ -318,10 +318,10 @@ cmd_update() jobs=$1 ;; --single-branch) - single_branch="--single-branch" + opts="$opts $1" ;; --no-single-branch) - single_branch="--no-single-branch" + opts="$opts $1" ;; --filter) case "$2" in '') usage ;; esac @@ -354,8 +354,6 @@ cmd_update() ${reference:+"$reference"} \ ${depth:+"$depth"} \ ${require_init:+--require-init} \ - $single_branch \ - $recommend_shallow \ $jobs \ $filter \ $opts \ -- gitgitgadget