From patchwork Wed Dec 11 06:32:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roy Eldar X-Patchwork-Id: 13902978 Received: from mail-ed1-f53.google.com (mail-ed1-f53.google.com [209.85.208.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 83CA81C4A0A for ; Wed, 11 Dec 2024 06:33:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733898823; cv=none; b=NCZXUOWGWUqiZ5kyO+4NkOqro9WVnB3/6BZsJ0YCyJf2y8Kgjy+lAfp4KDjNBhzgf6SV8SZzcIt8J6b9rPd6TCXT5cwqF2b0dltoMslXn+Aj1jdyXb7GJQbEhsT1seS8WO35mpOnlblTxIf2i2p6NCQPa7vgnH6nYu9fs7ZRjPA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733898823; c=relaxed/simple; bh=14mN/uQsgMY2nZdTzHXDlnXsPn04Jyi7B7bY8xMAvjU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=hCXT85D4OVqEPjltQ8kT/WxBp1NVdnwAYxX7erVMUhStmVYof7mx4BnXWmqAJsDcVb0AkDyX653MCWIoIosFoZgVGmdFQuEzOcf7z/KOE8DrqwHm3Jn0udr1K99QC7a69LdNNp/rKHn2bwrqH1V5nRWzLmVWPvaS/eGsV0FF/Ng= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=h28pmE6B; arc=none smtp.client-ip=209.85.208.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="h28pmE6B" Received: by mail-ed1-f53.google.com with SMTP id 4fb4d7f45d1cf-5d3d69e5b63so548208a12.1 for ; Tue, 10 Dec 2024 22:33:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733898819; x=1734503619; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=gAPGDr+WiUf06luBBNRaYgfVqRmQKfVRA0+eKbJbh8w=; b=h28pmE6Bh45B7ZkRTChNl0fNPRQpBZuqV1F/q0lVhb41eJG540C28k3xx76wfRIDcw s6fBqePBsJI+uzGAEQXSxqW6HZMET0FRq6FJGg7/2EJOzs9R9zteOCwqK60cT3ukTlu8 gZHtBlKGg5jW93qfeQnS4d2NfqZjAKYv+85AiRCNlxKRemoAtB95+8cxV+lIjJQIU109 udfJIPGjWjPuoiP6vwgQuQ+zvpFht9n+ujyzwhZ0VyJTjlJBAWP4MPb7R0n7qULHKAxn /PRIJfZv0Xs7qiCllt3eL7/UgTysCHrW1WuZVKcU3JeOFiYfrHalqLzv7Qo1B3DOs/QD TiYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733898819; x=1734503619; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gAPGDr+WiUf06luBBNRaYgfVqRmQKfVRA0+eKbJbh8w=; b=BunPkHps73aFLj7Sb+s+RBWhsqI/O8mlnGEVqhGpQoPiOIV2khZzR19mwXG/n+0VI3 YwjmafQb+1D/STeQDA9rtRGfmco+SrwG1b5JTHgAYhrnxfYJg3m0PmBlB5sB4qJJJwRJ 14SViYVmoaLQBeGh28OZ5AHlQM7dQ4rEStUx7VkJZ0T11uLewJTYpiV5Ut5HtZPqPsps 2jUdew7hYs3eIe8yULUy/RfwdBmIZS6HIOaus+WIZmYb1pxJOXVor+ZKO0GwG3Q2LKre csZQLoUHzBeDc62fy82pnnWh795zT38lKFhXVm55hind6//3Bel0ZjBXXdwrfBtc048G yEqA== X-Gm-Message-State: AOJu0YxD/IRo/ONs5eB/+nmYw9i+JlXjo0L2R3xe60chGJOG8ShvQdnO WiWC3bu8U88Y8jHRSRxBNg7W4H02kBW/XusBzNadNvk7lQQV2R43skMhNxYc X-Gm-Gg: ASbGncvOJkvHZ0soV6TpOnTKPdfds/z3I+9kbla3IYssy7EHX2c5RcMzYVp+gSZkkF7 8WvISbSwrlg2T/8Lq0M5oYeGRY1dqYNfu6bXrZQ6NN1U2haUmgs+iH0rzG+hQU8rru/IW+ucafJ SLNRpDg6ikCqryDufS9OEIm6rKV539UAIztMR+1tcTE+HtCyW60ROyZnoSdpiYTaEV8mo0cf2gV 8YCh2LxRiJbqb8DVCy2OXgMXGx3XIHQbuDHxD9/kiyWiSUEGw5VNrW/3xB67IM= X-Google-Smtp-Source: AGHT+IHRryZtxZunhy6IndsGGYFvAz505NxWK/0m5zWg2cZZ5Jzpx0RSC/BP3aMCjKJqhyoCEOQXkw== X-Received: by 2002:a05:6402:2682:b0:5d0:8111:e946 with SMTP id 4fb4d7f45d1cf-5d4330c22c5mr436504a12.5.1733898819173; Tue, 10 Dec 2024 22:33:39 -0800 (PST) Received: from localhost.localdomain ([5.29.161.23]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5d3d00a0370sm6875803a12.6.2024.12.10.22.33.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 22:33:38 -0800 (PST) From: Roy Eldar To: git@vger.kernel.org Cc: Junio C Hamano , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBC?= =?utf-8?b?amFybWFzb24=?= , Johannes Schindelin , Eric Sunshine , =?utf-8?b?xJBvw6BuIFRy4bqnbiBDw7Ru?= =?utf-8?b?ZyBEYW5o?= , Roy Eldar Subject: [PATCH v4 1/7] git-submodule.sh: improve parsing of some long options Date: Wed, 11 Dec 2024 08:32:28 +0200 Message-Id: <20241211063234.7610-2-royeldar0@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20241211063234.7610-1-royeldar0@gmail.com> References: <20241210184442.10723-1-royeldar0@gmail.com> <20241211063234.7610-1-royeldar0@gmail.com> Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Some command-line options have a long form which takes an argument. In this case, the argument can be given right after `='; for example, "--depth" takes a numerical argument, which can be given as "--depth=X". Support the case where the argument is given right after `=' for all long options, in order to improve consistency throughout the script. Signed-off-by: Roy Eldar --- git-submodule.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/git-submodule.sh b/git-submodule.sh index 03c5a220a2..d3e3669fde 100755 --- a/git-submodule.sh +++ b/git-submodule.sh @@ -77,6 +77,9 @@ cmd_add() branch=$2 shift ;; + --branch=*) + branch="${1#--branch=}" + ;; -f | --force) force=$1 ;; @@ -110,6 +113,9 @@ cmd_add() custom_name=$2 shift ;; + --name=*) + custom_name="${1#--name=}" + ;; --depth) case "$2" in '') usage ;; esac depth="--depth=$2" @@ -425,6 +431,9 @@ cmd_set_branch() { branch=$2 shift ;; + --branch=*) + branch="${1#--branch=}" + ;; --) shift break From patchwork Wed Dec 11 06:32:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roy Eldar X-Patchwork-Id: 13902979 Received: from mail-ed1-f47.google.com (mail-ed1-f47.google.com [209.85.208.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 767761C54A4 for ; Wed, 11 Dec 2024 06:33:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733898828; cv=none; b=ls7a66snW8HkiB/CwDbc9FmK7JXxLnoJW2Apr3BM1YrVvvcCRuI3GV85s40qswC6S+B0tVt0dlnNFnv/7cGuiSHPcgrUMSj/5jDgdkjr6snTswlB/gitxKKw5rgroTduKpHW4qThKtmRlDwKvMpsDIz8DJX+ajlzWoHCepVXqqk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733898828; c=relaxed/simple; bh=8T2UCdjSXSwqFmhj4MAHT9nZHFKA156xwfqP/euEr6A=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=O86Sr4OqUJoWC0Yn8v2rXAkl5DhGVKl1Z87eEi8um4Ico3tg0IETNECliNrs5BfZbVJ2ph0F0WDbvE+AKxiuye4jjy8IWY8GuBuxvcQyWAxAfPahbNJIs7I2r5BiaH7y5nU3EY5gzouhqcQW5l2yJC3BsBN3buNr7UCvLxR2BcQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=cTrc9IzY; arc=none smtp.client-ip=209.85.208.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="cTrc9IzY" Received: by mail-ed1-f47.google.com with SMTP id 4fb4d7f45d1cf-5d3cd821c60so517560a12.3 for ; Tue, 10 Dec 2024 22:33:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733898823; x=1734503623; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=lUJYImH9KbEfelezgsKyr0GU7/pksSBxA3JcvekS0NA=; b=cTrc9IzYv2rSD0meO8Yp8wU99DSnbCLHHCPEf3Gyc0QojFk4KkODRacDKBXdKqRAho iEgXFGX7gqAz5KTd8hE+MFXw4nboN7Q+dFrCfeJ5sElpV+epcp10DZ8eK9BAeeEo4loJ 5gNUL5gRWmsU/NeB+1E5SdBuLqfp/O2CjKSMGvgI6xW+xjfgD591gOQrQB+RuogZlP5V prnx968sfZWaUWmDFPgtFqya1Ppm9lgwdocAR48GahdeBGejP7pQu1ENxCbHq70TxrIj 9eJ8TXNNcif4j8aIkiDnbEgiCoCS4yZWMFAF//zFW2CnswUXPKhRP4oV6D2U0vBwI5qI NP6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733898823; x=1734503623; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lUJYImH9KbEfelezgsKyr0GU7/pksSBxA3JcvekS0NA=; b=s3WlBqzAh2bzgpKU/0fhtzg88mS11gYIl5Zy5GJ6az+KtilqB11mwCCgqNX8dccDhP xt1XNad52+YQhTAUpsa7H+4rYb/Ng3Z85fN0BLbj7Z1r7xmgMknF6SNOB5GBU+bC4hiP PlerthV9xBh3G7XOqyE8spjyFNMsueXLdzGDnXwxaCqqcR5qmqzvUTVqjuTifLM++wrA Rf9wriPoC0B1l7YLLRBAbKt3xzGDtXcjVSFzWbgeyRfJI1FLqbPFGel7IApb4rsojRQo QaKr34PilnjtcppF8CnahPH/w/CuMKXKv0w0jLZa+yQtwoDLb+AYE0fYd8JpNfPuxTNB rIWg== X-Gm-Message-State: AOJu0Yx14OzaTOLpOJlZB8bx2jy2vzxY+pn5EOSrUAcpBfL0tML0YDo5 ZA+lcydN93FnxD5a6VmRntSp/FiVywzlrAP/OWfK6VrAB+y+VGEIrZi0Txem X-Gm-Gg: ASbGncuSWaPjXJI0xWCnCMzDpFE0bQfWPcVDukVSkMv9pkN2MwDf6/BuIWKaEQp4CYD hb35vOD4STib0qlepKJvqxknW/TF4irgkMzW8MqNg0IYESPZpQzx9dEpyJKX+tec6L5TVAyDQzg Dh7CqfFzGWE6ZgMX9O19pO7OTalidpnPDdoDbBJ41+9MlRFmTFpaAfCUaij/cMLG1UxXjHqyK/j zxzX4QXzTpO1bJiBmI+jY6LMxopHfX0Ydc9Xu9xHEMqo7mdDiFdnnG6WkgJhFs= X-Google-Smtp-Source: AGHT+IFYFAmb5Lo8TwnlHzKibwGoInQOaw4B6vGG28graNwX9B0TNTxB/o/O14wJA+vzK0zFimQSsg== X-Received: by 2002:a05:6402:5193:b0:5d0:bf79:e925 with SMTP id 4fb4d7f45d1cf-5d43314d34cmr465921a12.6.1733898822809; Tue, 10 Dec 2024 22:33:42 -0800 (PST) Received: from localhost.localdomain ([5.29.161.23]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5d3d00a0370sm6875803a12.6.2024.12.10.22.33.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 22:33:41 -0800 (PST) From: Roy Eldar To: git@vger.kernel.org Cc: Junio C Hamano , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBC?= =?utf-8?b?amFybWFzb24=?= , Johannes Schindelin , Eric Sunshine , =?utf-8?b?xJBvw6BuIFRy4bqnbiBDw7Ru?= =?utf-8?b?ZyBEYW5o?= , Roy Eldar Subject: [PATCH v4 2/7] git-submodule.sh: improve parsing of short options Date: Wed, 11 Dec 2024 08:32:29 +0200 Message-Id: <20241211063234.7610-3-royeldar0@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20241211063234.7610-1-royeldar0@gmail.com> References: <20241210184442.10723-1-royeldar0@gmail.com> <20241211063234.7610-1-royeldar0@gmail.com> Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Some command-line options have a short form which takes an argument; for example, "--jobs" has the form "-j", and it takes a numerical argument. When parsing short options, support the case where there is no space between the flag and the option argument, in order to improve consistency with the rest of the builtin git commands. Signed-off-by: Roy Eldar --- git-submodule.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/git-submodule.sh b/git-submodule.sh index d3e3669fde..fd54cb8fa6 100755 --- a/git-submodule.sh +++ b/git-submodule.sh @@ -77,6 +77,9 @@ cmd_add() branch=$2 shift ;; + -b*) + branch="${1#-b}" + ;; --branch=*) branch="${1#--branch=}" ;; @@ -352,6 +355,9 @@ cmd_update() jobs="--jobs=$2" shift ;; + -j*) + jobs="--jobs=${1#-j}" + ;; --jobs=*) jobs=$1 ;; @@ -431,6 +437,9 @@ cmd_set_branch() { branch=$2 shift ;; + -b*) + branch="${1#-b}" + ;; --branch=*) branch="${1#--branch=}" ;; @@ -519,6 +528,10 @@ cmd_summary() { isnumber "$summary_limit" || usage shift ;; + -n*) + summary_limit="${1#-n}" + isnumber "$summary_limit" || usage + ;; --summary-limit=*) summary_limit="${1#--summary-limit=}" isnumber "$summary_limit" || usage From patchwork Wed Dec 11 06:32:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roy Eldar X-Patchwork-Id: 13902980 Received: from mail-ed1-f53.google.com (mail-ed1-f53.google.com [209.85.208.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4A4DD1C4A34 for ; Wed, 11 Dec 2024 06:33:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733898831; cv=none; b=gnw0OG86lu6ezzxVJEqrsA7LFRtl/unL58qeIXeC91cJIjSierPXuzij5V/XgGs9H2zKY2EZ/mOgsq0pIgSLQ+qfikXzRkiUUEqs+IPXHfRf+F0w8DhMGyPjIHV90xBBDAOm82ldT2k9AxsQzfysphL0VqP2yfTgN7vPypkAAuE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733898831; c=relaxed/simple; bh=V/I7Dvl/5Zke3ph+/P0X+edNcPqmV/qQwgUZEFlBvnY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=b4TVWykcLJh5lM2dO72UIdsJZjFZE+Wpc1nanEmyDknmOrhrnrzPZnzTQkjLeHTsjBYbD6ygGQcsAsAJgh7uymcQyRwDh7kJVLKPa65+6wvq1yDqaI1HoX4QLp6zJ6yFpKjEdNntVh5Fsy4G4K5DGMsLs0GzMLIWdARuX6WfQ1k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=mSXkojl2; arc=none smtp.client-ip=209.85.208.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="mSXkojl2" Received: by mail-ed1-f53.google.com with SMTP id 4fb4d7f45d1cf-5d3cd821c60so517567a12.3 for ; Tue, 10 Dec 2024 22:33:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733898827; x=1734503627; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=kBbMUzMWawmcW2jowGRZQ6BZLgaxctDNOZUijJGP71g=; b=mSXkojl2r7vGAywiLR2rlnP055PXSzGtyM4wsZ3Qd30XVIxjN3JSor9Kn7ZVyLIQ5u Y89sMTLIHHbJwA3Xm0cu6GkPAlrkqD5ugARt6gt8kj58himurRmTDfJYTA5z35GFNsMf sFs1aoVQ/o5t2fUTjU5IhI+iaB8mhly8B6EsE4FGK3zXg/TxptUam5jrkl+9CQZMOJLj 3WKjujVRx6ZyBUALkeSc57AYrStc/LobcIkQF/YmKnkem7qmAlzqI9yUF6CEUKWJacx6 9vzLDWo4CirYIwSlRjI+yLsS7nFmZSGT69hc1+R7US4u0igP5w+ls4HVnZTotpB42Dro CJ7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733898827; x=1734503627; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kBbMUzMWawmcW2jowGRZQ6BZLgaxctDNOZUijJGP71g=; b=QuFwK4O/UBDAoDUea2w2ffQv7Q6xODkNiE4PrNA32LEWaajshmQ7SzRBmtL0mz+Gwj ggNlp9XMGSr9nJEK4uQOl3Q4plpRxIkF5S7ALgH6+Dg8AM1fBnZIbPuouB9Io2W7sThJ Y8xemtkFtBRHj07z8vxzLzWAlv7tMkaiPpGm/00e5+wEFXF+bLNF8yzqw4o5JtJDtBYk bT6QJcoX6ED1e39NhxquEY1MZrLJiZ0te9DhoTwAN76ilENwGT6YzWDVhDr9lEMikG3u yZY1H2KOhlAe4tYcva3QZVlFvaFBFcWpdiK5ahpB0HNpaZZlh4LnRkGUHDFYyhmDuvI0 GAGw== X-Gm-Message-State: AOJu0YxcVRPnX22PK+4SeHKWiCp3l0GHT1wdu/ykOk2OqX8TW23ORHPT NyCz8ktaNnq6QlDhXPfdcP5tJSUkaaOlx20QznwsuCUNFM6vFnUN1UEGE2GJ X-Gm-Gg: ASbGnctStxpTV7PVb3nk5IKPWj9433nCckwkgs1q/7+3bWv0VrbwLpb2fMHKAqvn0Id yUCC7TstshXn4Y3oGFBpXOuC0BEXI9yxFW6acfwvAumB8KlIEDzkjNAYUDJiHlxcLdQJbEydPfR wuMKHBft2Re7VWvQF1p9PYPVb9OVk8h0mVhs+Ky1DBjXhASSiDbQSgU9F3FjpaXYcSGHCMJ95Ub b9ULPMuV2rt9SPbzBl+Ktl6hPd/xxb0WQshyr8JCJZtYSjwn610cgXBrQjf4xA= X-Google-Smtp-Source: AGHT+IH8zdYPcPWQgFwV0RNekgasPFKjiZVp0T9ZL46oFCeJu1KlOz3zLuc2BcmZItaZNhfB2R3xuA== X-Received: by 2002:a05:6402:5193:b0:5d0:bf79:e925 with SMTP id 4fb4d7f45d1cf-5d43314d34cmr465991a12.6.1733898826634; Tue, 10 Dec 2024 22:33:46 -0800 (PST) Received: from localhost.localdomain ([5.29.161.23]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5d3d00a0370sm6875803a12.6.2024.12.10.22.33.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 22:33:45 -0800 (PST) From: Roy Eldar To: git@vger.kernel.org Cc: Junio C Hamano , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBC?= =?utf-8?b?amFybWFzb24=?= , Johannes Schindelin , Eric Sunshine , =?utf-8?b?xJBvw6BuIFRy4bqnbiBDw7Ru?= =?utf-8?b?ZyBEYW5o?= , Roy Eldar Subject: [PATCH v4 3/7] git-submodule.sh: get rid of isnumber Date: Wed, 11 Dec 2024 08:32:30 +0200 Message-Id: <20241211063234.7610-4-royeldar0@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20241211063234.7610-1-royeldar0@gmail.com> References: <20241210184442.10723-1-royeldar0@gmail.com> <20241211063234.7610-1-royeldar0@gmail.com> Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 It's entirely unnecessary to check whether the argument given to an option (i.e. --summary-limit) is valid in the shell wrapper, since it's already done when parsing the various options in git-submodule--helper. Remove this check from the script; this both improves consistency throughout the script, and the error message shown to the user in case some invalid non-numeric argument was passed to "--summary-limit" is more informative as well. Signed-off-by: Roy Eldar --- git-submodule.sh | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/git-submodule.sh b/git-submodule.sh index fd54cb8fa6..3adaa8d9a3 100755 --- a/git-submodule.sh +++ b/git-submodule.sh @@ -53,11 +53,6 @@ jobs= recommend_shallow= filter= -isnumber() -{ - n=$(($1 + 0)) 2>/dev/null && test "$n" = "$1" -} - # # Add a new submodule to the working tree, .gitmodules and the index # @@ -524,17 +519,15 @@ cmd_summary() { for_status="$1" ;; -n|--summary-limit) + case "$2" in '') usage ;; esac summary_limit="$2" - isnumber "$summary_limit" || usage shift ;; -n*) summary_limit="${1#-n}" - isnumber "$summary_limit" || usage ;; --summary-limit=*) summary_limit="${1#--summary-limit=}" - isnumber "$summary_limit" || usage ;; --) shift @@ -554,7 +547,7 @@ cmd_summary() { ${files:+--files} \ ${cached:+--cached} \ ${for_status:+--for-status} \ - ${summary_limit:+-n $summary_limit} \ + ${summary_limit:+-n "$summary_limit"} \ -- \ "$@" } From patchwork Wed Dec 11 06:32:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roy Eldar X-Patchwork-Id: 13902981 Received: from mail-ed1-f43.google.com (mail-ed1-f43.google.com [209.85.208.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 96A711C1F24 for ; Wed, 11 Dec 2024 06:33:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733898834; cv=none; b=Vfny20mn2QgFDMrPSxbCZqL+nJHLcBYjHJWmKLE6yaUaZnZrhJYWxD9Fua0Hk0U2XatoEDcp522YAmYa4jNTWxt6c3gRfUEJr/Rn/JNvj96P0MN2k4fr54arMPzU6oCwNCg/vQM/vtHPqPJOqQVuYdlsq+upTxkvDRbe/rzziXo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733898834; c=relaxed/simple; bh=s+FdjAYhpdB1k4KIYUhTwSQn3ybiSNrVZ6lw5awsLrQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=MWbyA5IUPMKC+1+6majZSgVgsq4HI/c9M2Kdh/W26//WrOgXZZ3xEhifgQw744GlhQLkQZhf3srR7JS6igZezidZiUPo+3NeqePrvN0ZMKpOOXeWVy12bB8EUnAHJP82ogAmUyE3i3UCpKO0KDSYF6WbXfT2TU1PN+cV0rClnPE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Jqizt398; arc=none smtp.client-ip=209.85.208.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Jqizt398" Received: by mail-ed1-f43.google.com with SMTP id 4fb4d7f45d1cf-5d3ce64e7e5so597116a12.0 for ; Tue, 10 Dec 2024 22:33:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733898830; x=1734503630; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=AuXCx1rN4/hrvtLTL6QZ9QDEFcnUddFGKuajpTRwkVk=; b=Jqizt3984ohx1ZL09+pmFfdYQ66+EykOLOJe1AIhdtUiPb6uAY2edOWvlzs0J5Oc1p 3WpGzTnkDz/iw8M+emD5QynHSd5g6IVfrMyLw+B0FbemeS9xDv9+WmTQVmkGGzYR49Yu wasVA2WCAMn+EwIVpjIJM1bLAVbcpn31+NyQ+sS4wTGZb2r6A65bOn7G3Qf1EeXEp13X +GVDdQLfbUBpAXKG+/ISxsGhj/j1nObkUe6MUoMOJe9PjAQZk7FdwH7oUT/1l0Zt3YLR ahm+WVMGcVrKIKij1pShu+RWpa1tkV+K6jWiiCedxDknDJuOosqtG5tMC4OVQBE06iqI 8g9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733898830; x=1734503630; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AuXCx1rN4/hrvtLTL6QZ9QDEFcnUddFGKuajpTRwkVk=; b=bNnAHkQKVJATQmI/RNTlSqXv4njNSfwBj8RMz+C0zkUMYFQIQ6mWspDF/T0LbQnQH+ wlmuxRCaPm5ctFCh9svI1J7BxhxBBavbpMjl2dMQ2Vvzj7wELbQmVhvyIM80cVxvBPBZ kjxwpXdJ4jOYikvc4PjkRFz30hUWbGp6JvK9HLFOPlTVw4J5jKXPHG5RZx/045sg08kt N8qXZruqYfrVqa/2LNwlNffShejqMRXZxXxjWhj1N3Ptlq014qG9TkCBWSdcb6h10s9l fR8bTB242w0JBZGVvGi35hVvIyzhWjMlr17agUnVUjHjOm1j1PI1z08PbswbIwrfKkGP 2QSw== X-Gm-Message-State: AOJu0YwOjtWuNm5dE0FVDH/RrnPtAVygxCTyns9W1eGgtEPh/S6gb4Cx i0Cp2+TlKhVXG60Et8tL1gQrfGSLN/KwrXbS0KLZTYFrE6BFKfVvE80WkFTp X-Gm-Gg: ASbGncsqlOy352/r+wKmT4AtWNoEO+IygzLF1E4f9HBVZlwaK+m74OOGuE1GhYFuZu+ pDHi9+tpFi6ej5tuQhzCqqzfOl5MWRF+WGNa+cVf190BMTgdHHYm0ytEBwI/Otu12K+5HoXYp1L Xa3oO0r9ezo0tyOiOj+0lJxOMJzcNx2KH3CBq/yXmjkLqL2cN778AU4PRVQIOysyWsuqTOvVib3 GNCKeri81OdCaVF+ALDM0J8UUgYaFGCg7XwsiJjHYKT3wOBnH4ETwDlMAcxrK8= X-Google-Smtp-Source: AGHT+IFsnbJuFDqB8GQht+kYiHhX4h8Yo1XHJCVqq7UPrPd2p+39Y2BaBvHowhp3xLmUdupwGXPBUw== X-Received: by 2002:a05:6402:270b:b0:5d3:ba42:e9f8 with SMTP id 4fb4d7f45d1cf-5d43315d529mr407899a12.7.1733898830121; Tue, 10 Dec 2024 22:33:50 -0800 (PST) Received: from localhost.localdomain ([5.29.161.23]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5d3d00a0370sm6875803a12.6.2024.12.10.22.33.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 22:33:49 -0800 (PST) From: Roy Eldar To: git@vger.kernel.org Cc: Junio C Hamano , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBC?= =?utf-8?b?amFybWFzb24=?= , Johannes Schindelin , Eric Sunshine , =?utf-8?b?xJBvw6BuIFRy4bqnbiBDw7Ru?= =?utf-8?b?ZyBEYW5o?= , Roy Eldar Subject: [PATCH v4 4/7] git-submodule.sh: get rid of unused variable Date: Wed, 11 Dec 2024 08:32:31 +0200 Message-Id: <20241211063234.7610-5-royeldar0@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20241211063234.7610-1-royeldar0@gmail.com> References: <20241210184442.10723-1-royeldar0@gmail.com> <20241211063234.7610-1-royeldar0@gmail.com> Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Remove the variable "$diff_cmd" which is no longer used. Signed-off-by: Roy Eldar --- git-submodule.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/git-submodule.sh b/git-submodule.sh index 3adaa8d9a3..ba3bef8821 100755 --- a/git-submodule.sh +++ b/git-submodule.sh @@ -503,7 +503,6 @@ cmd_set_url() { cmd_summary() { summary_limit=-1 for_status= - diff_cmd=diff-index # parse $args after "submodule ... summary". while test $# -ne 0 From patchwork Wed Dec 11 06:32:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roy Eldar X-Patchwork-Id: 13902982 Received: from mail-ed1-f46.google.com (mail-ed1-f46.google.com [209.85.208.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 187861C461F for ; Wed, 11 Dec 2024 06:33:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733898835; cv=none; b=OnZ2R5kHIXsfJKDwPvEW+CguXYiJPWFB9r6u+UbcCDKvTKxbAhmMRWbR7/i2rm0LboAO96PVnZ7yICW+I7RGW5X3eFGQn8ldQU80eEFZ99IpguVxhnXl/L+hJcHYR2dVV2xbtV26kbcPR0tLpfHAGFxkDaOUtwbnFjLNdbXH4X8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733898835; c=relaxed/simple; bh=n/SgS0D1kkStv0/3Q0fUqEhxyEgITxIeMACvKczgwPA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ckJQkm2hwXQRIl/ZGrxaDO3b59SjMI2Xz3e4y0iPi+nM6D4hL0i2yd1Mbg8rmCt7RIQnRkv4jk5lK1Jg08uhllECFnwBUcOIE3T/8Suh/h04elI263iM4zbWoOJLIvAv3PS8/WHNvueCCf5vxRy2dp0Nu8mA4N3uH6Z0i2T+BWc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ZmFymw7I; arc=none smtp.client-ip=209.85.208.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ZmFymw7I" Received: by mail-ed1-f46.google.com with SMTP id 4fb4d7f45d1cf-5d0b85c5574so763702a12.2 for ; Tue, 10 Dec 2024 22:33:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733898832; x=1734503632; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=g3OYHh8iTbnHQf0CS+eSVEVY5/X91gHZdPmDyMNtY70=; b=ZmFymw7IzMrZUTrZ6w+47fQwtUGepuz8gDbIJg2O4AsvLCjxwmdKs3NTwkC8hE0GLJ 3sfGYTtSOy9rbWGyYiPch3z//GtbqnKLOueeMWQyMmEDIJEZpjC06p0fvi0DN4Y792+F cMmbaBBqsP1pN0kgC1Jq7GTAFjoUqDII7M35QN0u10ijsWtA/USshfmEkLc07SsYohzG lclS5xKAuGeUXid7VMXzcWcxwnnvtIlID563tC/nr6LY/bLo7iUdHzplAiK1xEFgosC5 5BGxztqbicFGIfol/sBNImswBOiQWsQfEsKQa4sUVXa4ZWrCID2iPq0j/72mxqSTviVt Rliw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733898832; x=1734503632; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=g3OYHh8iTbnHQf0CS+eSVEVY5/X91gHZdPmDyMNtY70=; b=RA+bAvTHyXzzXhnyF4w6Y5/BT1We42y48nJxXk/V9Q+mH2iT+fBu6rkW1y0JgoW7L7 MhTgzURFg+pFya6s5Z6iugB8l/bJEuhHDJngIremFWMagudRIykWbu+4Q7yPdDlxpymv Tc1JVZX+S72n6d/AllztRvrDxQbwxWE0b1UBRYjpPcna7Soft6cmTOhHIylEq2egcxgl y3qsaF7GY7HC0/MR1EXAOPFUwvmmcTOm5cgk7hwJ8mGfjZDmCC8s1dnmLTgmsUjG/K67 Sv4JmWS+LWH5iNYydzqDdcaXV+gYM7Pgi35xVfkDOBhwclcdqSgY+VOam+GNDRZTMgOU So+A== X-Gm-Message-State: AOJu0Ywl7VlphL6q2qDNWBGZxMbNQd0s68xpoGxv22lW3ShHgJeaxhM7 R3BcaNKy7pD+hxH9ltxZ8KqhGD2jV3zDXuTJ3uN+hBx+QcZ60QqlW9D+l2dr X-Gm-Gg: ASbGncvmtiWeRsEUcIQGjjHscy44kYazWv+z1ybc8ZsEl7zipdlCgFfFjtViIBcw/iH fTUpKWCNHkh541jOnVzHi0H5vOpRNb4RoMQbwl2JT+AmZRjKPmzIHD4dmCS0/4yO8UddxsXTWw6 SC4c+I8r09ONXy6a3CFizAT2GL6Fczy7s/TQNBFnQqO/I3gCMZqabhYZ5EEMmBUrhOfJ0gmsQub cnj0Hh7YBBb1TUuzLKNpWOLWKQW5ZlnIzPqDISLWH/AlfN0E+/wnf9Yxfi7uYU= X-Google-Smtp-Source: AGHT+IF7cHnbrtjIZrZiPJcepXJjtpu4RqKnEXe3sgLVsgT3cXLGXSHPJrdUq8rNtgzT0rp875vwzg== X-Received: by 2002:a05:6402:5193:b0:5d0:bf79:e925 with SMTP id 4fb4d7f45d1cf-5d43314d34cmr466092a12.6.1733898832110; Tue, 10 Dec 2024 22:33:52 -0800 (PST) Received: from localhost.localdomain ([5.29.161.23]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5d3d00a0370sm6875803a12.6.2024.12.10.22.33.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 22:33:51 -0800 (PST) From: Roy Eldar To: git@vger.kernel.org Cc: Junio C Hamano , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBC?= =?utf-8?b?amFybWFzb24=?= , Johannes Schindelin , Eric Sunshine , =?utf-8?b?xJBvw6BuIFRy4bqnbiBDw7Ru?= =?utf-8?b?ZyBEYW5o?= , Roy Eldar Subject: [PATCH v4 5/7] git-submodule.sh: add some comments Date: Wed, 11 Dec 2024 08:32:32 +0200 Message-Id: <20241211063234.7610-6-royeldar0@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20241211063234.7610-1-royeldar0@gmail.com> References: <20241210184442.10723-1-royeldar0@gmail.com> <20241211063234.7610-1-royeldar0@gmail.com> Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Add a couple of comments in a few functions where they were missing. Signed-off-by: Roy Eldar --- git-submodule.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/git-submodule.sh b/git-submodule.sh index ba3bef8821..ee86e4de46 100755 --- a/git-submodule.sh +++ b/git-submodule.sh @@ -418,6 +418,7 @@ cmd_set_branch() { default= branch= + # parse $args after "submodule ... set-branch". while test $# -ne 0 do case "$1" in @@ -466,6 +467,7 @@ cmd_set_branch() { # $@ = requested path, requested url # cmd_set_url() { + # parse $args after "submodule ... set-url". while test $# -ne 0 do case "$1" in @@ -604,6 +606,7 @@ cmd_status() # cmd_sync() { + # parse $args after "submodule ... sync". while test $# -ne 0 do case "$1" in From patchwork Wed Dec 11 06:32:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roy Eldar X-Patchwork-Id: 13902983 Received: from mail-ed1-f45.google.com (mail-ed1-f45.google.com [209.85.208.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E38AD1C4A20 for ; Wed, 11 Dec 2024 06:33:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733898839; cv=none; b=mcO2zfZ3RDirxV97Lpom8jcLPvCj+9KBlkGW15czywsgCSvoTfjtr5tG8ruS95koFLn1lDYitkrxC6rHEBkQi9K+6hBwPCU/5TKRb345xZ8fLTSVPEnlxhb2DqyRAbzmwla+V07uJjSme7oAMEyvIRG9Zzg6ZBocoFqLppnUA4U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733898839; c=relaxed/simple; bh=GGd799+/LNobrNpLwNs5jkCyd7WRxjl7+f6FbV+3n08=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=DqTBRdFWnoMNoWuvUo2ivJEvN1B9dFF0FeBFspWGGBRXY0SSmeDTOCw/vthcYwzt5Yho1mV5lebvWafxWrKDUFp8aOEMhkxnsZUGkRU5WM5Xq9lHtRhFUjrPST+215VUvNSLD/lCxAKvWv24MmJjlli2YoxNuelACJyMLzBnCkk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=iandGxlT; arc=none smtp.client-ip=209.85.208.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="iandGxlT" Received: by mail-ed1-f45.google.com with SMTP id 4fb4d7f45d1cf-5d3d69e5b63so548235a12.1 for ; Tue, 10 Dec 2024 22:33:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733898836; x=1734503636; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=hzJw3fjqDdFMmU02C9GCkslIWKfeWanAnMs1/t22Hl0=; b=iandGxlTUHBblbxtDPp0CpcSx4cJ6hz+788YsuiqVSnbiVf0grxL03i9X/wVhw1vap KoyOe2hg56NmBNB936MDZq3GQLvmANrOGdffbShPVSsDT4hIOMybXJ+a4NZq/A3dDDJN CO0k2wMiq2gjDup/LzaSCoT4U6uxRM787L4aHnAM+cDbIayXskjGu9wlC/TA1Ufd5qDX 5/AEtKpGGyeb34riHSqULQOktn62RBXGl5zJ/2DHDc/AE+xMWt/yZNt5Kd9Ra2OaPEEY 7JC+5jNL1RCIEtvw5gn0r4mHR+kUr8aMEWHy10ivyhw5Gtst8CQ/3TcCmXPRgAjhj8EV EjbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733898836; x=1734503636; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hzJw3fjqDdFMmU02C9GCkslIWKfeWanAnMs1/t22Hl0=; b=tZ8DNLOaU7wN4BAWldS75kVc/MOR9l3pQ7lBYQcF0RJD8kytp/caDg8kW4Kr6v70kT FCECe/TLppys5y0/Fmi8trKh3Slp95TubHKJ3NzoRPc5OeDJxBXkiNyRhy+GS3RSHmTC cHzna2Y+ZS0lE+R0ZrOwnx+rGcJeMx3FVND+DBznJyhqa/avTIFFLtzQp4Fu4OJR8aby QiojcFQi9mZbSg6cIE4U5Jwft/Lo3v0ZhqXcvQkvWimmYnRtCaVpQP/YcJtLOYe6J860 U0qyH9PPADSOearCqzK+tJCAH+GxFNuAWiYWFqB6CGDqx9OfvMbFt2umja4pIwMmt98L RJFg== X-Gm-Message-State: AOJu0YwkMn96/KrshfTl9cyG2uVfXIZaTrNQgI284YCcTcGFYB1UgBhH ERhnLB+SVELqn2u5s7euhmUk9icVJaacm3FzPAHv+6NRWUuf0txrbkRnX6Sl X-Gm-Gg: ASbGnctapcfhaNPOhYBHxlHHxeb72mqqcq7sf7cp8X/bUJbIFkNbt/7VpR22GRt7hD/ /npyHp21BNGwxe8t9tosqv6eWj92KQm7cdSiKIonsJ+dJds6AEolRngXyUEVkyGs9TujrPMVt6i Y+jQJs2Y2CkBXu8Hoc9HobCFt/Cr2LoyB+5nkhE3vzxxWmRIvRLrnhqFKKdsgRr/N+TvzCk3NLW mbV9elc6x6QjrfS3YhAQOnN+BIg/vkHmY0nFHV0KtEzLmJdbwMzjw3Rzb9lC/w= X-Google-Smtp-Source: AGHT+IErjizOg01cCJyEAD/N7Jz3iechG7Eu68hketAQaCUsrRQCFv9ueypb1VwvsNUJcHCPv7J3xw== X-Received: by 2002:a05:6402:27c8:b0:5d2:d72a:7803 with SMTP id 4fb4d7f45d1cf-5d433096137mr437409a12.4.1733898835848; Tue, 10 Dec 2024 22:33:55 -0800 (PST) Received: from localhost.localdomain ([5.29.161.23]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5d3d00a0370sm6875803a12.6.2024.12.10.22.33.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 22:33:54 -0800 (PST) From: Roy Eldar To: git@vger.kernel.org Cc: Junio C Hamano , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBC?= =?utf-8?b?amFybWFzb24=?= , Johannes Schindelin , Eric Sunshine , =?utf-8?b?xJBvw6BuIFRy4bqnbiBDw7Ru?= =?utf-8?b?ZyBEYW5o?= , Roy Eldar Subject: [PATCH v4 6/7] git-submodule.sh: improve variables readability Date: Wed, 11 Dec 2024 08:32:33 +0200 Message-Id: <20241211063234.7610-7-royeldar0@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20241211063234.7610-1-royeldar0@gmail.com> References: <20241210184442.10723-1-royeldar0@gmail.com> <20241211063234.7610-1-royeldar0@gmail.com> Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 When git-submodule.sh parses various options and switches, it sets some variables to values; the variables in turn affect the options given to git-submodule--helper. Currently, variables which correspond to switches have boolean values (for example, whenever "--force" is passed, force=1), while variables which correspond to options which take arguments have string values that sometimes contain the option name and sometimes only the option value. Set all of the variables to strings which contain the option name (e.g. force="--force" rather than force=1); this has a couple of advantages: it improves consistency, readability and debuggability. Suggested-by: Junio C Hamano Signed-off-by: Roy Eldar --- git-submodule.sh | 213 +++++++++++++++++++++-------------------------- 1 file changed, 95 insertions(+), 118 deletions(-) diff --git a/git-submodule.sh b/git-submodule.sh index ee86e4de46..6df25efc48 100755 --- a/git-submodule.sh +++ b/git-submodule.sh @@ -52,6 +52,10 @@ single_branch= jobs= recommend_shallow= filter= +deinit_all= +default= +summary_limit= +for_status= # # Add a new submodule to the working tree, .gitmodules and the index @@ -63,37 +67,33 @@ filter= cmd_add() { # parse $args after "submodule ... add". - reference_path= while test $# -ne 0 do case "$1" in -b | --branch) case "$2" in '') usage ;; esac - branch=$2 + branch="--branch=$2" shift ;; - -b*) - branch="${1#-b}" - ;; - --branch=*) - branch="${1#--branch=}" + -b* | --branch=*) + branch="$1" ;; -f | --force) force=$1 ;; -q|--quiet) - quiet=1 + quiet=$1 ;; --progress) - progress=1 + progress=$1 ;; --reference) case "$2" in '') usage ;; esac - reference_path=$2 + reference="--reference=$2" shift ;; --reference=*) - reference_path="${1#--reference=}" + reference="$1" ;; --ref-format) case "$2" in '') usage ;; esac @@ -104,15 +104,15 @@ cmd_add() ref_format="$1" ;; --dissociate) - dissociate=1 + dissociate=$1 ;; --name) case "$2" in '') usage ;; esac - custom_name=$2 + custom_name="--name=$2" shift ;; --name=*) - custom_name="${1#--name=}" + custom_name="$1" ;; --depth) case "$2" in '') usage ;; esac @@ -120,7 +120,7 @@ cmd_add() shift ;; --depth=*) - depth=$1 + depth="$1" ;; --) shift @@ -142,14 +142,14 @@ cmd_add() fi git ${wt_prefix:+-C "$wt_prefix"} submodule--helper add \ - ${quiet:+--quiet} \ - ${force:+--force} \ - ${progress:+"--progress"} \ - ${branch:+--branch "$branch"} \ - ${reference_path:+--reference "$reference_path"} \ + $quiet \ + $force \ + $progress \ + ${branch:+"$branch"} \ + ${reference:+"$reference"} \ ${ref_format:+"$ref_format"} \ - ${dissociate:+--dissociate} \ - ${custom_name:+--name "$custom_name"} \ + $dissociate \ + ${custom_name:+"$custom_name"} \ ${depth:+"$depth"} \ -- \ "$@" @@ -168,10 +168,10 @@ cmd_foreach() do case "$1" in -q|--quiet) - quiet=1 + quiet=$1 ;; --recursive) - recursive=1 + recursive=$1 ;; -*) usage @@ -184,8 +184,8 @@ cmd_foreach() done git ${wt_prefix:+-C "$wt_prefix"} submodule--helper foreach \ - ${quiet:+--quiet} \ - ${recursive:+--recursive} \ + $quiet \ + $recursive \ -- \ "$@" } @@ -202,7 +202,7 @@ cmd_init() do case "$1" in -q|--quiet) - quiet=1 + quiet=$1 ;; --) shift @@ -219,7 +219,7 @@ cmd_init() done git ${wt_prefix:+-C "$wt_prefix"} submodule--helper init \ - ${quiet:+--quiet} \ + $quiet \ -- \ "$@" } @@ -230,7 +230,6 @@ cmd_init() cmd_deinit() { # parse $args after "submodule ... deinit". - deinit_all= while test $# -ne 0 do case "$1" in @@ -238,10 +237,10 @@ cmd_deinit() force=$1 ;; -q|--quiet) - quiet=1 + quiet=$1 ;; --all) - deinit_all=t + deinit_all=$1 ;; --) shift @@ -258,9 +257,9 @@ cmd_deinit() done git ${wt_prefix:+-C "$wt_prefix"} submodule--helper deinit \ - ${quiet:+--quiet} \ - ${force:+--force} \ - ${deinit_all:+--all} \ + $quiet \ + $force \ + $deinit_all \ -- \ "$@" } @@ -277,31 +276,31 @@ cmd_update() do case "$1" in -q|--quiet) - quiet=1 + quiet=$1 ;; -v|--verbose) - quiet=0 + quiet= ;; --progress) - progress=1 + progress=$1 ;; -i|--init) - init=1 + init=$1 ;; --require-init) - require_init=1 + require_init=$1 ;; --remote) - remote=1 + remote=$1 ;; -N|--no-fetch) - nofetch=1 + nofetch=$1 ;; -f|--force) force=$1 ;; -r|--rebase) - rebase=1 + rebase=$1 ;; --ref-format) case "$2" in '') usage ;; esac @@ -320,22 +319,19 @@ cmd_update() reference="$1" ;; --dissociate) - dissociate=1 + dissociate=$1 ;; -m|--merge) - merge=1 + merge=$1 ;; --recursive) - recursive=1 + recursive=$1 ;; --checkout) - checkout=1 - ;; - --recommend-shallow) - recommend_shallow="--recommend-shallow" + checkout=$1 ;; - --no-recommend-shallow) - recommend_shallow="--no-recommend-shallow" + --recommend-shallow|--no-recommend-shallow) + recommend_shallow=$1 ;; --depth) case "$2" in '') usage ;; esac @@ -343,24 +339,18 @@ cmd_update() shift ;; --depth=*) - depth=$1 + depth="$1" ;; -j|--jobs) case "$2" in '') usage ;; esac jobs="--jobs=$2" shift ;; - -j*) - jobs="--jobs=${1#-j}" - ;; - --jobs=*) - jobs=$1 + -j*|--jobs=*) + jobs="$1" ;; - --single-branch) - single_branch="--single-branch" - ;; - --no-single-branch) - single_branch="--no-single-branch" + --single-branch|--no-single-branch) + single_branch=$1 ;; --filter) case "$2" in '') usage ;; esac @@ -385,22 +375,21 @@ cmd_update() done git ${wt_prefix:+-C "$wt_prefix"} submodule--helper update \ - ${quiet:+--quiet} \ - ${force:+--force} \ - ${progress:+"--progress"} \ - ${remote:+--remote} \ - ${recursive:+--recursive} \ - ${init:+--init} \ - ${nofetch:+--no-fetch} \ - ${rebase:+--rebase} \ - ${merge:+--merge} \ - ${checkout:+--checkout} \ + $quiet \ + $force \ + $progress \ + $remote \ + $recursive \ + $init \ + $nofetch \ + $rebase \ + $merge \ + $checkout \ ${ref_format:+"$ref_format"} \ ${reference:+"$reference"} \ - ${dissociate:+"--dissociate"} \ + $dissociate \ ${depth:+"$depth"} \ - ${require_init:+--require-init} \ - ${dissociate:+"--dissociate"} \ + $require_init \ $single_branch \ $recommend_shallow \ $jobs \ @@ -415,9 +404,6 @@ cmd_update() # $@ = requested path # cmd_set_branch() { - default= - branch= - # parse $args after "submodule ... set-branch". while test $# -ne 0 do @@ -426,18 +412,15 @@ cmd_set_branch() { # we don't do anything with this but we need to accept it ;; -d|--default) - default=1 + default=$1 ;; -b|--branch) case "$2" in '') usage ;; esac - branch=$2 + branch="--branch=$2" shift ;; - -b*) - branch="${1#-b}" - ;; - --branch=*) - branch="${1#--branch=}" + -b*|--branch=*) + branch="$1" ;; --) shift @@ -454,9 +437,9 @@ cmd_set_branch() { done git ${wt_prefix:+-C "$wt_prefix"} submodule--helper set-branch \ - ${quiet:+--quiet} \ - ${branch:+--branch "$branch"} \ - ${default:+--default} \ + $quiet \ + ${branch:+"$branch"} \ + $default \ -- \ "$@" } @@ -472,7 +455,7 @@ cmd_set_url() { do case "$1" in -q|--quiet) - quiet=1 + quiet=$1 ;; --) shift @@ -489,7 +472,7 @@ cmd_set_url() { done git ${wt_prefix:+-C "$wt_prefix"} submodule--helper set-url \ - ${quiet:+--quiet} \ + $quiet \ -- \ "$@" } @@ -503,32 +486,26 @@ cmd_set_url() { # $@ = [commit (default 'HEAD'),] requested paths (default all) # cmd_summary() { - summary_limit=-1 - for_status= - # parse $args after "submodule ... summary". while test $# -ne 0 do case "$1" in --cached) - cached=1 + cached=$1 ;; --files) - files="$1" + files=$1 ;; --for-status) - for_status="$1" + for_status=$1 ;; -n|--summary-limit) case "$2" in '') usage ;; esac - summary_limit="$2" + summary_limit="--summary-limit=$2" shift ;; - -n*) - summary_limit="${1#-n}" - ;; - --summary-limit=*) - summary_limit="${1#--summary-limit=}" + -n*|--summary-limit=*) + summary_limit="$1" ;; --) shift @@ -545,10 +522,10 @@ cmd_summary() { done git ${wt_prefix:+-C "$wt_prefix"} submodule--helper summary \ - ${files:+--files} \ - ${cached:+--cached} \ - ${for_status:+--for-status} \ - ${summary_limit:+-n "$summary_limit"} \ + $files \ + $cached \ + $for_status \ + ${summary_limit:+"$summary_limit"} \ -- \ "$@" } @@ -569,13 +546,13 @@ cmd_status() do case "$1" in -q|--quiet) - quiet=1 + quiet=$1 ;; --cached) - cached=1 + cached=$1 ;; --recursive) - recursive=1 + recursive=$1 ;; --) shift @@ -592,9 +569,9 @@ cmd_status() done git ${wt_prefix:+-C "$wt_prefix"} submodule--helper status \ - ${quiet:+--quiet} \ - ${cached:+--cached} \ - ${recursive:+--recursive} \ + $quiet \ + $cached \ + $recursive \ -- \ "$@" } @@ -611,11 +588,11 @@ cmd_sync() do case "$1" in -q|--quiet) - quiet=1 + quiet=$1 shift ;; --recursive) - recursive=1 + recursive=$1 shift ;; --) @@ -632,8 +609,8 @@ cmd_sync() done git ${wt_prefix:+-C "$wt_prefix"} submodule--helper sync \ - ${quiet:+--quiet} \ - ${recursive:+--recursive} \ + $quiet \ + $recursive \ -- \ "$@" } @@ -656,10 +633,10 @@ do command=$1 ;; -q|--quiet) - quiet=1 + quiet=$1 ;; --cached) - cached=1 + cached=$1 ;; --) break From patchwork Wed Dec 11 06:32:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roy Eldar X-Patchwork-Id: 13902984 Received: from mail-ed1-f44.google.com (mail-ed1-f44.google.com [209.85.208.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 67AD51C4A20 for ; Wed, 11 Dec 2024 06:34:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733898843; cv=none; b=fXHme2AUtucpZc3X7uO1x94WvHwRozKMu/DkBEn8ncTzfkmpReVZo6hORl0Wd3H3nClY4N950gkwSHtQItx9jQP1iSARAySaa5l9Qxyg8OyuRubV4UhGKyo3+OgZFlFP6EkmlzLHwSAg2LcmV5v87tCtX2ftj0V00J2j4c3+Vow= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733898843; c=relaxed/simple; bh=ev+11mU5iXv4dbeuKMdhAAy1wFhfrBowfB/dKnXoVF0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=mHqBgdoNrSOcLhXzCxDrFsD5pua6OfcLjJfMC9cLmdAgJT4s9LyXosy1yC2y5kwJXhX1jyrPNsQNFVAqSXVhTUQXZBST4/6fIoQ0HANhAH043nXE1MRO3lilAoU7K03WFzHs6LPM511sDyuVDoK7ZUOe+FgaBA299lP3UngONnk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=QbQlWeHt; arc=none smtp.client-ip=209.85.208.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="QbQlWeHt" Received: by mail-ed1-f44.google.com with SMTP id 4fb4d7f45d1cf-5d3c0bd1cc4so549470a12.0 for ; Tue, 10 Dec 2024 22:34:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733898839; x=1734503639; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=n2yB1tEk0Nsnls8/N5W2ppxgI65fHdFdL0H5PwofDMQ=; b=QbQlWeHtI7dFfqvLlCWsh6SC56RYPsjTn2dZguI5S7MufAr3rsh1LpSTPXDnCpzxEl am/6qDivW1PJgULzoCt5DExIEz4wHxxESsw3ZnuNEovfpZWzhUpx1iwE7/yeufT9orAd V/f1Lqeus7Z6DHTwOvKQk/ei0zIeFg/Rr06lEPdOQepi6Q1GAyJS938tPUP94fvU2Jkc 9S8Q9ywC3OOfqF+hI/abiJJDXcvGVSlhaI4wmHARGKFivMiIcPOlzQD+l1nQpfwdStIU uXwCwxsuCmsyHmaGKtSQSKrcZs/hNhRMp8hbhpRlHvG8z+DaQLUbQtCd1tmniXJJZudx UPDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733898839; x=1734503639; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=n2yB1tEk0Nsnls8/N5W2ppxgI65fHdFdL0H5PwofDMQ=; b=ZRAJ6WcOwptdhrtx8sPVLSoV7X7KgJvGnSKbftixVlbqksT2ICuQyGfkizLyVdbPky ON/R3F/v79U19UrNUivgLaX2qdP5pWk/fyrFqcthALZ6Ruh3Qlv9VoNASzz9btxFmXgB g+r8PiTcFWAcNGO3mNxYbSPQZccjL+Bz24eHNOuamTAjDbss9fe8IVdZ61l5X9XpmzCx ANAJKiWz+7bwoA9Cf/qygVfkpf0y7GLDsrHqznMVcCz1akhZmoFdvXbQpMGkaGF2EJA1 /F+hrKzeOK4oNZsdt030lxDAXtnEJnouOTf0ECv1UQ1RjZc3PyDSXrIajJhemPAy9C9+ Ze6g== X-Gm-Message-State: AOJu0YzasxFQ6+MJHnm06PMJp7CffULY0UpF+DO8qK8nWSzKHSsLlS9v vxK6kF8d3ZS0XYvcBBduzMn4xhGOUaruIBU1X6AL/jGmVzfN0StXjsJQFdvl X-Gm-Gg: ASbGncsn894Lg8ROGix6qEoauIrz8ZgK7TAIU57Nqv1nRvb6+ZQQ1LJONxS4porFLJk tyEFV+5FPN3tFuovmtE7sApeq5brAmhBoOfXrCryDESmOrWZ2VPO3GFsAc2wxY85Lbek5+pa2Vm LNDgzKL2YNSQwTLG8PV0JMsYm7+fRv2PSoeVF+ViikrYfOlnV+tGi3ar/djzorCnr7IqzdfCf5I fCFNx2LgSDr8POUPPbHHrCrwyRbK4115M+p/k7KzxrjCvUGYZV2KfHEmDfI8y8= X-Google-Smtp-Source: AGHT+IGS7t6WJoPru2u7ppg5tJoQbyI9ZlGSX1qnSaAU9xAVsg+8DEZA83ABCl9Aphm8kjQCJuNT2Q== X-Received: by 2002:a05:6402:35d5:b0:5d3:efcf:f163 with SMTP id 4fb4d7f45d1cf-5d433179cecmr377199a12.11.1733898839388; Tue, 10 Dec 2024 22:33:59 -0800 (PST) Received: from localhost.localdomain ([5.29.161.23]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5d3d00a0370sm6875803a12.6.2024.12.10.22.33.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 22:33:58 -0800 (PST) From: Roy Eldar To: git@vger.kernel.org Cc: Junio C Hamano , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBC?= =?utf-8?b?amFybWFzb24=?= , Johannes Schindelin , Eric Sunshine , =?utf-8?b?xJBvw6BuIFRy4bqnbiBDw7Ru?= =?utf-8?b?ZyBEYW5o?= , Roy Eldar Subject: [PATCH v4 7/7] git-submodule.sh: rename some variables Date: Wed, 11 Dec 2024 08:32:34 +0200 Message-Id: <20241211063234.7610-8-royeldar0@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20241211063234.7610-1-royeldar0@gmail.com> References: <20241210184442.10723-1-royeldar0@gmail.com> <20241211063234.7610-1-royeldar0@gmail.com> Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Every switch and option which is passed to git-submodule.sh has a corresponding variable which is set accordingly; by convention, the name of the variable is the option name (for example, "--jobs" and "$jobs"). Rename "$custom_name", "$deinit_all" and "$nofetch", for consistency. Signed-off-by: Roy Eldar --- git-submodule.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/git-submodule.sh b/git-submodule.sh index 6df25efc48..2999b31fad 100755 --- a/git-submodule.sh +++ b/git-submodule.sh @@ -40,11 +40,11 @@ init= require_init= files= remote= -nofetch= +no_fetch= rebase= merge= checkout= -custom_name= +name= depth= progress= dissociate= @@ -52,7 +52,7 @@ single_branch= jobs= recommend_shallow= filter= -deinit_all= +all= default= summary_limit= for_status= @@ -108,11 +108,11 @@ cmd_add() ;; --name) case "$2" in '') usage ;; esac - custom_name="--name=$2" + name="--name=$2" shift ;; --name=*) - custom_name="$1" + name="$1" ;; --depth) case "$2" in '') usage ;; esac @@ -149,7 +149,7 @@ cmd_add() ${reference:+"$reference"} \ ${ref_format:+"$ref_format"} \ $dissociate \ - ${custom_name:+"$custom_name"} \ + ${name:+"$name"} \ ${depth:+"$depth"} \ -- \ "$@" @@ -240,7 +240,7 @@ cmd_deinit() quiet=$1 ;; --all) - deinit_all=$1 + all=$1 ;; --) shift @@ -259,7 +259,7 @@ cmd_deinit() git ${wt_prefix:+-C "$wt_prefix"} submodule--helper deinit \ $quiet \ $force \ - $deinit_all \ + $all \ -- \ "$@" } @@ -294,7 +294,7 @@ cmd_update() remote=$1 ;; -N|--no-fetch) - nofetch=$1 + no_fetch=$1 ;; -f|--force) force=$1 @@ -381,7 +381,7 @@ cmd_update() $remote \ $recursive \ $init \ - $nofetch \ + $no_fetch \ $rebase \ $merge \ $checkout \