From patchwork Tue Dec 10 18:44:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roy Eldar X-Patchwork-Id: 13901924 Received: from mail-ed1-f42.google.com (mail-ed1-f42.google.com [209.85.208.42]) (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 B20FF23ED5D for ; Tue, 10 Dec 2024 18:45:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733856337; cv=none; b=eh3Kl2Q2xeCz6D2qDImhrGbpiIPcr4TcSYRmcdJOHEOLK+R1cnd/UBKuJWvmKH3fVrvovEd6HC4GKnUT/lR0LYt81oKoN4H/Q9knGs66/bAqW3QYYwSTu+c55aDdTQuOCC5L8s7MDX1Elhyr5XuJJ1V+ZTidVuv2ZrYuli1O7zw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733856337; c=relaxed/simple; bh=14mN/uQsgMY2nZdTzHXDlnXsPn04Jyi7B7bY8xMAvjU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=LAe2rwVTPrcAa+nO/fNTubAcpwSW2qkhdvrQFdt6mPlWbFV8So4rbAa2iMCTk6WNV3d0H5wTKACXqosFoMQFZ5zlohyO53taH7wDWVqy5TChffc4SDg0TND22jHQ5bsyGtCrxzPDZXuLYJVFv9ZbF/hV5Z3UQLDLrvq6CeOOkcY= 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=U731u3/b; arc=none smtp.client-ip=209.85.208.42 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="U731u3/b" Received: by mail-ed1-f42.google.com with SMTP id 4fb4d7f45d1cf-5d0b85c5574so704550a12.2 for ; Tue, 10 Dec 2024 10:45:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733856334; x=1734461134; 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=U731u3/bxGAiz4dPdZlSjFpSOciKihfhcU1rU73NOALRiHC/R+OXrGkt9QrFWsHk39 a0rhCFD61DeLmCtcVd4CcfvNiqbCnIU8+YpAasH9r/bpyNjWkAjuzXJ/hQrZG8NF6HcY bHZVZJj+f7T9uft8mknKrgFqo5Lwbk4Gxm4CRaytmtkBfC/uettkfSkonKpl9F/LKRF8 PV5Y6t4A2uFxfeypzsTYwP8B/t+UkFjaoLfysLZk6ueK6VW1nT4UES7TqnGtSB0A/LGk E/wZ/sEeNVNQbKJTz3JEhGobb0csi1fFzCKAka67iK5/G6AdZBEt8ZSl0L41nL91R/28 cEEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733856334; x=1734461134; 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=nsdzdKXzegKSsCUZ2VmNBI8va4cUsWWl8rHccjDQ22wAbCzB+nJZiThCDfc6ApCNIr u6VAMwfMiVF3G+BSXGc1csVr1Z5lyP+A4j+wEW8iJwCDeivoxg4hLnffTR0Kw9gBeGII fYw+flxxNxEmiLyKugaVRCAAsKbguCAO/DOTFMfCMdsOY+2rhfgJOrajJ7ItoNK5lu/R LHtSmhKP6OqC50ARdHoBUkd2L1NxVhS9yv9//RHmvd+SVTZcm0LkY76VToMTzftd5ydA Wi8fHDHRhm26lFpMTxJu+oZhHUu4iFR4M0UxO8gT8jF9QjiD2T7wy5PPr2/3c3oo/9p+ IdNQ== X-Gm-Message-State: AOJu0YxvwM6zRE6fYV2DqpefzyGzevy36TzVq1SmATFMQycxJ74XVn8z blF+JCHCj2U/K4rSYorBy0FiAOwDixM/orOx7uuH9ngyHZenIr0fQ4L4Aing X-Gm-Gg: ASbGnctjixZ8qybMgKepeKVKNPvh39+xsWW+8HRpLOHQJ2JZ1IPrd9l/JxbCqBiOSKv JSLsUsb4Hj7qQACRMCjycrH81wtJj1y9KDVFT+myuM+GOeB4UMBecu3dc4sH1O391dTGYlxriR2 q2qXkgO8kPti5FZmK7UbJBSCDLc+VtY73HVibGNk/TnWCJpu06T/dCijolnkBsewIALCIk5UFIW X6bK/MivhZVB71iBZgOJre3Lrlm1vN0AHckPeQletp5EdPmL7D6beRuZUk7FDw= X-Google-Smtp-Source: AGHT+IF92yap3Mhrx+FBLiLZlRyTdtX1+7TxGoL+YRZKUvcrgmMQStwrR8PyNT5KmlXLL+npxVw7+g== X-Received: by 2002:a05:6402:26c4:b0:5cf:f1fd:c688 with SMTP id 4fb4d7f45d1cf-5d41c40cc4dmr1715622a12.1.1733856333532; Tue, 10 Dec 2024 10:45:33 -0800 (PST) Received: from localhost.localdomain ([5.29.161.23]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5d149a48882sm7895896a12.24.2024.12.10.10.45.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 10:45:32 -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 , Roy Eldar Subject: [PATCH v3 1/7] git-submodule.sh: improve parsing of some long options Date: Tue, 10 Dec 2024 20:44:36 +0200 Message-Id: <20241210184442.10723-2-royeldar0@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20241210184442.10723-1-royeldar0@gmail.com> References: <20241209165009.40653-1-royeldar0@gmail.com> <20241210184442.10723-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 Tue Dec 10 18:44:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roy Eldar X-Patchwork-Id: 13901925 Received: from mail-ed1-f54.google.com (mail-ed1-f54.google.com [209.85.208.54]) (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 AEC1F2046AF for ; Tue, 10 Dec 2024 18:45:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733856341; cv=none; b=X/QuavvqaBruhiJJTmskL2CGEMCCP18i+LceEU4aniBhXviA+vAEM5/j7fwzwUrNQK2Nya/2vGFJxKm0gs7DUpzeqovq5JE5cKhCL/8GfMdGFdo79yYIGo/oMZLlp/hQl5xQjub+gXVxxzrbtBU368z05zH5uLpno3wfdqhwIp0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733856341; c=relaxed/simple; bh=8T2UCdjSXSwqFmhj4MAHT9nZHFKA156xwfqP/euEr6A=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=IxjP2rcetbWDxjBegeT5nHOAfhKd83lcIPiKl59k974DMYwVlarbOy4lozAxJKUdiEhuelxUzAIufreVa10L19txH4ERd7dd8/6xVjDzRbbWUIyYctLAahx4Ud7WLaKwTIqh1PMM+DoHsbUxd2b1fzsvNX4OysKbg3YjLBIYGZw= 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=fA+i7tYZ; arc=none smtp.client-ip=209.85.208.54 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="fA+i7tYZ" Received: by mail-ed1-f54.google.com with SMTP id 4fb4d7f45d1cf-5d3da226a2aso359844a12.0 for ; Tue, 10 Dec 2024 10:45:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733856338; x=1734461138; 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=fA+i7tYZRUPoEX8ZyPM8HU6ecbFZclZ8+pCkKi6HgNZvjWyzOAj8X24pQe+gNiIGYO xobNpV/SUhEqrOpmEQ6nSNzhpjE+UP+yjP92nYrXBTbxuRxnfZ8s6wk5uRBRZ8ilnFNz 3ejYewVfYKiDWX71Na/5+6s2p56Xpq0tlMwWFaeh0qC7HPJKR5tn8hB/Rp5r/+MQUwdi ijn3ZkbnTT0tgl3e9MhAG5sNBGHJz76sf8yBfkvsJu6tnmWMA8p8CecCRT8dCW2efjc9 ncQdqI6k4nUKFLd22kAcmsq3ftNyEwXE0Rwt/cMD3tK5CBygznRxfEfqIwcm0WmvwLLQ HiAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733856338; x=1734461138; 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=RwXZAeDzfxGlbJ+EtrpUpHT04xkt9kq22uyqyymHeBc1xjXxp4K5LkXrOR+Ne0Wlia CD+QR8Y6vkxI7rMsxpesiW35WvePASC9rlnxe05nn1r7cYN+dtKy6letrrCU+8X0uIE/ TfRgFMzoibLXvHUhYDX4T+k66Jib5aYBPjh6f54fKfGCe0u4oPfhoPw7EY+z/XQkrl8j MIrYl9DJHSL4xrKxZqS1DN42eJXycy01ohH/77WXzhJQDQpc7+LBMajOxI5XhUjpBHDg vR1Fi8sLTj8OxoiEEKIBXod7xelx2EMPd2BHaAJ91yyNmi0Ift3+aRjwwETDt8cSeY+u XLAA== X-Gm-Message-State: AOJu0YzS5HYbQInb3JSPURfCnolnuLSGi3s1IOO9oL3xuqDlxPaNVSLv 0DYGJv9vVNZihC0gy9X5wW55GQvcOmE7pBGoD4l0D1naKW7XwQlLV0SQWS7F X-Gm-Gg: ASbGncsbBIleSTG8S8cY5q7NqlKThQJdYGNQTQUAPcCZ4heeM8fLhaWRozoHoc+Dkxz pd301YSvRH7fkcpxhtUlNO5bCbhw4k5VFfXpMCrUwAObILlp8bTNhgH+JKjaRJKepdMQTs69+49 Js43TjwOJXWjD4iXMbCYQaAcxTd0CggKfeMX4UAcCodeIOD8Vuj4jm+gpqmP7uKMws+KixPXW08 ZuL+KZJSTGQdUFRMiy22Zwwf9VKOCVN4qqykG8o3d7AkuUYgO4a+RLX+t2orL0= X-Google-Smtp-Source: AGHT+IH230h6VffoYY4bYjosjEAaS2cjScWPr4MS2FbnX8D+pqiOOqtIo0SdeZzunvTyJYQjrCZYlQ== X-Received: by 2002:a05:6402:234a:b0:5d3:e843:fcfd with SMTP id 4fb4d7f45d1cf-5d41c66b00dmr1659679a12.11.1733856337617; Tue, 10 Dec 2024 10:45:37 -0800 (PST) Received: from localhost.localdomain ([5.29.161.23]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5d149a48882sm7895896a12.24.2024.12.10.10.45.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 10:45:36 -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 , Roy Eldar Subject: [PATCH v3 2/7] git-submodule.sh: improve parsing of short options Date: Tue, 10 Dec 2024 20:44:37 +0200 Message-Id: <20241210184442.10723-3-royeldar0@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20241210184442.10723-1-royeldar0@gmail.com> References: <20241209165009.40653-1-royeldar0@gmail.com> <20241210184442.10723-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 Tue Dec 10 18:44:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roy Eldar X-Patchwork-Id: 13901926 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 8E820214210 for ; Tue, 10 Dec 2024 18:45:42 +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=1733856344; cv=none; b=mG0qtfkDX+hJcHu8xH0nnJ0tkbSKkhjBiL54Cao4MMYec8bajrqClZlnfS0Z3m+KGdIxGGaJdBxIDVFGbyslWfVcwsl2xWw7wc6GYUat9njscavGNDScJs6n/QS9jMgl5yyKZUyhwK1DDMByBanKooGCaFCLTya3cGmRK9+y4VY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733856344; 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=cH/AWVwnINNmqkMu4E+/ulqfzIEqve8gkspXa0WPc6aPh0eK7u5idtoEd9FPKLwZCwhoCRSRffZZrTGHiEMcbs+HnAqFdm4nxj2n/AUvhCSGKAMFNy3CxQ9RjslQZG9BSf6cXIuAZEFwGT6pn80J0ExXSNll/N3Im8oGFhKEjps= 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=jbjSQHyW; 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="jbjSQHyW" Received: by mail-ed1-f45.google.com with SMTP id 4fb4d7f45d1cf-5d0bf4ec53fso989866a12.0 for ; Tue, 10 Dec 2024 10:45:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733856341; x=1734461141; 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=jbjSQHyWb0UQykp8b4o2OdiSdkCxd24CO/yo9jg5g5/vqL0SPWICBulT48FvEvzrxJ nn11nfEP0KOoZvOrpoM2A6miHgsKTDFmW5V+qRbkr3/I1xxsYFv7VyNtlM8Od0jfcvCg 7hrEb8k/KSpPlZ5sB/2ltw0aawq7Mdev8NFFg/dqqZPcQIeQUBEiO43twby/B5ccUCQi Fbf8I1ugo7QKUu+7dK301wyzaQy9HlePEB8rNwg9jYUPx4GOKYCUG5b0oLBegO/B7hlg QJpDxkxr9i/onegRReggknJVOBtkN8iiZ206FP+6vK1+r0tNHn0cRIQpwrJKgsz2pUFr 4bXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733856341; x=1734461141; 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=ixf8JiEMcgnVng5jYJIpDvigTrXO83kfUb/Mwz3jbm9duzZmAo/Rx25Gm5Vd6DGwoN heMrAnSSwMKHp3sf/f4AqspIKxiPQaAWNUQPQ+g8M5NQTb1Cch4AVPqReQ4BgRv/e2wl 9TdYI8VTltPHBtyU6VAkpUQcDn3N3OKCYY4F2ynaauhgx7wgr9f513vaiH4ZOZcVFPXh F7rbrX7X8A276DtmLXLz28uhD8iLP49g0q3MItwJSFIuPIOfxni7Q6GsttxwNZIhJOFZ svFsl5GTNGjD0gctLdJqk7t88CPt5icLnY+tqTeTfuz29vFNkybJSW1yI29uwyYiV2B5 f5Xg== X-Gm-Message-State: AOJu0Yxnzx0VtUFZXjQPsickE6c7fcs9UmKKJh0IB2Q3i5KR4HC7hA6b 9bydOdqMUvWSx36TeMyb1KTNJRfbX+Lv79t1NfmyAA71BvsQE+0Ng43LzSx3 X-Gm-Gg: ASbGncvG+gUTl3WJHKn5KAoUi384oNgrxLRcYUzHHv1OWOdd9h/ioFrTEak3QHccZG0 uL5fpxzsKmF1nqryaXZ689ojux5TUs8/hcLBcRNZqa9WTVNjodJACQgHDscgyPaa4VaE7RMkm/9 wjsMyzUkPuEKuwUXhDf2PFa+evcN6pZb54Qmv+eySUsQZzi0fmLlrdwSV0IsX3cwUpdprdbFE7a rzSvWn8P+NtfTpTRtWYyw6EmP74CWKBJlkNRYOH0JnLf1T01sZd+HrRz6audNY= X-Google-Smtp-Source: AGHT+IEc0g0IcJPdj1/2VL8qowSUougwjjXsaHfy0mpqfqMzfSsYD4NFtlg+i0JKvK9MAfOV5rmPGQ== X-Received: by 2002:a05:6402:348f:b0:5d0:bb73:4947 with SMTP id 4fb4d7f45d1cf-5d41c3255a5mr1846421a12.0.1733856340497; Tue, 10 Dec 2024 10:45:40 -0800 (PST) Received: from localhost.localdomain ([5.29.161.23]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5d149a48882sm7895896a12.24.2024.12.10.10.45.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 10:45:40 -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 , Roy Eldar Subject: [PATCH v3 3/7] git-submodule.sh: get rid of isnumber Date: Tue, 10 Dec 2024 20:44:38 +0200 Message-Id: <20241210184442.10723-4-royeldar0@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20241210184442.10723-1-royeldar0@gmail.com> References: <20241209165009.40653-1-royeldar0@gmail.com> <20241210184442.10723-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 Tue Dec 10 18:44:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roy Eldar X-Patchwork-Id: 13901927 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 BCA7B21420F for ; Tue, 10 Dec 2024 18:45:44 +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=1733856346; cv=none; b=akQz06OCfNeJ8VBLNSd9mS/R1+d+weKqr5RTzv63evi5XV/2P9UGG1y7Tq3j5U6R1Z6gd2Oa2NwD4OD5PYAbIn7Jnr3NsZuAA/bjUNhncOYHZYzjqL2x8rLD2R4gR4HvMhebYOt1sghCsuEJBm7ky7NCjz/bzAAWW5rY4QKv9TM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733856346; c=relaxed/simple; bh=s+FdjAYhpdB1k4KIYUhTwSQn3ybiSNrVZ6lw5awsLrQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=c4UJaN6qMea3UJKK9CVWkYsvOXK99QhI4uZ4GYgFbXeS3qleqbLAxcrxa45ZY/AKxNuPgKSajRwtt3zSxbo3Lh+DoIYWsnSWT7JUr7uXawXiHStHL5KpPYBgQtXJBZlm2+4+q0wtIhIWMmEnHDUdXukTWauvqORUwlWLmbPI+Bo= 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=UCYWOHep; 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="UCYWOHep" Received: by mail-ed1-f44.google.com with SMTP id 4fb4d7f45d1cf-5d3ce64e7e5so552495a12.0 for ; Tue, 10 Dec 2024 10:45:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733856343; x=1734461143; 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=UCYWOHep7FkCEpDV4tIJ9gNY0mla4yx9TX7Z7gT7dCMB+/IXsC3rlAMJjpSkkMMVpn hY3sTO2JwnfZZcy/kwqSTc3tHpezCRgPHWEmkygkXBTQo/hHfEtYqF88kulnEY0m+Rrx hLnllNrD2FHLf6XZ12ahqlnorog7xnztP4cXlXfZGDIScrdsBdy1Jek1G//X0YK7pwr0 s0IEY6SvR40+ISMAvn4YPhYVWdflu5GJub52Cqvo6BWYzgnVR9U7ZkYleCzViMqHcX+o tZT7lhs8v+N4X0yLWLnnC6GBga3LEYlS8f7BMvV5d9Kns56VpTVWX6Pvf1WO/eWWPfvF vAjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733856343; x=1734461143; 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=DHq/2269sbHDLkQ149boV8HtJMuKrrrVPs/MMR6Y8zDn0aEV/uuNS2WWSjWfG/ci5g 0vacqepzs2/sMRsgHeyjaySylYtvERc3ChsXdYvYq4t+NvH5tnqabSxo/x4Nas2Hq6en 1xQ8180Ez0nd5HLx4LAgMZ9B3a043qg7BjzzzCEsvxCkMAibn9NIaDKCFcF/93xhw5rV tpb/m8L4I606/zjV3bCKMzNyIiv5O/CDP2jk/Kdv2k3laJ1uuaQVm2teOeSE7ENkpkbp VJ5xYnwXr4dZzlPxwhxrWfXeoLvyqffPoNTMGzzdWKe7HBpi6vV2aSbt5mMYizugXWXp hqeg== X-Gm-Message-State: AOJu0Yy5+TDzlr/z9WloOWZdpFdikaQwQuSO1GIgt2WlIxFs+CxBeOHh B4IBjkFl5aePhpO7J1F9ZzN7US/cb9WLBfudrfX9ArDzahzJueLpH/uhm78H X-Gm-Gg: ASbGncuBmjo961EGPiUET0eryoUD7lDh32j43r+PisbU8KCbSwWCMREE+f6aOoOnBXD q94Aqioqen7XxPky3NOBTV0MVF4ZosvhaB9qCusAtQvV6dqoDAKEfalP0PqIhql6ImzKxLIdEfU DfI5FDj0GfJU7vniAIQSuZMhmmlbF9DUQ3loBWc3hx0XhJ1XyUO+BJgoWu+zygD+zBFF7ZCZGKl 6fO/cLxyZk72GRn5A562TVbzKoSOa5/CA3kxeZMf1+5FbfIoUNA/xzVMKfomko= X-Google-Smtp-Source: AGHT+IHsmAzm6fw+pCXLxeIDPzEFkax3AnvykRV36499JQ2E/8lHc7BUxXJjnO6zGLL2Q/fVxUNa8w== X-Received: by 2002:a05:6402:2681:b0:5d0:8111:e946 with SMTP id 4fb4d7f45d1cf-5d3be6fc185mr6171765a12.5.1733856342521; Tue, 10 Dec 2024 10:45:42 -0800 (PST) Received: from localhost.localdomain ([5.29.161.23]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5d149a48882sm7895896a12.24.2024.12.10.10.45.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 10:45:42 -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 , Roy Eldar Subject: [PATCH v3 4/7] git-submodule.sh: get rid of unused variable Date: Tue, 10 Dec 2024 20:44:39 +0200 Message-Id: <20241210184442.10723-5-royeldar0@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20241210184442.10723-1-royeldar0@gmail.com> References: <20241209165009.40653-1-royeldar0@gmail.com> <20241210184442.10723-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 Tue Dec 10 18:44:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roy Eldar X-Patchwork-Id: 13901928 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 7EDA7214234 for ; Tue, 10 Dec 2024 18:45:46 +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=1733856348; cv=none; b=d0F757xFSk7YltI+D47XNVTrj/fDBkiyOrni49KoInIES8Z1nFOlktn19yVLUOCl2RkywGHJKBXwWsO7awGzkPtnQX1S23TVx70b40mluhqLYuWI31VJgBbKq9CFzla16uswMfxAC6qCuIyctM6sCgHA5S+2go9BoQfLQ0Kj6Uo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733856348; c=relaxed/simple; bh=n/SgS0D1kkStv0/3Q0fUqEhxyEgITxIeMACvKczgwPA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=liGaEfKs7zpYSu65gPvpkJjzgmFQsg/TvRyb1Eq0b8BvWevspeq5Vj1Ru4ZRqmKdqEpHSYXVO1OP+4pJbzjrFZ9W4a4gFt4t9NpeGAYenU+TD10BuMp5YDJZhNW/VC+durtc3CtgapRQCdjY6TO0u+QAKyAE543SZY07XmfwTkw= 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=VEpK9mqq; 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="VEpK9mqq" Received: by mail-ed1-f45.google.com with SMTP id 4fb4d7f45d1cf-5d3c1f68ef1so822811a12.1 for ; Tue, 10 Dec 2024 10:45:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733856345; x=1734461145; 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=VEpK9mqqFhq+5iSxRvQRLxRIgY/onW9XLQrNXjur4d13NqXnnGyFXkGOQQLAgvEYP/ nYBZ2GIrLm+a6xgz8y9txINeiYdYAwnjJiNji7rCN8gCK0QUK9wl+1ypbr6LM5oYqu6U m8buah1Krzfj6AOd11TgWPBpbuM46Hn86NDgw6ubZfwJbuf0x2oVIlvBm4lpU68DXFh1 QNTWCV4GawX8tTrGgvfR3Ww8EIKoCh6fMruM5we0Bv92e668u+OOSsTckI+5eQ/Lfcov UQn8g7iNwqGFoQZ2mDKcXJpduuV1PNsZA4I+09QgnuJXHMC/bh6PAJPk9l159talIeJ0 zoOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733856345; x=1734461145; 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=qcFuuAfI5iTQIfR5vtt+oWWq7lWroM24OQSzad4STvTaoVN0n7TrpY9V/WJ1jg0MXy +cu1J9fySBfDXULt8k9VyllPV/5+PxOeB63wI18sQCS1QlKQq0zSsC05ptLiU/BQnx45 MoRXFz6yHjT6V2RtdJtjpv+EBkthA9JnkKGgl2OE+i1YCnuPEJsgtJoNm0+W0F/yfFIv 1p0BGEdC1YCyaht9eazBzKtYIwAkvFkrvdQqt0nf64Al6wvGImUnmYSQAmKtUP6tRnDq B3UXwN7mdgbmuJy5MgWKhqzm5b28EtYR4q4PP31Eiz8FHXFo8lnX6nQ32Tcn+yzkchyd GLnA== X-Gm-Message-State: AOJu0YyVRtCot7u2k8u67vHIJTH/2H9uirT5OJSF+vFp3D3Z5T4j737O a7JIbDZRaKGSqPKhF36Q7n4WjIGOl3qG2Swp63xogO3ow6loaQb8ybTLpd9R X-Gm-Gg: ASbGncvTYLcUJs6T1WLV/1h7pWwashxVNThzbhmV3hCXkCBFi7Nw7QdEHq6Ga/HKNGG t+vUALnaWDMtUXI7j5MnabmhVuDQLuYhaKgKTKnTxe7FKLzLM35iufwyYcBmZ+k2YigvLLfmbV2 shAaz+buV0ruHDaLe+S6M7B2D28sUYsrz1GVr/YZH/AWMLJCSSmqd/ENbRVWHejIh63ACWwBPI+ sD2GXV1azk+7Oh42J4A6gERRULobkuiohHab+X/3AcRC5LUAALrQ9U8vh32N2XIRA== X-Google-Smtp-Source: AGHT+IEUg7ZQLrp9gm7318N4E6/1OYHpX32If9Zfqm5xWsEe1wuY/ek35ECrl5lgEWWC1nhnwJaFYA== X-Received: by 2002:a05:6402:4311:b0:5cf:cc32:82f2 with SMTP id 4fb4d7f45d1cf-5d41c572f7cmr2048185a12.5.1733856344537; Tue, 10 Dec 2024 10:45:44 -0800 (PST) Received: from localhost.localdomain ([5.29.161.23]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5d149a48882sm7895896a12.24.2024.12.10.10.45.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 10:45:44 -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 , Roy Eldar Subject: [PATCH v3 5/7] git-submodule.sh: add some comments Date: Tue, 10 Dec 2024 20:44:40 +0200 Message-Id: <20241210184442.10723-6-royeldar0@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20241210184442.10723-1-royeldar0@gmail.com> References: <20241209165009.40653-1-royeldar0@gmail.com> <20241210184442.10723-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 Tue Dec 10 18:44:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roy Eldar X-Patchwork-Id: 13901929 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 7D132226863 for ; Tue, 10 Dec 2024 18:45:49 +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=1733856351; cv=none; b=Cxn242Gp7RUFvdnEMU2kFPXYxGrKXfu+GWqigqTBHNqogYkihCtaczHPsgJmrYiem2fUZ+foQMiVMe772Hozzm/O02EWNRXHqY02+x8Lt5dx3Cxw6nFE9N5knv1mushkET+qw1eEGCA9HR6PVE35yuaIHTkC4B/KJbTpg05I6/k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733856351; c=relaxed/simple; bh=XwnzZxJcs3K00KAQwz78/GXLzjRXg5wYX9ZYRJQY/AM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=rJelkQb5j/NIVDfeoRWu2b6gToi4Frkz2AFc6RYXKL1UOpLGT2/f9SKNsvgN1ylh3aWfQKNtrhxznyoyGV/ICV9NZXfPk8m9e22npPo1CSnD16X89MGLDPdZ7dSqWgOHOvHfL4uyBOZS2KLT3VnQ4kgamJjPDIqvwSh8Hirq76c= 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=Htpa7tSM; 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="Htpa7tSM" Received: by mail-ed1-f45.google.com with SMTP id 4fb4d7f45d1cf-5d3cd8e59fdso520500a12.3 for ; Tue, 10 Dec 2024 10:45:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733856347; x=1734461147; 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=AQ5PEcU9+SKAXgBhoIQ1aBBsYp+JuKWi3YGid4h5en8=; b=Htpa7tSMLh/RxqIDaIBXF6DVFEy3MOWCegMjMsRRegbm1Mj1JRb1PHEm9qh+9lPf9v Mz78JH9tHoujMxnVNr348MNdZt42/rQ3/6UWVEna8ObRMpeK2n1yRla4XAcm9QAbaHXU TUrcmTJPqingaa50f/ywOFtcL7q6rSQT+4ceRF0Fm40mS8lS85pzn9EWJZZT8O1RQE3Q S+2NvbTXS6Rs51w3RWvWVNUPMku1fEdD9LKoypETS3Hfd5fB1hYGmJha2j7QzDDniDML amDgfWlkwsW6qMu8+TGdouGZXNHxBqnB9o3+EHOdPrvKbEvV6oNHwiQXgsyUj6VUvxnc eSwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733856347; x=1734461147; 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=AQ5PEcU9+SKAXgBhoIQ1aBBsYp+JuKWi3YGid4h5en8=; b=XEAAZI1d9hfK690np0/5JWCKQG2K0YpoRYe94OwQ2EfOioR6YccWRKDlSWA3pCTdve VC1flP5NYzVhUGt0rJzqfSw/4lvWSxxR9rLVhqvC6ZYy2mYAV4DDujwrAViGhr77T5cL 6I1bsdg3QVcFLAUYpBv+6O58bTtY7WJ9PNa6//wWmLR+Uk/miQiQzSx7m3nf2F/noALz GMpKdrYJvurbB8+C+UO21tCOq18oR41Vk6/gvJh2jwjWR6sjZeghCBLNgenx8wa6v03C VCA3PnJcYOoJFKzhMI1n4s6LsNxIGYuWav7qy/D/wdHBKvT4FzLJX881UG14WEHf18bT Wamw== X-Gm-Message-State: AOJu0Yx3Z+I6SXt3yqEUknHmGq8nz6IUmWX+aJLosKPRPP4pkaoTwHZY RsFQXwLYdpQ8oImg8QxLsc/CKRO8Xa97WKxQcoO5PydasbmKNxK2xAM/9uYW X-Gm-Gg: ASbGncsPICKZ5OIxGfQa6SUkObSZW5oOfQfjERBlUA6oSh7RKZ1hDyih7QKSs0kSobz ncQCRVlJ1p66wrDcJLDXgjW96DA9mIJjOalwYuSmp8CjafSDP1f4vURQZORSQZHUWDyY0czuNYt 3qEzDUvITmIsRFsj4C27MtFiweF2sjaACRvNXmLBwCTxjbkmvL+wt5Z6qHdEX723u/7Tqe3FsrG BTbJ1HBbr0t2X59V/aVltjY2VliWL7YqMlKSuh1f2NRim/9Vb2AOlp43nsnIuUQpg== X-Google-Smtp-Source: AGHT+IHwKMKUCoAq0QTpMqJsTdHudpUH+mCcT2LgkjawtpBfCPuVOZ1e4btksMneILiVu3+hVyR7vQ== X-Received: by 2002:a05:6402:40c7:b0:5d2:7356:e0e2 with SMTP id 4fb4d7f45d1cf-5d41c426c0bmr1836832a12.4.1733856347125; Tue, 10 Dec 2024 10:45:47 -0800 (PST) Received: from localhost.localdomain ([5.29.161.23]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5d149a48882sm7895896a12.24.2024.12.10.10.45.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 10:45:46 -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 , Roy Eldar Subject: [PATCH v3 6/7] git-submodule.sh: improve variables readability Date: Tue, 10 Dec 2024 20:44:41 +0200 Message-Id: <20241210184442.10723-7-royeldar0@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20241210184442.10723-1-royeldar0@gmail.com> References: <20241209165009.40653-1-royeldar0@gmail.com> <20241210184442.10723-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..2da4d55d64 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 Tue Dec 10 18:44:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roy Eldar X-Patchwork-Id: 13901930 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 D9B237080A for ; Tue, 10 Dec 2024 18:45:51 +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=1733856353; cv=none; b=Ex2Yrz8RGI8qPtWsASYoXzyrNRM0rg/LJwBtMmKYw0x+EoIPgOWNU6LxJOQpFbKvsRQTwNoEDVfSK+w9oPGvFe/OGRFec8E3QrRMFsxNRAY3frJNWstnD6FEmnjPulpCwAItzQlNhm97gzzNJIe+8u7MrAc5bF7fhY/3bt6ZsWo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733856353; c=relaxed/simple; bh=Hm7eRlmMLyvj0use0LjmZMSobagTJl5SUqJSZdrz94s=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=hj360oXRyyaVO5Zr2HfJVUYrQHBiTuSSx/g0rv/iT47xcxV0lh0XYFBg8j5xDSmF6ASiA/GGJZxEt3sQ0xn0Ao+Owzj2zcfr0sRcN7yIPzGtWZCQfzJb51bqIlFkPMXf7bo+qVrJAfbNmGY1bSadGrrC6QJQgvduNR9OeJ9tbW0= 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=kO4Amch6; 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="kO4Amch6" Received: by mail-ed1-f53.google.com with SMTP id 4fb4d7f45d1cf-5d0ac3be718so794207a12.1 for ; Tue, 10 Dec 2024 10:45:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733856350; x=1734461150; 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=kYGCLeqLdul+mVz5NP0TeN7a4D3K+VPQJTzGLV8jr7o=; b=kO4Amch6/hfMGG9jjAM7R+0SHpHyJ9plDPU26X39ZFsrlmHQ1O8u61OYzvrIH6Sy9t WKsxw6A32Dy5IVUIPsgErmYnKCLjFMEyxssButIUZHhIbBc4jquC9mYXC/rkDp8qwgyK n3rWkWXzGC39BOjioFbtFQlAipprMCxrt/I5UywsPSsm70NMkKARZ1At0m/Du8neaz0I Q707rA7JcdzmR2Cy9IqMnAA346DvwCt8XwXTvAD5lmxIC2ALC5PvQ8LLF6oedY+kAXWi pO+fiA0TEItMo98kUX+bhz22WkzbmMuorqMQHsrhRdDqCFxHzn8MXNNjDVZbjz2o2wqM 61eQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733856350; x=1734461150; 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=kYGCLeqLdul+mVz5NP0TeN7a4D3K+VPQJTzGLV8jr7o=; b=FuElN+nB8eme8ETUYCm6VKppjdZHqHBvzMNsrSVHn1wxUxbWq/komFeu7RxC2WF5B9 +xOglxHyq4Umjgzr1H+sHgDk6DTNsvwBwSj1+Yy46/6jeOOpLpNKmxPURBCqdyrTSZfN V9pM8KSuxJasH6LbhZWfdTGTTPFh6mSBwgN4Fridb72hFj09YTZR+EYYNIL0YyvJrMrO XWP4CNWnG+qO0if49VgSdG3vSQ6wgkL9gGbVs0S/jyCq1K4c2R+ysqKaHaWb19XtBq6y 53QPpPFElIGtRlvIzwjqfNFNcFsPQv0rTcqfol5ErpsK7laUqubNNIYGsvpKYKreKPk0 NqZg== X-Gm-Message-State: AOJu0YwQVTWmhFnWRQAaSi79lI0tMSo5W0rU7chrniJtgzz/ok3W3UEJ flEggWPR0wdHgWP4p2DyFTUZdzAq9JqtviUbK5mYvcP09ZismAKFP/u4b9zw X-Gm-Gg: ASbGncsodtkdKxbT3NQLksmoZ/ISOnUYIp6L6AVEK+V2t3we19EBkUwyGnoUGSs0EV8 C7HXS3lLMxZ79SVQw2QCaPvAbOFcVxiHVXV0O4HGrRvmuZHhN8P5+1P9zuDtpyCVP0Qnps50UvD yf+HmapkptdYdp2B0nYGGY7l48WZ6Cgkwd5HrDIWvy6AXwsKaXldrHyD+6WdM4LIizFJHTlt+5l fhl8M7hJ/z/+WOYNkI+aTTBG0KjVKTYcnEIYzkOh87zzYqsLksJBiLC9oJTuwU= X-Google-Smtp-Source: AGHT+IG2P2axJotZotl/honqhAHZHEqmkC8zfI13w/vu5Y7iEIfB5i21xVdxnNf8HDdHYq6BMAPrBA== X-Received: by 2002:a05:6402:518c:b0:5d3:ba42:e9e1 with SMTP id 4fb4d7f45d1cf-5d41c62c9bamr1446686a12.6.1733856349978; Tue, 10 Dec 2024 10:45:49 -0800 (PST) Received: from localhost.localdomain ([5.29.161.23]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5d149a48882sm7895896a12.24.2024.12.10.10.45.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 10:45: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 , Roy Eldar Subject: [PATCH v3 7/7] git-submodule.sh: rename some variables Date: Tue, 10 Dec 2024 20:44:42 +0200 Message-Id: <20241210184442.10723-8-royeldar0@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20241210184442.10723-1-royeldar0@gmail.com> References: <20241209165009.40653-1-royeldar0@gmail.com> <20241210184442.10723-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 2da4d55d64..24276847ad 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 \