From patchwork Mon Aug 5 23:59:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AbdAlRahman Gad X-Patchwork-Id: 13754267 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (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 2657415B55E for ; Mon, 5 Aug 2024 23:59:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722902387; cv=none; b=Zxv5F0+zbeggcB4iTI156/9YrvxWMbX/L/xx0KYwF5jr9cPDhobm7u5DvPFwpyMoenlsxwo2dNUtF7HPws4GSS9sIS5DUu8bau/aiC/mRkHCr0KZm5FT2P6f8iNoDOlbld2tKVNRm5xRc0OVkhIM7lWsCO7QIJmjx/iBU95bXB0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722902387; c=relaxed/simple; bh=xKwIZVK66lsDU83PNp+xWIJYWNqMc6cT6W45zMb4u98=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=eBTeJv4aiZpyaae5DtQslONHpATCs8tVSV/6FbQH8VdimT6/xn1kZfLkG0CSgJ7JYNEe3G9yHNjaToOvuxEfFzHK5D6H2KhMlLqtK1QpkcURvGt3nfA7sPICmRAkDODodA0kfm9+kJODgzwW5OYIMvjudS6U+Hs7ScfKEEBHXRk= 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=KT3JKjpZ; arc=none smtp.client-ip=209.85.128.41 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="KT3JKjpZ" Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-4280ca0791bso71497195e9.1 for ; Mon, 05 Aug 2024 16:59:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722902384; x=1723507184; 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=JrEzJJG5ccbaqYyLJ3CO8YVIHjKscITYQpuiGCyug94=; b=KT3JKjpZvkBxhfg2f7oPGs1HbUd/UrXttENkZU7mKcOsAkEnwO2oKxwxC6d2BmR63/ 9ctRpn95XBREYKIDz+wdO+9EPR3r4rqfkqBMfqdLrM4179jNeD3dHZGg7els+m5/S6j0 n/a+AwFeky+19B7Wod61+RCJVDbEJifDBDrn9P2WFUNtkkVlNKLQI4iJTFeh7gIM0WyR zG+5onSXdGxVbxRL74JqD3xCqBDM6MKGkcRDFv/1UU/pzhibcFkK/q69Qk8petAJLQZ1 xrDfMl4H07Is8VOf7WGlClK99HZHI/9bQr7ze1wS0he9zosGSbYDZRsOwyy8op4LqCQm jniQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722902384; x=1723507184; 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=JrEzJJG5ccbaqYyLJ3CO8YVIHjKscITYQpuiGCyug94=; b=P12Ma8mqVMdyu1ujR+pbRNiy38i9sqWt6K0ZmK216SWq9FP64q6b4eLR8btduYVDgK Kb6EdBJVoQsLMdG/wkkN4i5VtYJeWsQ6+T8OrOG2SfvpKsdtmkznQXwudqnq3SeRqEfv itVSVAR9URNTDdyaPVNZKMROms7rd0jSwoSU4JdNljf67eWKzmRdn/9cUe0fr0xRTefj htla215i6+vriScjicwPRm5VdRbOuom+34POf+KxWCkV6eKfD+4qQx3cOneANsdHLsrw SbjVezSc9onRTXtkRwWJQHoVgIhHc3qTx68FxEpdIqZiKSEMIO8VZ8DlkkbKKzPdp7Z8 voXw== X-Gm-Message-State: AOJu0YzTD2m56wJcg0pe00qozK8EXcQJFPY7LNSp6kTD4ZE0O9zBNKFx wWlXsHPLBUrlkx9X7rVG2ynFBidGbKmUyXj9liJLK92Zsf8wTjqvzqEQa52r X-Google-Smtp-Source: AGHT+IHS4JCIN5ZCjDks9Wy5hrrQJnWZy0qZGOSvFgo5maSCGqM50Hs06nCTkYhCLSl8aN1lbRH2Ow== X-Received: by 2002:a05:600c:3587:b0:426:6ed5:fd5 with SMTP id 5b1f17b1804b1-428e6aebc45mr97389895e9.6.1722902384057; Mon, 05 Aug 2024 16:59:44 -0700 (PDT) Received: from abdobngad.. ([197.40.47.44]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36bbd074583sm11219065f8f.108.2024.08.05.16.59.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Aug 2024 16:59:43 -0700 (PDT) From: AbdAlRahman Gad To: git@vger.kernel.org Cc: AbdAlRahman Gad Subject: [PATCH v4 1/8] [Newcomer] t7004: Remove space after redirect operators Date: Tue, 6 Aug 2024 02:59:10 +0300 Message-ID: <20240805235917.190699-2-abdobngad@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240805235917.190699-1-abdobngad@gmail.com> References: <20240805235917.190699-1-abdobngad@gmail.com> Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Modernize 't7004' by removing whitespace after redirect operators. Signed-off-by: AbdAlRahman Gad --- t/t7004-tag.sh | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh index fa6336edf9..3100a4c219 100755 --- a/t/t7004-tag.sh +++ b/t/t7004-tag.sh @@ -213,9 +213,9 @@ mytag EOF test_expect_success \ 'trying to delete tags without params should succeed and do nothing' ' - git tag -l > actual && test_cmp expect actual && + git tag -l >actual && test_cmp expect actual && git tag -d && - git tag -l > actual && test_cmp expect actual + git tag -l >actual && test_cmp expect actual ' test_expect_success \ @@ -269,9 +269,9 @@ test_expect_success 'listing all tags should print them ordered' ' git tag a1 && git tag v1.0 && git tag t210 && - git tag -l > actual && + git tag -l >actual && test_cmp expect actual && - git tag > actual && + git tag >actual && test_cmp expect actual ' @@ -283,7 +283,7 @@ EOF test_expect_success \ 'listing tags with substring as pattern must print those matching' ' rm *a* && - git tag -l "*a*" > current && + git tag -l "*a*" >current && test_cmp expect current ' @@ -293,7 +293,7 @@ v1.0.1 EOF test_expect_success \ 'listing tags with a suffix as pattern must print those matching' ' - git tag -l "*.1" > actual && + git tag -l "*.1" >actual && test_cmp expect actual ' @@ -303,7 +303,7 @@ t211 EOF test_expect_success \ 'listing tags with a prefix as pattern must print those matching' ' - git tag -l "t21*" > actual && + git tag -l "t21*" >actual && test_cmp expect actual ' @@ -312,7 +312,7 @@ a1 EOF test_expect_success \ 'listing tags using a name as pattern must print that one matching' ' - git tag -l a1 > actual && + git tag -l a1 >actual && test_cmp expect actual ' @@ -321,7 +321,7 @@ v1.0 EOF test_expect_success \ 'listing tags using a name as pattern must print that one matching' ' - git tag -l v1.0 > actual && + git tag -l v1.0 >actual && test_cmp expect actual ' @@ -331,13 +331,13 @@ v1.1.3 EOF test_expect_success \ 'listing tags with ? in the pattern should print those matching' ' - git tag -l "v1.?.?" > actual && + git tag -l "v1.?.?" >actual && test_cmp expect actual ' test_expect_success \ 'listing tags using v.* should print nothing because none have v.' ' - git tag -l "v.*" > actual && + git tag -l "v.*" >actual && test_must_be_empty actual ' @@ -349,7 +349,7 @@ v1.1.3 EOF test_expect_success \ 'listing tags using v* should print only those having v' ' - git tag -l "v*" > actual && + git tag -l "v*" >actual && test_cmp expect actual ' @@ -1171,7 +1171,7 @@ test_expect_success GPG \ git tag -v emptyfile-signed-tag ' -printf '\n\n \n\t\nLeading blank lines\n' > sigblanksfile +printf '\n\n \n\t\nLeading blank lines\n' >sigblanksfile printf '\n\t \t \nRepeated blank lines\n' >>sigblanksfile printf '\n\n\nTrailing spaces \t \n' >>sigblanksfile printf '\nTrailing blank lines\n\n\t \n\n' >>sigblanksfile @@ -1569,7 +1569,7 @@ test_expect_success \ test_expect_success \ 'message in editor has initial comment' ' - ! (GIT_EDITOR=cat git tag -a initial-comment > actual) + ! (GIT_EDITOR=cat git tag -a initial-comment >actual) ' test_expect_success 'message in editor has initial comment: first line' ' @@ -1587,7 +1587,7 @@ test_expect_success \ ' get_tag_header reuse $commit commit $time >expect -echo "An annotation to be reused" >> expect +echo "An annotation to be reused" >>expect test_expect_success \ 'overwriting an annotated tag should use its previous body' ' git tag -a -m "An annotation to be reused" reuse && @@ -1639,7 +1639,7 @@ hash3=$(git rev-parse HEAD) # simple linear checks of --continue -cat > expected <expected < expected <expected < expected <expected < expected <expected < foo && + echo foo-3.0 >foo && git commit foo -m fourth && git tag v3.0 ' hash4=$(git rev-parse HEAD) -cat > expected <expected < expected <expected < expected <expected < expected <expected < expected <expected < X-Patchwork-Id: 13754268 Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.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 0306616D9DD for ; Mon, 5 Aug 2024 23:59:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722902388; cv=none; b=u8Gu4kixrT5N916ccz0AP8AvS4IZyiLD1LaIyXTPadogCpz+sfrLqh0SXH3jSANKpv+Ad8qoil50aBuQK63p5qNulZ4n/x7jxyjsWDKirSvDDZUydrrt5z794vdqRr1ndLMLJZaHyMybJfN6lg//OK9zGSRoM1zcCnYHkC0ZkSY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722902388; c=relaxed/simple; bh=TVH9tsf8U9VGeArgAWptqZEG3yBI/ZSs5XJiJi7AZQI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=M2CkWeR+PfyjPK5/bRDimR8S7f/FJPOVZLgmrWfjNDzGzcO7JTrfWqx45Q6AWqvG8grHHiUN2ST2yH03n6/tkB+MESZ/XdPHTN+FoRQSR2cMJkC4kATWAfUJEMbYNjSrQsx1C9Ms3SKmMHNJxG+mnBvElu0CFzdycCgBrxwZxoU= 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=dCAcwH1j; arc=none smtp.client-ip=209.85.128.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="dCAcwH1j" Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-42803bbf842so691445e9.1 for ; Mon, 05 Aug 2024 16:59:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722902385; x=1723507185; 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=IRBPW2Bt/qQDLaxwdCcA7mM7s02N0BchEb9o1xhNhWQ=; b=dCAcwH1jr77kPJ7nM5P2b7dkORvRHjN4xDo7QhPCq16yJMtJc/o6A7CJq/DieS8qnk LEsceN+BMWELl184iMbeCgNQnb6yEEAbCWdbWKK6mU2ee1Zs5/dfhZ3DXp+9W+LNYvas CZF1QRQGkphu+0EOLqPni4oEqZc/iYbk+5hRONB1EKRbF9AWFm3kWQUMZQYoLg05+jPq iZ40Mtp8vOUe7RjXJswO8H/6JWVih5XW67C+X3/3wQjipSQjh9MhIyc4LbKODL3mMi0m +I47Y2f6ZysFCQrIPzA7AFW10Ihzj1cEotUNML0eFcLEBkpfcXK1LaeUr9Yeg4VcUxZU qPrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722902385; x=1723507185; 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=IRBPW2Bt/qQDLaxwdCcA7mM7s02N0BchEb9o1xhNhWQ=; b=jaaesPhsqMTPUPaOjq/2Yc5mEzM9dw18SC0nTVKAM1dZNikJyvnnnZg1mbNpU8maUa juSeHM8dLBqvl50VFc7OLMehmRZjt9c0X49Eh9tHmmDhBF4ki19NnTkxlZw/YFcKW3WO xVIY8cFspUSbzzAnwxrNxuGGGX2C8KF+vL2rZ5dEjcyuWG3Gzg7gXG+gsTi4ZnE4G1w4 DsA7vP/ofD0MMkLhRx6gWfNpLlQBjrTSI39Nr7x26R5VFyu0HeInZ0yyIo4TiZMyz8jM 8u3eO3YxVV+6URrvzuoCaX2IsN8Uc73LdHkPDm/5cscWwi72MT/IKYCpYLAG7byFFNmc dy5w== X-Gm-Message-State: AOJu0YzhEY0JzqDkDbTNs7hQeeRvgbf8lvcNKHFlAlV5zoNn5uhCypn3 sZWkaGlvHJiapkcNWqZa1t1JGxbRpy2l1L0oaMuPvx+kUdOzx/7VWXGuoa7g X-Google-Smtp-Source: AGHT+IFZl3sPyUU1RgNpdqhQDHZyNrjmgr6lUP6eVsetCZu1+Z9kwfrEI9Xdxv9Hu3un3YPpiddKPA== X-Received: by 2002:a05:600c:3504:b0:427:f196:c549 with SMTP id 5b1f17b1804b1-428e6b7e954mr125156225e9.23.1722902385013; Mon, 05 Aug 2024 16:59:45 -0700 (PDT) Received: from abdobngad.. ([197.40.47.44]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36bbd074583sm11219065f8f.108.2024.08.05.16.59.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Aug 2024 16:59:44 -0700 (PDT) From: AbdAlRahman Gad To: git@vger.kernel.org Cc: AbdAlRahman Gad Subject: [PATCH v4 2/8] [Newcomer] t7004: Do not lose exit status to pipe Date: Tue, 6 Aug 2024 02:59:11 +0300 Message-ID: <20240805235917.190699-3-abdobngad@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240805235917.190699-1-abdobngad@gmail.com> References: <20240805235917.190699-1-abdobngad@gmail.com> Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Split "test-tool ... | sed" pipeline into two commands to avoid losing exit status from test-tool. Signed-off-by: AbdAlRahman Gad --- t/t7004-tag.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh index 3100a4c219..1e31f39646 100755 --- a/t/t7004-tag.sh +++ b/t/t7004-tag.sh @@ -97,7 +97,8 @@ test_expect_success 'creating a tag with --create-reflog should create reflog' ' test_when_finished "git tag -d tag_with_reflog1" && git tag --create-reflog tag_with_reflog1 && git reflog exists refs/tags/tag_with_reflog1 && - test-tool ref-store main for-each-reflog-ent refs/tags/tag_with_reflog1 | sed -e "s/^.* //" >actual && + test-tool ref-store main for-each-reflog-ent refs/tags/tag_with_reflog1 >actual.body && + sed -e "s/^.* //" actual.body >actual && test_cmp expected actual ' @@ -108,7 +109,8 @@ test_expect_success 'annotated tag with --create-reflog has correct message' ' test_when_finished "git tag -d tag_with_reflog2" && git tag -m "annotated tag" --create-reflog tag_with_reflog2 && git reflog exists refs/tags/tag_with_reflog2 && - test-tool ref-store main for-each-reflog-ent refs/tags/tag_with_reflog2 | sed -e "s/^.* //" >actual && + test-tool ref-store main for-each-reflog-ent refs/tags/tag_with_reflog2 >actual.body && + sed -e "s/^.* //" actual.body >actual && test_cmp expected actual ' From patchwork Mon Aug 5 23:59:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AbdAlRahman Gad X-Patchwork-Id: 13754269 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.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 CA07816F8EF for ; Mon, 5 Aug 2024 23:59:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722902390; cv=none; b=eMqJFYwOyKvDqhL7HSsn50BM1ubCmfcUXk7y4/xC9KR7+aCYVHnFfN6fo9KLQZbULpiIm0MfuqTMISaP/8buQqlBerRunNZg6hzRK+qpWA3STrNncdJyz+sAbXfkmLESiO7FovvgA6qqxi3+pEE8FfSyX6aVsCiV5qteuWttG/Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722902390; c=relaxed/simple; bh=dwHrW0VJ4fOb0V5dxqhfW1W96t2oxa5vzeT+WL6OEq0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cAVNkYpZfF/eelIWqA0ChJGVokJiWFqx6nQ56RTsJzYnux5r1W7TqmjNKPdBq6e5V6cyAVG20g4i3O/ZbMxIWAMktbPI6kjvBHIIoZljzZneUW9dJqirMkVce9ssqmY7UD5LXSlUlPdN6hW0gj9bB9JJUeGf5dUOTQHEhMaHB50= 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=IG7ZNfbh; arc=none smtp.client-ip=209.85.128.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="IG7ZNfbh" Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-428178fc07eso431375e9.3 for ; Mon, 05 Aug 2024 16:59:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722902387; x=1723507187; 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=baODQEVSKZkR4NxouhvlfP98A5JLPpRcJyRXkHbxD+s=; b=IG7ZNfbhpJeYJOvIeZkEYe9FLOAx/t3Pmi54VvhEpcGR0+YU4HPlePR0hqs1/rga2i 69lecA4TqpBsKfJvmLZPNPJTwSiC/ZR1Sr5CWIzKbtTRejGfFtBeu5HsdgXByxhC0fS3 j1ktJISmFAd6BiB4PaOdxlh6P/thLoMhaoTQiPJGbKJkd+xgu/olLkqlF+9NVir1ia5P R40pkOYW+LM/m+Z3lUplpyhJm3ijwrO3Tg1rnBS0+vTS1oF09Ov7sTtX0HG5PG0eiGYH nN0ZAPPP1eBjiDhbZ7nJSoFKi0JELO8jENRZtJzr6c8Aj3zJuhw50D9tb5cVJb7fT7uF nenw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722902387; x=1723507187; 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=baODQEVSKZkR4NxouhvlfP98A5JLPpRcJyRXkHbxD+s=; b=LQDqPGgPyKC+mm1REy02y77EDN4a6HfFazq3uh49SL6gUik3nCi13AowE5hoj6JcCO +4Uo5GhXqnAqoYsTxJyetih62pJj1e3NofwoMRxCp0jM0twQuJ1g4AcyA1ie5rBSpJj/ nHb7Ka/mS3tn65z9je1Yu1LYDewWE9cXJkGZL5M4WyLdZo2xyNgtasiiJKrfzgN9RfKb C3cVtCUFkriygp0uEVQlfNYKcr4smUoadMF29lrepWffa5tfPB4E1Ts7lM+BW3Dgh9Ac ejbs1IAP/6t03dahiTZHUtIfp83dER79sIIQY8XttrCbXiuyrvEd76qT31YQ8OjNgdt+ BBKA== X-Gm-Message-State: AOJu0Yw4iQFLh7d7Cwh64GJvF4mrlHsGuKAAbo4XT9c0TTyLqNKN844P XNQ1D5FGFKgTfUCdOtRDM7OJkCfSBDf0lX68U8/ciuzuHLXlMHOWRx4x19UO X-Google-Smtp-Source: AGHT+IEPII4k9S9MfbxXTUdKPtdRUY8VO+2/fHEFHZ3OaIc1SNbi2kWHDmTFcqFV3hlpbYZcoT/eqg== X-Received: by 2002:a05:600c:1f95:b0:426:59ad:bbb3 with SMTP id 5b1f17b1804b1-428e6b95c3fmr104009725e9.32.1722902386789; Mon, 05 Aug 2024 16:59:46 -0700 (PDT) Received: from abdobngad.. ([197.40.47.44]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36bbd074583sm11219065f8f.108.2024.08.05.16.59.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Aug 2024 16:59:46 -0700 (PDT) From: AbdAlRahman Gad To: git@vger.kernel.org Cc: AbdAlRahman Gad Subject: [PATCH v4 3/8] [Newcomer] t7004: One command per line Date: Tue, 6 Aug 2024 02:59:12 +0300 Message-ID: <20240805235917.190699-4-abdobngad@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240805235917.190699-1-abdobngad@gmail.com> References: <20240805235917.190699-1-abdobngad@gmail.com> Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 One of the tests in t7004 has multiple commands on a single line, which is discouraged. Adapt these by splitting up these into one line per command. Signed-off-by: AbdAlRahman Gad --- t/t7004-tag.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh index 1e31f39646..cfe7653317 100755 --- a/t/t7004-tag.sh +++ b/t/t7004-tag.sh @@ -215,9 +215,11 @@ mytag EOF test_expect_success \ 'trying to delete tags without params should succeed and do nothing' ' - git tag -l >actual && test_cmp expect actual && + git tag -l >actual && + test_cmp expect actual && git tag -d && - git tag -l >actual && test_cmp expect actual + git tag -l >actual && + test_cmp expect actual ' test_expect_success \ From patchwork Mon Aug 5 23:59:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AbdAlRahman Gad X-Patchwork-Id: 13754270 Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.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 55F41171E5F for ; Mon, 5 Aug 2024 23:59:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722902394; cv=none; b=aIfABhrRkoQCBrUT9K5qkgr3IeXasGPxn/CkQT/w3YTi2ECjdtifmhp0KOv5yh8WFnOGhFfpPCwF77w3KTkrYYt6no30YrxeT9Wp+ncQEje12SXBAAL3mEHhW2198+PTnY1sgaOv/3hAJHd6jCJWALJAwdzJ/e40cJ1TeTW1D2M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722902394; c=relaxed/simple; bh=RpuHQfYY4V0BfWs8k1MU++uVI+RdqjReN+nIPYreOKM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pbpD+ijNN/7TXZITuE+2BBMttsn7wuMC3vXLFOPe/adhNvyNuDtvlKIfnhb34BVGNR72CIgRsA3jcOEk4R6XHL4MynlRS4g6x9SfQ1KUl3Yor1Iflggg8dwQNBDZcTgmNcLqbHrVdbETRpoTXyGhP6DW8gheg97JE+OFBNzFwZQ= 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=e51t8POD; arc=none smtp.client-ip=209.85.221.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="e51t8POD" Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-3685a564bafso19047f8f.3 for ; Mon, 05 Aug 2024 16:59:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722902389; x=1723507189; 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=D/L40F1LL42jix41JvUvPvCqg5ZdgSHeODzoxOGn/sc=; b=e51t8POD+4TBgJ/ynH+aPTBggOZEtlnDLwYmTb43QFpgP++ftOsHZSwQEAdF3uOkDT V+wcycfaVinizs0IStm0tImMOAX9OgJb+w4BAWKLl/mPjq9LsHmDThaonhOqL2GVNfkr 5QBHA3o0olkv3odyMSDx+OIfW1yENqZ0U44ACwAPzo8wNhbBrVn6jMVaXMpxlCv097cL BWZT9Dpdj0ygI4OXWpjt8wJW573Wdh7qevFWZf3mhyIVp99Jd4eZIUOejP8d1KPVFne+ ETR4g0T6bQsif6dFeJT3/2Myijxm1n80GQgsLlLhFmKr+ZBYUyEwIEWYjD0YuX5nFn3a MmrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722902389; x=1723507189; 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=D/L40F1LL42jix41JvUvPvCqg5ZdgSHeODzoxOGn/sc=; b=Mhy2HZXaA5JbgnuR1SICoR08GL3w0EGh7YRIu+wsuC2IGacJhZAVOclhKrGlhTOXkz nn4O2XsV14lXok5poU0x6mugro+JTCmAk8b/ETVf/97EiebhlBgLIOzI6O9YYOf8weXb SiGPCVOFNUBssAJ/1UBsKGOIOwHMni0UnLQAqDFgOjRltnc+K3JlwdL5g9wT+VgP2Ga+ FK3lpwFhZyjKZ0hOY5U5vEfhj/0pURPRMGxwwJgo3rIThxVTufPkDVjDB3B8XvTfCnLc HTFePKeg+EBkgARAjgKThDRu9q3HewOR1TwZyNk1zil9ICEHta2JHO9Q5fnVAfn2lB+u xEGQ== X-Gm-Message-State: AOJu0YwWzDa7TcdkX7DYa04dlQS27/ehuYWVNTtFiGt0zCAXwGBEn/rr YCeFXQMWWzXqEwlmWEyVi8EjgzMS/LvhgKCbO9IBa1Akuke0+dDeMmdWJGBL X-Google-Smtp-Source: AGHT+IHLWiG0pajXvAj6zuOS0XPUn/gJK+0ouzrWn8RCK+41cDWk73xwCgjx7MVv36NteG4q7x9ooA== X-Received: by 2002:a5d:64a1:0:b0:367:43ce:9c91 with SMTP id ffacd0b85a97d-36bbc0f9fb6mr10192867f8f.27.1722902388889; Mon, 05 Aug 2024 16:59:48 -0700 (PDT) Received: from abdobngad.. ([197.40.47.44]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36bbd074583sm11219065f8f.108.2024.08.05.16.59.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Aug 2024 16:59:48 -0700 (PDT) From: AbdAlRahman Gad To: git@vger.kernel.org Cc: AbdAlRahman Gad Subject: [PATCH v4 4/8] [Newcomer] t7004: Do not prepare things outside test_expect_success Date: Tue, 6 Aug 2024 02:59:13 +0300 Message-ID: <20240805235917.190699-5-abdobngad@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240805235917.190699-1-abdobngad@gmail.com> References: <20240805235917.190699-1-abdobngad@gmail.com> Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Do not prepare expect and other things outside test_expect_success. Also add '\' before EOF to avoid shell interpolation and '-' to allow indentation of the body. Signed-off-by: AbdAlRahman Gad --- t/t7004-tag.sh | 698 +++++++++++++++++++++++++------------------------ 1 file changed, 360 insertions(+), 338 deletions(-) diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh index cfe7653317..b9fe58fbee 100755 --- a/t/t7004-tag.sh +++ b/t/t7004-tag.sh @@ -131,10 +131,10 @@ test_expect_success 'listing all tags if one exists should succeed' ' git tag ' -cat >expect <expect <<-\EOF && + mytag + EOF git tag -l -l >actual && test_cmp expect actual && git tag --list --list >actual && @@ -209,12 +209,12 @@ test_expect_success 'trying to delete an unknown tag should fail' ' test_must_fail git tag -d unknown-tag ' -cat >expect <expect <<-\EOF && + myhead + mytag + EOF git tag -l >actual && test_cmp expect actual && git tag -d && @@ -252,18 +252,18 @@ test_expect_success 'trying to delete an already deleted tag should fail' \ # listing various tags with pattern matching: -cat >expect <expect <<-\EOF && + a1 + aa1 + cba + t210 + t211 + v0.2.1 + v1.0 + v1.0.1 + v1.1.3 + EOF git tag v1.0.1 && git tag t211 && git tag aa1 && @@ -279,62 +279,62 @@ test_expect_success 'listing all tags should print them ordered' ' test_cmp expect actual ' -cat >expect <expect <<-\EOF && + a1 + aa1 + cba + EOF rm *a* && git tag -l "*a*" >current && test_cmp expect current ' -cat >expect <expect <<-\EOF && + v0.2.1 + v1.0.1 + EOF git tag -l "*.1" >actual && test_cmp expect actual ' -cat >expect <expect <<-\EOF && + t210 + t211 + EOF git tag -l "t21*" >actual && test_cmp expect actual ' -cat >expect <expect <<-\EOF && + a1 + EOF git tag -l a1 >actual && test_cmp expect actual ' -cat >expect <expect <<-\EOF && + v1.0 + EOF git tag -l v1.0 >actual && test_cmp expect actual ' -cat >expect <expect <<-\EOF && + v1.0.1 + v1.1.3 + EOF git tag -l "v1.?.?" >actual && test_cmp expect actual ' @@ -345,19 +345,25 @@ test_expect_success \ test_must_be_empty actual ' -cat >expect <expect <<-\EOF && + v0.2.1 + v1.0 + v1.0.1 + v1.1.3 + EOF git tag -l "v*" >actual && test_cmp expect actual ' test_expect_success 'tag -l can accept multiple patterns' ' + cat >expect <<-\EOF && + v0.2.1 + v1.0 + v1.0.1 + v1.1.3 + EOF git tag -l "v1*" "v0*" >actual && test_cmp expect actual ' @@ -371,6 +377,12 @@ test_expect_success 'tag -l can accept multiple patterns' ' # out if we're going to break this long-documented form of taking # multiple patterns. test_expect_success 'tag -l -l works, as our buggy documentation previously suggested' ' + cat >expect <<-\EOF && + v0.2.1 + v1.0 + v1.0.1 + v1.1.3 + EOF git tag -l "v1*" -l "v0*" >actual && test_cmp expect actual ' @@ -453,68 +465,69 @@ tagger C O Mitter $4 -0700 EOF } -commit=$(git rev-parse HEAD) -time=$test_tick - -get_tag_header annotated-tag $commit commit $time >expect -echo "A message" >>expect test_expect_success \ 'creating an annotated tag with -m message should succeed' ' + commit=$(git rev-parse HEAD) && + time=$test_tick && + get_tag_header annotated-tag $commit commit $time >expect && + echo "A message" >>expect && git tag -m "A message" annotated-tag && get_tag_msg annotated-tag >actual && test_cmp expect actual ' -get_tag_header annotated-tag-edit $commit commit $time >expect -echo "An edited message" >>expect test_expect_success 'set up editor' ' write_script fakeeditor <<-\EOF sed -e "s/A message/An edited message/g" <"$1" >"$1-" mv "$1-" "$1" EOF ' + test_expect_success \ 'creating an annotated tag with -m message --edit should succeed' ' + get_tag_header annotated-tag-edit $commit commit $time >expect && + echo "An edited message" >>expect && GIT_EDITOR=./fakeeditor git tag -m "A message" --edit annotated-tag-edit && get_tag_msg annotated-tag-edit >actual && test_cmp expect actual ' -cat >msgfile <expect -cat msgfile >>expect test_expect_success \ 'creating an annotated tag with -F messagefile should succeed' ' + cat >msgfile <<-\EOF && + Another message + in a file. + EOF + get_tag_header file-annotated-tag $commit commit $time >expect && + cat msgfile >>expect && git tag -F msgfile file-annotated-tag && get_tag_msg file-annotated-tag >actual && test_cmp expect actual ' -get_tag_header file-annotated-tag-edit $commit commit $time >expect -sed -e "s/Another message/Another edited message/g" msgfile >>expect test_expect_success 'set up editor' ' write_script fakeeditor <<-\EOF sed -e "s/Another message/Another edited message/g" <"$1" >"$1-" mv "$1-" "$1" EOF ' + test_expect_success \ 'creating an annotated tag with -F messagefile --edit should succeed' ' + get_tag_header file-annotated-tag-edit $commit commit $time >expect && + sed -e "s/Another message/Another edited message/g" msgfile >>expect && GIT_EDITOR=./fakeeditor git tag -F msgfile --edit file-annotated-tag-edit && get_tag_msg file-annotated-tag-edit >actual && test_cmp expect actual ' -cat >inputmsg <expect -cat inputmsg >>expect test_expect_success 'creating an annotated tag with -F - should succeed' ' + cat >inputmsg <<-\EOF && + A message from the + standard input + EOF + get_tag_header stdin-annotated-tag $commit commit $time >expect && + cat inputmsg >>expect && git tag -F - stdin-annotated-tag actual && test_cmp expect actual @@ -543,67 +556,67 @@ test_expect_success \ # blank and empty messages: -get_tag_header empty-annotated-tag $commit commit $time >expect test_expect_success \ 'creating a tag with an empty -m message should succeed' ' + get_tag_header empty-annotated-tag $commit commit $time >expect && git tag -m "" empty-annotated-tag && get_tag_msg empty-annotated-tag >actual && test_cmp expect actual ' ->emptyfile -get_tag_header emptyfile-annotated-tag $commit commit $time >expect test_expect_success \ 'creating a tag with an empty -F messagefile should succeed' ' + >emptyfile && + get_tag_header emptyfile-annotated-tag $commit commit $time >expect && git tag -F emptyfile emptyfile-annotated-tag && get_tag_msg emptyfile-annotated-tag >actual && test_cmp expect actual ' -printf '\n\n \n\t\nLeading blank lines\n' >blanksfile -printf '\n\t \t \nRepeated blank lines\n' >>blanksfile -printf '\n\n\nTrailing spaces \t \n' >>blanksfile -printf '\nTrailing blank lines\n\n\t \n\n' >>blanksfile -get_tag_header blanks-annotated-tag $commit commit $time >expect -cat >>expect <blanksfile && + printf "\n\t \t \nRepeated blank lines\n" >>blanksfile && + printf "\n\n\nTrailing spaces \t \n" >>blanksfile && + printf "\nTrailing blank lines\n\n\t \n\n" >>blanksfile && + get_tag_header blanks-annotated-tag $commit commit $time >expect && + cat >>expect <<-\EOF && + Leading blank lines -Repeated blank lines + Repeated blank lines -Trailing spaces + Trailing spaces -Trailing blank lines -EOF -test_expect_success \ - 'extra blanks in the message for an annotated tag should be removed' ' + Trailing blank lines + EOF git tag -F blanksfile blanks-annotated-tag && get_tag_msg blanks-annotated-tag >actual && test_cmp expect actual ' -get_tag_header blank-annotated-tag $commit commit $time >expect test_expect_success \ 'creating a tag with blank -m message with spaces should succeed' ' + get_tag_header blank-annotated-tag $commit commit $time >expect && git tag -m " " blank-annotated-tag && get_tag_msg blank-annotated-tag >actual && test_cmp expect actual ' -echo ' ' >blankfile -echo '' >>blankfile -echo ' ' >>blankfile -get_tag_header blankfile-annotated-tag $commit commit $time >expect test_expect_success \ 'creating a tag with blank -F messagefile with spaces should succeed' ' + echo " " >blankfile && + echo "" >>blankfile && + echo " " >>blankfile && + get_tag_header blankfile-annotated-tag $commit commit $time >expect && git tag -F blankfile blankfile-annotated-tag && get_tag_msg blankfile-annotated-tag >actual && test_cmp expect actual ' -printf ' ' >blanknonlfile -get_tag_header blanknonlfile-annotated-tag $commit commit $time >expect test_expect_success \ 'creating a tag with -F file of spaces and no newline should succeed' ' + printf " " >blanknonlfile && + get_tag_header blanknonlfile-annotated-tag $commit commit $time >expect && git tag -F blanknonlfile blanknonlfile-annotated-tag && get_tag_msg blanknonlfile-annotated-tag >actual && test_cmp expect actual @@ -611,62 +624,62 @@ test_expect_success \ # messages with commented lines: -cat >commentsfile <commentsfile <<-\EOF && + # A comment -############ -The message. -############ -One line. + ############ + The message. + ############ + One line. -# commented lines -# commented lines + # commented lines + # commented lines -Another line. -# comments + Another line. + # comments -Last line. -EOF -get_tag_header comments-annotated-tag $commit commit $time >expect -cat >>expect <expect && + cat >>expect <<-\EOF && + The message. + One line. -Another line. + Another line. -Last line. -EOF -test_expect_success \ - 'creating a tag using a -F messagefile with #comments should succeed' ' + Last line. + EOF git tag -F commentsfile comments-annotated-tag && get_tag_msg comments-annotated-tag >actual && test_cmp expect actual ' -get_tag_header comment-annotated-tag $commit commit $time >expect test_expect_success \ 'creating a tag with a #comment in the -m message should succeed' ' + get_tag_header comment-annotated-tag $commit commit $time >expect && git tag -m "#comment" comment-annotated-tag && get_tag_msg comment-annotated-tag >actual && test_cmp expect actual ' -echo '#comment' >commentfile -echo '' >>commentfile -echo '####' >>commentfile -get_tag_header commentfile-annotated-tag $commit commit $time >expect test_expect_success \ 'creating a tag with #comments in the -F messagefile should succeed' ' + echo "#comment" >commentfile && + echo "" >>commentfile && + echo "####" >>commentfile && + get_tag_header commentfile-annotated-tag $commit commit $time >expect && git tag -F commentfile commentfile-annotated-tag && get_tag_msg commentfile-annotated-tag >actual && test_cmp expect actual ' -printf '#comment' >commentnonlfile -get_tag_header commentnonlfile-annotated-tag $commit commit $time >expect test_expect_success \ 'creating a tag with a file of #comment and no newline should succeed' ' + printf "#comment" >commentnonlfile && + get_tag_header commentnonlfile-annotated-tag $commit commit $time >expect && git tag -F commentnonlfile commentnonlfile-annotated-tag && get_tag_msg commentnonlfile-annotated-tag >actual && test_cmp expect actual @@ -848,11 +861,11 @@ test_expect_success \ test_cmp expect actual ' -echo 'tag line one' >annotagmsg -echo 'tag line two' >>annotagmsg -echo 'tag line three' >>annotagmsg test_expect_success \ 'listing many message lines of a non-signed tag should succeed' ' + echo "tag line one" >annotagmsg && + echo "tag line two" >>annotagmsg && + echo "tag line three" >>annotagmsg && git tag -F annotagmsg tag-lines && echo "tag-lines" >expect && @@ -960,20 +973,20 @@ test_expect_success GPG \ # creating and verifying signed tags: -get_tag_header signed-tag $commit commit $time >expect -echo 'A signed tag message' >>expect -echo '-----BEGIN PGP SIGNATURE-----' >>expect test_expect_success GPG 'creating a signed tag with -m message should succeed' ' + get_tag_header signed-tag $commit commit $time >expect && + echo "A signed tag message" >>expect && + echo "-----BEGIN PGP SIGNATURE-----" >>expect && git tag -s -m "A signed tag message" signed-tag && get_tag_msg signed-tag >actual && test_cmp expect actual ' -get_tag_header u-signed-tag $commit commit $time >expect -echo 'Another message' >>expect -echo '-----BEGIN PGP SIGNATURE-----' >>expect test_expect_success GPG 'sign with a given key id' ' + get_tag_header u-signed-tag $commit commit $time >expect && + echo "Another message" >>expect && + echo "-----BEGIN PGP SIGNATURE-----" >>expect && git tag -u committer@example.com -m "Another message" u-signed-tag && get_tag_msg u-signed-tag >actual && test_cmp expect actual @@ -993,65 +1006,65 @@ test_expect_success GPG 'sign with an unknown id (2)' ' ' -cat >fakeeditor <<'EOF' -#!/bin/sh -test -n "$1" && exec >"$1" -echo A signed tag message -echo from a fake editor. -EOF -chmod +x fakeeditor - -get_tag_header implied-sign $commit commit $time >expect -./fakeeditor >>expect -echo '-----BEGIN PGP SIGNATURE-----' >>expect test_expect_success GPG '-u implies signed tag' ' + cat >fakeeditor <<-\EOF && + #!/bin/sh + test -n "$1" && exec >"$1" + echo A signed tag message + echo from a fake editor. + EOF + chmod +x fakeeditor && + + get_tag_header implied-sign $commit commit $time >expect && + ./fakeeditor >>expect && + echo "-----BEGIN PGP SIGNATURE-----" >>expect && GIT_EDITOR=./fakeeditor git tag -u CDDE430D implied-sign && get_tag_msg implied-sign >actual && test_cmp expect actual ' -cat >sigmsgfile <expect -cat sigmsgfile >>expect -echo '-----BEGIN PGP SIGNATURE-----' >>expect test_expect_success GPG \ 'creating a signed tag with -F messagefile should succeed' ' + cat >sigmsgfile <<-\EOF && + Another signed tag + message in a file. + EOF + get_tag_header file-signed-tag $commit commit $time >expect && + cat sigmsgfile >>expect && + echo "-----BEGIN PGP SIGNATURE-----" >>expect && git tag -s -F sigmsgfile file-signed-tag && get_tag_msg file-signed-tag >actual && test_cmp expect actual ' -cat >siginputmsg <expect -cat siginputmsg >>expect -echo '-----BEGIN PGP SIGNATURE-----' >>expect test_expect_success GPG 'creating a signed tag with -F - should succeed' ' + cat >siginputmsg <<-\EOF && + A signed tag message from + the standard input + EOF + get_tag_header stdin-signed-tag $commit commit $time >expect && + cat siginputmsg >>expect && + echo "-----BEGIN PGP SIGNATURE-----" >>expect && git tag -s -F - stdin-signed-tag actual && test_cmp expect actual ' -get_tag_header implied-annotate $commit commit $time >expect -./fakeeditor >>expect -echo '-----BEGIN PGP SIGNATURE-----' >>expect test_expect_success GPG '-s implies annotated tag' ' + get_tag_header implied-annotate $commit commit $time >expect && + ./fakeeditor >>expect && + echo "-----BEGIN PGP SIGNATURE-----" >>expect && GIT_EDITOR=./fakeeditor git tag -s implied-annotate && get_tag_msg implied-annotate >actual && test_cmp expect actual ' -get_tag_header forcesignannotated-implied-sign $commit commit $time >expect -echo "A message" >>expect -echo '-----BEGIN PGP SIGNATURE-----' >>expect test_expect_success GPG \ 'git tag -s implied if configured with tag.forcesignannotated' \ - 'test_config tag.forcesignannotated true && + 'get_tag_header forcesignannotated-implied-sign $commit commit $time >expect && + echo "A message" >>expect && + echo "-----BEGIN PGP SIGNATURE-----" >>expect && + test_config tag.forcesignannotated true && git tag -m "A message" forcesignannotated-implied-sign && get_tag_msg forcesignannotated-implied-sign >actual && test_cmp expect actual @@ -1065,44 +1078,44 @@ test_expect_success GPG \ test_must_fail git tag -v forcesignannotated-no-message ' -get_tag_header forcesignannotated-annotate $commit commit $time >expect -echo "A message" >>expect test_expect_success GPG \ 'git tag -a disable configured tag.forcesignannotated' \ - 'test_config tag.forcesignannotated true && + 'get_tag_header forcesignannotated-annotate $commit commit $time >expect && + echo "A message" >>expect && + test_config tag.forcesignannotated true && git tag -a -m "A message" forcesignannotated-annotate && get_tag_msg forcesignannotated-annotate >actual && test_cmp expect actual && test_must_fail git tag -v forcesignannotated-annotate ' -get_tag_header forcesignannotated-disabled $commit commit $time >expect -echo "A message" >>expect -echo '-----BEGIN PGP SIGNATURE-----' >>expect test_expect_success GPG \ 'git tag --sign enable GPG sign' \ - 'test_config tag.forcesignannotated false && + 'get_tag_header forcesignannotated-disabled $commit commit $time >expect && + echo "A message" >>expect && + echo "-----BEGIN PGP SIGNATURE-----" >>expect && + test_config tag.forcesignannotated false && git tag --sign -m "A message" forcesignannotated-disabled && get_tag_msg forcesignannotated-disabled >actual && test_cmp expect actual ' -get_tag_header gpgsign-enabled $commit commit $time >expect -echo "A message" >>expect -echo '-----BEGIN PGP SIGNATURE-----' >>expect test_expect_success GPG \ 'git tag configured tag.gpgsign enables GPG sign' \ - 'test_config tag.gpgsign true && + 'get_tag_header gpgsign-enabled $commit commit $time >expect && + echo "A message" >>expect && + echo "-----BEGIN PGP SIGNATURE-----" >>expect && + test_config tag.gpgsign true && git tag -m "A message" gpgsign-enabled && get_tag_msg gpgsign-enabled>actual && test_cmp expect actual ' -get_tag_header no-sign $commit commit $time >expect -echo "A message" >>expect test_expect_success GPG \ 'git tag --no-sign configured tag.gpgsign skip GPG sign' \ - 'test_config tag.gpgsign true && + 'get_tag_header no-sign $commit commit $time >expect && + echo "A message" >>expect && + test_config tag.gpgsign true && git tag -a --no-sign -m "A message" no-sign && get_tag_msg no-sign>actual && test_cmp expect actual @@ -1154,78 +1167,78 @@ test_expect_success GPG 'verifying a forged tag with --format should fail silent # blank and empty messages for signed tags: -get_tag_header empty-signed-tag $commit commit $time >expect -echo '-----BEGIN PGP SIGNATURE-----' >>expect test_expect_success GPG \ 'creating a signed tag with an empty -m message should succeed' ' + get_tag_header empty-signed-tag $commit commit $time >expect && + echo "-----BEGIN PGP SIGNATURE-----" >>expect && git tag -s -m "" empty-signed-tag && get_tag_msg empty-signed-tag >actual && test_cmp expect actual && git tag -v empty-signed-tag ' ->sigemptyfile -get_tag_header emptyfile-signed-tag $commit commit $time >expect -echo '-----BEGIN PGP SIGNATURE-----' >>expect test_expect_success GPG \ 'creating a signed tag with an empty -F messagefile should succeed' ' + >sigemptyfile && + get_tag_header emptyfile-signed-tag $commit commit $time >expect && + echo "-----BEGIN PGP SIGNATURE-----" >>expect && git tag -s -F sigemptyfile emptyfile-signed-tag && get_tag_msg emptyfile-signed-tag >actual && test_cmp expect actual && git tag -v emptyfile-signed-tag ' -printf '\n\n \n\t\nLeading blank lines\n' >sigblanksfile -printf '\n\t \t \nRepeated blank lines\n' >>sigblanksfile -printf '\n\n\nTrailing spaces \t \n' >>sigblanksfile -printf '\nTrailing blank lines\n\n\t \n\n' >>sigblanksfile -get_tag_header blanks-signed-tag $commit commit $time >expect -cat >>expect <sigblanksfile && + printf "\n\t \t \nRepeated blank lines\n" >>sigblanksfile && + printf "\n\n\nTrailing spaces \t \n" >>sigblanksfile && + printf "\nTrailing blank lines\n\n\t \n\n" >>sigblanksfile && + get_tag_header blanks-signed-tag $commit commit $time >expect && + cat >>expect <<-\EOF && + Leading blank lines -Repeated blank lines + Repeated blank lines -Trailing spaces + Trailing spaces -Trailing blank lines -EOF -echo '-----BEGIN PGP SIGNATURE-----' >>expect -test_expect_success GPG \ - 'extra blanks in the message for a signed tag should be removed' ' + Trailing blank lines + EOF + echo "-----BEGIN PGP SIGNATURE-----" >>expect && git tag -s -F sigblanksfile blanks-signed-tag && get_tag_msg blanks-signed-tag >actual && test_cmp expect actual && git tag -v blanks-signed-tag ' -get_tag_header blank-signed-tag $commit commit $time >expect -echo '-----BEGIN PGP SIGNATURE-----' >>expect test_expect_success GPG \ 'creating a signed tag with a blank -m message should succeed' ' + get_tag_header blank-signed-tag $commit commit $time >expect && + echo "-----BEGIN PGP SIGNATURE-----" >>expect && git tag -s -m " " blank-signed-tag && get_tag_msg blank-signed-tag >actual && test_cmp expect actual && git tag -v blank-signed-tag ' -echo ' ' >sigblankfile -echo '' >>sigblankfile -echo ' ' >>sigblankfile -get_tag_header blankfile-signed-tag $commit commit $time >expect -echo '-----BEGIN PGP SIGNATURE-----' >>expect test_expect_success GPG \ 'creating a signed tag with blank -F file with spaces should succeed' ' + echo " " >sigblankfile && + echo "" >>sigblankfile && + echo " " >>sigblankfile && + get_tag_header blankfile-signed-tag $commit commit $time >expect && + echo "-----BEGIN PGP SIGNATURE-----" >>expect && git tag -s -F sigblankfile blankfile-signed-tag && get_tag_msg blankfile-signed-tag >actual && test_cmp expect actual && git tag -v blankfile-signed-tag ' -printf ' ' >sigblanknonlfile -get_tag_header blanknonlfile-signed-tag $commit commit $time >expect -echo '-----BEGIN PGP SIGNATURE-----' >>expect test_expect_success GPG \ 'creating a signed tag with spaces and no newline should succeed' ' + printf " " >sigblanknonlfile && + get_tag_header blanknonlfile-signed-tag $commit commit $time >expect && + echo "-----BEGIN PGP SIGNATURE-----" >>expect && git tag -s -F sigblanknonlfile blanknonlfile-signed-tag && get_tag_msg blanknonlfile-signed-tag >actual && test_cmp expect actual && @@ -1245,69 +1258,69 @@ test_expect_success GPG 'signed tag with embedded PGP message' ' # messages with commented lines for signed tags: -cat >sigcommentsfile <sigcommentsfile <<-\EOF && + # A comment -############ -The message. -############ -One line. + ############ + The message. + ############ + One line. -# commented lines -# commented lines + # commented lines + # commented lines -Another line. -# comments + Another line. + # comments -Last line. -EOF -get_tag_header comments-signed-tag $commit commit $time >expect -cat >>expect <expect && + cat >>expect <<-\EOF && + The message. + One line. -Another line. + Another line. -Last line. -EOF -echo '-----BEGIN PGP SIGNATURE-----' >>expect -test_expect_success GPG \ - 'creating a signed tag with a -F file with #comments should succeed' ' + Last line. + EOF + echo "-----BEGIN PGP SIGNATURE-----" >>expect && git tag -s -F sigcommentsfile comments-signed-tag && get_tag_msg comments-signed-tag >actual && test_cmp expect actual && git tag -v comments-signed-tag ' -get_tag_header comment-signed-tag $commit commit $time >expect -echo '-----BEGIN PGP SIGNATURE-----' >>expect test_expect_success GPG \ 'creating a signed tag with #commented -m message should succeed' ' + get_tag_header comment-signed-tag $commit commit $time >expect && + echo "-----BEGIN PGP SIGNATURE-----" >>expect && git tag -s -m "#comment" comment-signed-tag && get_tag_msg comment-signed-tag >actual && test_cmp expect actual && git tag -v comment-signed-tag ' -echo '#comment' >sigcommentfile -echo '' >>sigcommentfile -echo '####' >>sigcommentfile -get_tag_header commentfile-signed-tag $commit commit $time >expect -echo '-----BEGIN PGP SIGNATURE-----' >>expect test_expect_success GPG \ 'creating a signed tag with #commented -F messagefile should succeed' ' + echo "#comment" >sigcommentfile && + echo "" >>sigcommentfile && + echo "####" >>sigcommentfile && + get_tag_header commentfile-signed-tag $commit commit $time >expect && + echo "-----BEGIN PGP SIGNATURE-----" >>expect && git tag -s -F sigcommentfile commentfile-signed-tag && get_tag_msg commentfile-signed-tag >actual && test_cmp expect actual && git tag -v commentfile-signed-tag ' -printf '#comment' >sigcommentnonlfile -get_tag_header commentnonlfile-signed-tag $commit commit $time >expect -echo '-----BEGIN PGP SIGNATURE-----' >>expect test_expect_success GPG \ 'creating a signed tag with a #comment and no newline should succeed' ' + printf "#comment" >sigcommentnonlfile && + get_tag_header commentnonlfile-signed-tag $commit commit $time >expect && + echo "-----BEGIN PGP SIGNATURE-----" >>expect && git tag -s -F sigcommentnonlfile commentnonlfile-signed-tag && get_tag_msg commentnonlfile-signed-tag >actual && test_cmp expect actual && @@ -1366,11 +1379,11 @@ test_expect_success GPG \ test_cmp expect actual ' -echo 'stag line one' >sigtagmsg -echo 'stag line two' >>sigtagmsg -echo 'stag line three' >>sigtagmsg test_expect_success GPG \ 'listing many message lines of a signed tag should succeed' ' + echo "stag line one" >sigtagmsg && + echo "stag line two" >>sigtagmsg && + echo "stag line three" >>sigtagmsg && git tag -s -F sigtagmsg stag-lines && echo "stag-lines" >expect && @@ -1412,60 +1425,59 @@ test_expect_success GPG \ # tags pointing to objects different from commits: -tree=$(git rev-parse HEAD^{tree}) -blob=$(git rev-parse HEAD:foo) -tag=$(git rev-parse signed-tag 2>/dev/null) - -get_tag_header tree-signed-tag $tree tree $time >expect -echo "A message for a tree" >>expect -echo '-----BEGIN PGP SIGNATURE-----' >>expect test_expect_success GPG \ 'creating a signed tag pointing to a tree should succeed' ' + tree=$(git rev-parse HEAD^{tree}) && + get_tag_header tree-signed-tag $tree tree $time >expect && + echo "A message for a tree" >>expect && + echo "-----BEGIN PGP SIGNATURE-----" >>expect && git tag -s -m "A message for a tree" tree-signed-tag HEAD^{tree} && get_tag_msg tree-signed-tag >actual && test_cmp expect actual ' -get_tag_header blob-signed-tag $blob blob $time >expect -echo "A message for a blob" >>expect -echo '-----BEGIN PGP SIGNATURE-----' >>expect test_expect_success GPG \ 'creating a signed tag pointing to a blob should succeed' ' + blob=$(git rev-parse HEAD:foo) && + get_tag_header blob-signed-tag $blob blob $time >expect && + echo "A message for a blob" >>expect && + echo "-----BEGIN PGP SIGNATURE-----" >>expect && git tag -s -m "A message for a blob" blob-signed-tag HEAD:foo && get_tag_msg blob-signed-tag >actual && test_cmp expect actual ' -get_tag_header tag-signed-tag $tag tag $time >expect -echo "A message for another tag" >>expect -echo '-----BEGIN PGP SIGNATURE-----' >>expect test_expect_success GPG \ 'creating a signed tag pointing to another tag should succeed' ' + tag=$(git rev-parse signed-tag 2>/dev/null) && + get_tag_header tag-signed-tag $tag tag $time >expect && + echo "A message for another tag" >>expect && + echo "-----BEGIN PGP SIGNATURE-----" >>expect && git tag -s -m "A message for another tag" tag-signed-tag signed-tag && get_tag_msg tag-signed-tag >actual && test_cmp expect actual ' # usage with rfc1991 signatures -get_tag_header rfc1991-signed-tag $commit commit $time >expect -echo "RFC1991 signed tag" >>expect -echo '-----BEGIN PGP MESSAGE-----' >>expect + test_expect_success GPG,RFC1991 \ 'creating a signed tag with rfc1991' ' + get_tag_header rfc1991-signed-tag $commit commit $time >expect && + echo "RFC1991 signed tag" >>expect && + echo "-----BEGIN PGP MESSAGE-----" >>expect && echo "rfc1991" >gpghome/gpg.conf && git tag -s -m "RFC1991 signed tag" rfc1991-signed-tag $commit && get_tag_msg rfc1991-signed-tag >actual && test_cmp expect actual ' -cat >fakeeditor <<'EOF' -#!/bin/sh -cp "$1" actual -EOF -chmod +x fakeeditor - test_expect_success GPG,RFC1991 \ 'reediting a signed tag body omits signature' ' + cat >fakeeditor <<-\EOF && + #!/bin/sh + cp "$1" actual + EOF + chmod +x fakeeditor && echo "rfc1991" >gpghome/gpg.conf && echo "RFC1991 signed tag" >expect && GIT_EDITOR=./fakeeditor git tag -f -s rfc1991-signed-tag $commit && @@ -1490,10 +1502,9 @@ test_expect_success GPG,RFC1991 \ test_cmp expect actual ' -rm -f gpghome/gpg.conf - test_expect_success GPG,RFC1991 \ 'verifying rfc1991 signature without --rfc1991' ' + rm -f gpghome/gpg.conf && git tag -v rfc1991-signed-tag ' @@ -1561,10 +1572,11 @@ test_expect_success GPGSM \ # try to verify without gpg: -rm -rf gpghome test_expect_success GPG \ 'verify signed tag fails when public key is not present' \ - 'test_must_fail git tag -v signed-tag' + 'rm -rf gpghome && + test_must_fail git tag -v signed-tag +' test_expect_success \ 'git tag -a fails if tag annotation is empty' ' @@ -1590,10 +1602,10 @@ test_expect_success \ test_must_be_empty rest.actual ' -get_tag_header reuse $commit commit $time >expect -echo "An annotation to be reused" >>expect test_expect_success \ 'overwriting an annotated tag should use its previous body' ' + get_tag_header reuse $commit commit $time >expect && + echo "An annotation to be reused" >>expect && git tag -a -m "An annotation to be reused" reuse && GIT_EDITOR=true git tag -f -a reuse && get_tag_msg reuse >actual && @@ -1622,47 +1634,57 @@ test_expect_success 'filename for the message is relative to cwd' ' # create a few more commits to test --contains -hash1=$(git rev-parse HEAD) - test_expect_success 'creating second commit and tag' ' + hash1=$(git rev-parse HEAD) && echo foo-2.0 >foo && git add foo && git commit -m second && git tag v2.0 ' -hash2=$(git rev-parse HEAD) - test_expect_success 'creating third commit without tag' ' + hash2=$(git rev-parse HEAD) && echo foo-dev >foo && git add foo && git commit -m third ' -hash3=$(git rev-parse HEAD) - # simple linear checks of --continue -cat >expected <expected <<-\EOF && + v0.2.1 + v1.0 + v1.0.1 + v1.1.3 + v2.0 + EOF git tag -l --contains $hash1 v* >actual && test_cmp expected actual " # other ways of specifying the commit test_expect_success 'checking that first commit is in all tags (tag)' " + cat >expected <<-\EOF && + v0.2.1 + v1.0 + v1.0.1 + v1.1.3 + v2.0 + EOF git tag -l --contains v1.0 v* >actual && test_cmp expected actual " test_expect_success 'checking that first commit is in all tags (relative)' " + cat >expected <<-\EOF && + v0.2.1 + v1.0 + v1.0.1 + v1.1.3 + v2.0 + EOF git tag -l --contains HEAD~2 v* >actual && test_cmp expected actual " @@ -1683,23 +1705,21 @@ test_expect_success 'checking that first commit is in all tags (relative)' " test_must_be_empty actual " -cat >expected <expected <<-\EOF && + v2.0 + EOF git tag -l --contains $hash2 v* >actual && test_cmp expected actual " -cat >expected <expected <<-\EOF && + v0.2.1 + v1.0 + v1.0.1 + v1.1.3 + EOF git tag -l --no-contains $hash2 v* >actual && test_cmp expected actual " @@ -1709,15 +1729,14 @@ test_expect_success 'checking that third commit has no tags' " test_must_be_empty actual " -cat >expected <expected <<-\EOF && + v0.2.1 + v1.0 + v1.0.1 + v1.1.3 + v2.0 + EOF git tag -l --no-contains $hash3 v* >actual && test_cmp expected actual " @@ -1732,26 +1751,23 @@ test_expect_success 'creating simple branch' ' git tag v3.0 ' -hash4=$(git rev-parse HEAD) - -cat >expected <expected <<-\EOF && + v3.0 + EOF git tag -l --contains $hash4 v* >actual && test_cmp expected actual -" - -cat >expected <expected <<-\EOF && + v0.2.1 + v1.0 + v1.0.1 + v1.1.3 + v2.0 + EOF git tag -l --no-contains $hash4 v* >actual && test_cmp expected actual " @@ -1761,45 +1777,51 @@ test_expect_success 'merging original branch into this branch' ' git tag v4.0 ' -cat >expected <expected <<-\EOF && + v4.0 + EOF git tag -l --contains $hash3 v* >actual && test_cmp expected actual " -cat >expected <expected <<-\EOF && + v0.2.1 + v1.0 + v1.0.1 + v1.1.3 + v2.0 + v3.0 + EOF git tag -l --no-contains $hash3 v* >actual && test_cmp expected actual " -cat >expected <expected <<-\EOF && + v0.2.1 + v1.0 + v1.0.1 + v1.1.3 + v2.0 + v3.0 + v4.0 + EOF git tag -l --contains $hash1 v* >actual && test_cmp expected actual " test_expect_success 'checking that --contains can be used in non-list mode' ' + cat >expected <<-\EOF && + v0.2.1 + v1.0 + v1.0.1 + v1.1.3 + v2.0 + v3.0 + v4.0 + EOF git tag --contains $hash1 v* >actual && test_cmp expected actual ' From patchwork Mon Aug 5 23:59:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AbdAlRahman Gad X-Patchwork-Id: 13754271 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (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 C8F7717278D for ; Mon, 5 Aug 2024 23:59:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722902394; cv=none; b=gjLEpTc7dvHEdy8egdITZ64LlHVLD2zwq11sDmZeVqiJcspyu8bUzgzMKw+0Vv+A7NDpTH0J2pmyACIChKi+Ix/qlctiUjBC8oZEiRwH8nWlVZFoDNc1y2erAIyHTpYk4Q17ls0vp2W8kaqSfWIdkMSfQj1ClkvSGusTLJ94obM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722902394; c=relaxed/simple; bh=Wyw+z4scJOkOkZqootZyKv6ntDDDvDBeZRyW2UsbHQo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=V0PLSO3rYqEIF6sWy2zahiejGVXBMkmJGfImPl4gblx2MRE8KNpi73Hpssll06oJFTsbDwMyV2blDFMlv8fZpiJC91AI3NW3c62iSb2n51Iy/3Ge+x8IElKIKdnT9i+n+V8WCtF8orgJbWvA92ChavpkCXvO0+HQoFOZA0RdulU= 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=edvfAu/k; arc=none smtp.client-ip=209.85.128.51 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="edvfAu/k" Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-4281faefea9so64046035e9.2 for ; Mon, 05 Aug 2024 16:59:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722902390; x=1723507190; 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=/fX06hHVdKYktUipBWQ7oKsQcnujp62bG+T8+GT2P7w=; b=edvfAu/kii5kZ2laQ8POl1Eaulknn4tfPUF8KFv1yU6ooi97AxFJNDXT+LUEVgr9fH hXsQFm3YPHZ3yYYjcqFeHxbGD3a7S6AhR2R2F0ElZbeMTkjgAmz30FM8TJSDv7FW0PzP sly68qhQQNkTQIBz7sIY1RI8LLDT++uaUhh6AdmmMmHqV7hNhsxdbuUpcdKBDJYCNZ3L ASXdgmkPosbLDIjXB72quAfoO0ni2/on+Zfb/ZP6w0gfJmz0dNBkOXiodStxjNtPS+Gf jOgL0dfmjyhHfTE8DuyXG+//7ze9oITiNhdcmVxfbzM+6tg5Aj4NrMIdUqlc/4Moyfuk 65Sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722902390; x=1723507190; 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=/fX06hHVdKYktUipBWQ7oKsQcnujp62bG+T8+GT2P7w=; b=OjKBPGxbnbpvlmRoMbLqL7xlr1S1W+61fNruLCmcbiwG/7mPY4zOuUAm91oW4XMvyL m2TPIkkL38sa2eepiL8C7qyTxwfyvlid06xmQOqPYNQxw9Bm92J0MgMFkHYEQQfMadAP gq4YG4dFSySWOLEaaDUhYQin1VlrlvBv9GgKwKescD4ho+lisOC2z+BRKtF6RocY/rEh YgQaUpdoinNDmmbFk1rslGvxZtpGLVxlwJGhxqG3+c6EvHwz0cFYZDPNfr+WHri1h/Hi lCPiatGy91bNemVzGOt+/nQrT0DTf3N3j10WmFv6CzjA/z9T4t3cUPo6novJXoEjbdn2 UaVQ== X-Gm-Message-State: AOJu0Yz5LCjXZyDd7mviwPo8cniTQK8/wNvTHWi5NGwNSPJL/4j1NGQL /M3ELy0nSe6Oirfg2JkI+in6nlHfpq4nF/82T0hA2lf3cze4+zH6hjpWaM4Y X-Google-Smtp-Source: AGHT+IG48P2rknjqg2VjKbGootbxmFGMaUFklX5TaMpoYyN2eXzBOG/Tt1+RPi4bOnP9IYhWflcdSA== X-Received: by 2002:a5d:5c88:0:b0:368:3808:7f68 with SMTP id ffacd0b85a97d-36bc5a0076amr6888665f8f.15.1722902390298; Mon, 05 Aug 2024 16:59:50 -0700 (PDT) Received: from abdobngad.. ([197.40.47.44]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36bbd074583sm11219065f8f.108.2024.08.05.16.59.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Aug 2024 16:59:50 -0700 (PDT) From: AbdAlRahman Gad To: git@vger.kernel.org Cc: AbdAlRahman Gad Subject: [PATCH v4 5/8] [Newcomer] t7004: Use indented here-doc Date: Tue, 6 Aug 2024 02:59:14 +0300 Message-ID: <20240805235917.190699-6-abdobngad@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240805235917.190699-1-abdobngad@gmail.com> References: <20240805235917.190699-1-abdobngad@gmail.com> Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Use <<-\EOF instead of <<\EOF where the latter allows us to indent the body of the here-doc. Signed-off-by: AbdAlRahman Gad --- t/t7004-tag.sh | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh index b9fe58fbee..242e38887b 100755 --- a/t/t7004-tag.sh +++ b/t/t7004-tag.sh @@ -389,10 +389,10 @@ test_expect_success 'tag -l -l works, as our buggy documenta test_expect_success 'listing tags in column' ' COLUMNS=41 git tag -l --column=row >actual && - cat >expected <<\EOF && -a1 aa1 cba t210 t211 -v0.2.1 v1.0 v1.0.1 v1.1.3 -EOF + cat >expected <<-\EOF && + a1 aa1 cba t210 t211 + v0.2.1 v1.0 v1.0.1 v1.1.3 + EOF test_cmp expected actual ' @@ -400,10 +400,10 @@ test_expect_success 'listing tags in column with column.*' ' test_config column.tag row && test_config column.ui dense && COLUMNS=40 git tag -l >actual && - cat >expected <<\EOF && -a1 aa1 cba t210 t211 -v0.2.1 v1.0 v1.0.1 v1.1.3 -EOF + cat >expected <<-\EOF && + a1 aa1 cba t210 t211 + v0.2.1 v1.0 v1.0.1 v1.1.3 + EOF test_cmp expected actual ' @@ -414,17 +414,17 @@ test_expect_success 'listing tag with -n --column should fail' ' test_expect_success 'listing tags -n in column with column.ui ignored' ' test_config column.ui "row dense" && COLUMNS=40 git tag -l -n >actual && - cat >expected <<\EOF && -a1 Foo -aa1 Foo -cba Foo -t210 Foo -t211 Foo -v0.2.1 Foo -v1.0 Foo -v1.0.1 Foo -v1.1.3 Foo -EOF + cat >expected <<-\EOF && + a1 Foo + aa1 Foo + cba Foo + t210 Foo + t211 Foo + v0.2.1 Foo + v1.0 Foo + v1.0.1 Foo + v1.1.3 Foo + EOF test_cmp expected actual ' From patchwork Mon Aug 5 23:59:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AbdAlRahman Gad X-Patchwork-Id: 13754272 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.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 BD550172BAE for ; Mon, 5 Aug 2024 23:59:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722902397; cv=none; b=bPUItxQZ8cp+enOYDcmqn7vv6eMo61T1OpZpyaaU4VGmm1oKTH+PxHgPsU4h/QbYjgRI5qojEWt8D1yGmspO+4vpDuimb+fTvyiefzxRiHfwr/wRzewAr44wBkCwX3IpwZPpPkVRBkj0sqJ+y/VrHWtFPs/PbpxJ8Rc0eY0vDPA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722902397; c=relaxed/simple; bh=lTA8DeV9KQhP5fORNi4HmGYvMWjWomKXImtzUrpqSNk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LD2FhBvcm+7xclCAIArnkiH6WsJ/4ZDQw1bgOvfTKkuCT9blkBubvUkQyD/kPuSQH3lQUex0eJIXfC11bEHE2teSA3WExJOA98G4F6fsp+hW5tRR8F27fV+O53IDB9tYZty4AmpvuPLaVfk0CzyZwuTh7I4X2oUT2WFjYW0FV+k= 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=HDJg0odx; arc=none smtp.client-ip=209.85.128.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="HDJg0odx" Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-4257d5fc9b7so658595e9.2 for ; Mon, 05 Aug 2024 16:59:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722902392; x=1723507192; 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=bgOM03lNDhyYJpmz6Eixgu9F+FLt7fh5F4BKdMwmM8c=; b=HDJg0odx7Qn1LFYcedlyDnoO0LKlEaD+SmX1e+1mKxaFG+J4MpV8jv9I5BenTwWN2q c+PZ1nICEFqanb+/Kou62FsrwVwYOuePAkOCbkfMssqfLFFekenIXQrI870Ib8atSNkO wxDsI+eJoIlH5/BO5lkFnlEanQgkk/V1nnpbH9TKQSP/yG7hOQyWFUJnL+DioW3SHX1d BCi/ISa2C7H5v3mR7vkf21ukhFxMDJiFvkIUSdk5dbdQcV1p+MLjLcF75GCPIXsM9rtC ny3JTWySx1uV8FjhJzuFcH9G5f69GqM/hhfbcjW1utjXCODiLv4wWnwvP1oZKCYCT+aR NsRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722902392; x=1723507192; 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=bgOM03lNDhyYJpmz6Eixgu9F+FLt7fh5F4BKdMwmM8c=; b=N96+XHu97vSHZmdjQCeZ1kWHpdTGU0Y58GGpaYU4CZTi3i0AVRuMI4CCJ4rz3HT1pL ZNn/xDTCxW519OW4I8l1QbOr8VPVadaL+V9hU3SBcm9LQYZEOHWgOhBhhzWN0gT+tsmD FZ/E3HaHwaDBIlSeeW9o62RKfukjWhGpkQ5X7cZMzi2eVn1HtjzkUkSx/578TJ7M9uAG g44NKL5iMCr2AmJoeKnm5RIVaB8W1KpV/k3sRUc7M5IUyaKJEuzzV1poLs+G3ipWNvRd BNnKJnP4ou67o2x901Tv2Fphzpd+r6t/EKTM6/4H3wHDdF2tCaMowGFMHXoDd6q5T0vq kYlA== X-Gm-Message-State: AOJu0Yx1PEKTT2VEdl3H1nffDK623V4dXpaZQvo0aSl5ClHry8vHXNCW Ng55plDL1AGxCq2Hm3x+WYhQqm0LmwHelmUL4m7+5T4/MJh/tSAeXH9y2YC0 X-Google-Smtp-Source: AGHT+IH8Fm5ptHy/waAVyCyLFZv+LF892PzB8hY/Ugd9GDLhgIeKuiaY78NrRGKIYFQMqt7qFEwlrQ== X-Received: by 2002:a05:600c:4e87:b0:426:5b44:2be7 with SMTP id 5b1f17b1804b1-428e6b02594mr122349315e9.10.1722902392260; Mon, 05 Aug 2024 16:59:52 -0700 (PDT) Received: from abdobngad.. ([197.40.47.44]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36bbd074583sm11219065f8f.108.2024.08.05.16.59.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Aug 2024 16:59:52 -0700 (PDT) From: AbdAlRahman Gad To: git@vger.kernel.org Cc: AbdAlRahman Gad Subject: [PATCH v4 6/8] [Newcomer] t7004: Description on the same line as test_expect_success Date: Tue, 6 Aug 2024 02:59:15 +0300 Message-ID: <20240805235917.190699-7-abdobngad@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240805235917.190699-1-abdobngad@gmail.com> References: <20240805235917.190699-1-abdobngad@gmail.com> Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 There are several tests in t7004 where the test description that follows `test_expect_success` is on a separate line, violating our coding style. Adapt these to be on the same line. Signed-off-by: AbdAlRahman Gad --- t/t7004-tag.sh | 249 +++++++++++++++++-------------------------------- 1 file changed, 83 insertions(+), 166 deletions(-) diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh index 242e38887b..6c93192d5d 100755 --- a/t/t7004-tag.sh +++ b/t/t7004-tag.sh @@ -156,26 +156,21 @@ test_expect_success 'listing a tag using a matching pattern should succeed' \ test_expect_success 'listing a tag with --ignore-case' \ 'test $(git tag -l --ignore-case MYTAG) = mytag' -test_expect_success \ - 'listing a tag using a matching pattern should output that tag' \ +test_expect_success 'listing a tag using a matching pattern should output that tag' \ 'test $(git tag -l mytag) = mytag' -test_expect_success \ - 'listing tags using a non-matching pattern should succeed' \ +test_expect_success 'listing tags using a non-matching pattern should succeed' \ 'git tag -l xxx' -test_expect_success \ - 'listing tags using a non-matching pattern should output nothing' \ +test_expect_success 'listing tags using a non-matching pattern should output nothing' \ 'test $(git tag -l xxx | wc -l) -eq 0' # special cases for creating tags: -test_expect_success \ - 'trying to create a tag with the name of one existing should fail' \ +test_expect_success 'trying to create a tag with the name of one existing should fail' \ 'test_must_fail git tag mytag' -test_expect_success \ - 'trying to create a tag with a non-valid name should fail' ' +test_expect_success 'trying to create a tag with a non-valid name should fail' ' test $(git tag -l | wc -l) -eq 1 && test_must_fail git tag "" && test_must_fail git tag .othertag && @@ -209,8 +204,7 @@ test_expect_success 'trying to delete an unknown tag should fail' ' test_must_fail git tag -d unknown-tag ' -test_expect_success \ - 'trying to delete tags without params should succeed and do nothing' ' +test_expect_success 'trying to delete tags without params should succeed and do nothing' ' cat >expect <<-\EOF && myhead mytag @@ -222,8 +216,7 @@ test_expect_success \ test_cmp expect actual ' -test_expect_success \ - 'deleting two existing tags in one command should succeed' ' +test_expect_success 'deleting two existing tags in one command should succeed' ' tag_exists mytag && tag_exists myhead && git tag -d mytag myhead && @@ -231,15 +224,13 @@ test_expect_success \ ! tag_exists myhead ' -test_expect_success \ - 'creating a tag with the name of another deleted one should succeed' ' +test_expect_success 'creating a tag with the name of another deleted one should succeed' ' ! tag_exists mytag && git tag mytag && tag_exists mytag ' -test_expect_success \ - 'trying to delete two tags, existing and not, should fail in the 2nd' ' +test_expect_success 'trying to delete two tags, existing and not, should fail in the 2nd' ' tag_exists mytag && ! tag_exists nonexistingtag && test_must_fail git tag -d mytag nonexistingtag && @@ -279,8 +270,7 @@ test_expect_success 'listing all tags should print them ordered' ' test_cmp expect actual ' -test_expect_success \ - 'listing tags with substring as pattern must print those matching' ' +test_expect_success 'listing tags with substring as pattern must print those matching' ' cat >expect <<-\EOF && a1 aa1 @@ -291,8 +281,7 @@ test_expect_success \ test_cmp expect current ' -test_expect_success \ - 'listing tags with a suffix as pattern must print those matching' ' +test_expect_success 'listing tags with a suffix as pattern must print those matching' ' cat >expect <<-\EOF && v0.2.1 v1.0.1 @@ -301,8 +290,7 @@ test_expect_success \ test_cmp expect actual ' -test_expect_success \ - 'listing tags with a prefix as pattern must print those matching' ' +test_expect_success 'listing tags with a prefix as pattern must print those matching' ' cat >expect <<-\EOF && t210 t211 @@ -311,8 +299,7 @@ test_expect_success \ test_cmp expect actual ' -test_expect_success \ - 'listing tags using a name as pattern must print that one matching' ' +test_expect_success 'listing tags using a name as pattern must print that one matching' ' cat >expect <<-\EOF && a1 EOF @@ -320,8 +307,7 @@ test_expect_success \ test_cmp expect actual ' -test_expect_success \ - 'listing tags using a name as pattern must print that one matching' ' +test_expect_success 'listing tags using a name as pattern must print that one matching' ' cat >expect <<-\EOF && v1.0 EOF @@ -329,8 +315,7 @@ test_expect_success \ test_cmp expect actual ' -test_expect_success \ - 'listing tags with ? in the pattern should print those matching' ' +test_expect_success 'listing tags with ? in the pattern should print those matching' ' cat >expect <<-\EOF && v1.0.1 v1.1.3 @@ -339,14 +324,12 @@ test_expect_success \ test_cmp expect actual ' -test_expect_success \ - 'listing tags using v.* should print nothing because none have v.' ' +test_expect_success 'listing tags using v.* should print nothing because none have v.' ' git tag -l "v.*" >actual && test_must_be_empty actual ' -test_expect_success \ - 'listing tags using v* should print only those having v' ' +test_expect_success 'listing tags using v* should print only those having v' ' cat >expect <<-\EOF && v0.2.1 v1.0 @@ -430,8 +413,7 @@ test_expect_success 'listing tags -n in column with column.ui ignored' ' # creating and verifying lightweight tags: -test_expect_success \ - 'a non-annotated tag created without parameters should point to HEAD' ' +test_expect_success 'a non-annotated tag created without parameters should point to HEAD' ' git tag non-annotated-tag && test $(git cat-file -t non-annotated-tag) = commit && test $(git rev-parse non-annotated-tag) = $(git rev-parse HEAD) @@ -440,12 +422,10 @@ test_expect_success \ test_expect_success 'trying to verify an unknown tag should fail' \ 'test_must_fail git tag -v unknown-tag' -test_expect_success \ - 'trying to verify a non-annotated and non-signed tag should fail' \ +test_expect_success 'trying to verify a non-annotated and non-signed tag should fail' \ 'test_must_fail git tag -v non-annotated-tag' -test_expect_success \ - 'trying to verify many non-annotated or unknown tags, should fail' \ +test_expect_success 'trying to verify many non-annotated or unknown tags, should fail' \ 'test_must_fail git tag -v unknown-tag1 non-annotated-tag unknown-tag2' # creating annotated tags: @@ -465,8 +445,7 @@ tagger C O Mitter $4 -0700 EOF } -test_expect_success \ - 'creating an annotated tag with -m message should succeed' ' +test_expect_success 'creating an annotated tag with -m message should succeed' ' commit=$(git rev-parse HEAD) && time=$test_tick && get_tag_header annotated-tag $commit commit $time >expect && @@ -483,8 +462,7 @@ test_expect_success 'set up editor' ' EOF ' -test_expect_success \ - 'creating an annotated tag with -m message --edit should succeed' ' +test_expect_success 'creating an annotated tag with -m message --edit should succeed' ' get_tag_header annotated-tag-edit $commit commit $time >expect && echo "An edited message" >>expect && GIT_EDITOR=./fakeeditor git tag -m "A message" --edit annotated-tag-edit && @@ -492,8 +470,7 @@ test_expect_success \ test_cmp expect actual ' -test_expect_success \ - 'creating an annotated tag with -F messagefile should succeed' ' +test_expect_success 'creating an annotated tag with -F messagefile should succeed' ' cat >msgfile <<-\EOF && Another message in a file. @@ -512,8 +489,7 @@ test_expect_success 'set up editor' ' EOF ' -test_expect_success \ - 'creating an annotated tag with -F messagefile --edit should succeed' ' +test_expect_success 'creating an annotated tag with -F messagefile --edit should succeed' ' get_tag_header file-annotated-tag-edit $commit commit $time >expect && sed -e "s/Another message/Another edited message/g" msgfile >>expect && GIT_EDITOR=./fakeeditor git tag -F msgfile --edit file-annotated-tag-edit && @@ -533,16 +509,14 @@ test_expect_success 'creating an annotated tag with -F - should succeed' ' test_cmp expect actual ' -test_expect_success \ - 'trying to create a tag with a non-existing -F file should fail' ' +test_expect_success 'trying to create a tag with a non-existing -F file should fail' ' ! test -f nonexistingfile && ! tag_exists notag && test_must_fail git tag -F nonexistingfile notag && ! tag_exists notag ' -test_expect_success \ - 'trying to create tags giving both -m or -F options should fail' ' +test_expect_success 'trying to create tags giving both -m or -F options should fail' ' echo "message file 1" >msgfile1 && ! tag_exists msgtag && test_must_fail git tag -m "message 1" -F msgfile1 msgtag && @@ -556,16 +530,14 @@ test_expect_success \ # blank and empty messages: -test_expect_success \ - 'creating a tag with an empty -m message should succeed' ' +test_expect_success 'creating a tag with an empty -m message should succeed' ' get_tag_header empty-annotated-tag $commit commit $time >expect && git tag -m "" empty-annotated-tag && get_tag_msg empty-annotated-tag >actual && test_cmp expect actual ' -test_expect_success \ - 'creating a tag with an empty -F messagefile should succeed' ' +test_expect_success 'creating a tag with an empty -F messagefile should succeed' ' >emptyfile && get_tag_header emptyfile-annotated-tag $commit commit $time >expect && git tag -F emptyfile emptyfile-annotated-tag && @@ -573,8 +545,7 @@ test_expect_success \ test_cmp expect actual ' -test_expect_success \ - 'extra blanks in the message for an annotated tag should be removed' ' +test_expect_success 'extra blanks in the message for an annotated tag should be removed' ' printf "\n\n \n\t\nLeading blank lines\n" >blanksfile && printf "\n\t \t \nRepeated blank lines\n" >>blanksfile && printf "\n\n\nTrailing spaces \t \n" >>blanksfile && @@ -594,16 +565,14 @@ test_expect_success \ test_cmp expect actual ' -test_expect_success \ - 'creating a tag with blank -m message with spaces should succeed' ' +test_expect_success 'creating a tag with blank -m message with spaces should succeed' ' get_tag_header blank-annotated-tag $commit commit $time >expect && git tag -m " " blank-annotated-tag && get_tag_msg blank-annotated-tag >actual && test_cmp expect actual ' -test_expect_success \ - 'creating a tag with blank -F messagefile with spaces should succeed' ' +test_expect_success 'creating a tag with blank -F messagefile with spaces should succeed' ' echo " " >blankfile && echo "" >>blankfile && echo " " >>blankfile && @@ -613,8 +582,7 @@ test_expect_success \ test_cmp expect actual ' -test_expect_success \ - 'creating a tag with -F file of spaces and no newline should succeed' ' +test_expect_success 'creating a tag with -F file of spaces and no newline should succeed' ' printf " " >blanknonlfile && get_tag_header blanknonlfile-annotated-tag $commit commit $time >expect && git tag -F blanknonlfile blanknonlfile-annotated-tag && @@ -624,8 +592,7 @@ test_expect_success \ # messages with commented lines: -test_expect_success \ - 'creating a tag using a -F messagefile with #comments should succeed' ' +test_expect_success 'creating a tag using a -F messagefile with #comments should succeed' ' cat >commentsfile <<-\EOF && # A comment @@ -657,16 +624,14 @@ test_expect_success \ test_cmp expect actual ' -test_expect_success \ - 'creating a tag with a #comment in the -m message should succeed' ' +test_expect_success 'creating a tag with a #comment in the -m message should succeed' ' get_tag_header comment-annotated-tag $commit commit $time >expect && git tag -m "#comment" comment-annotated-tag && get_tag_msg comment-annotated-tag >actual && test_cmp expect actual ' -test_expect_success \ - 'creating a tag with #comments in the -F messagefile should succeed' ' +test_expect_success 'creating a tag with #comments in the -F messagefile should succeed' ' echo "#comment" >commentfile && echo "" >>commentfile && echo "####" >>commentfile && @@ -676,8 +641,7 @@ test_expect_success \ test_cmp expect actual ' -test_expect_success \ - 'creating a tag with a file of #comment and no newline should succeed' ' +test_expect_success 'creating a tag with a file of #comment and no newline should succeed' ' printf "#comment" >commentnonlfile && get_tag_header commentnonlfile-annotated-tag $commit commit $time >expect && git tag -F commentnonlfile commentnonlfile-annotated-tag && @@ -796,8 +760,7 @@ test_expect_success 'bad editor causes panic when only --trailer is given' ' # listing messages for annotated non-signed tags: -test_expect_success \ - 'listing the one-line message of a non-signed tag should succeed' ' +test_expect_success 'listing the one-line message of a non-signed tag should succeed' ' git tag -m "A msg" tag-one-line && echo "tag-one-line" >expect && @@ -836,8 +799,7 @@ test_expect_success 'The -n 100 invocation means -n --list 100, not -n100' ' test_cmp expect actual ' -test_expect_success \ - 'listing the zero-lines message of a non-signed tag should succeed' ' +test_expect_success 'listing the zero-lines message of a non-signed tag should succeed' ' git tag -m "" tag-zero-lines && echo "tag-zero-lines" >expect && @@ -861,8 +823,7 @@ test_expect_success \ test_cmp expect actual ' -test_expect_success \ - 'listing many message lines of a non-signed tag should succeed' ' +test_expect_success 'listing many message lines of a non-signed tag should succeed' ' echo "tag line one" >annotagmsg && echo "tag line two" >>annotagmsg && echo "tag line three" >>annotagmsg && @@ -953,20 +914,17 @@ test_expect_success 'git tag --format with ahead-behind' ' # trying to verify annotated non-signed tags: -test_expect_success GPG \ - 'trying to verify an annotated non-signed tag should fail' ' +test_expect_success GPG 'trying to verify an annotated non-signed tag should fail' ' tag_exists annotated-tag && test_must_fail git tag -v annotated-tag ' -test_expect_success GPG \ - 'trying to verify a file-annotated non-signed tag should fail' ' +test_expect_success GPG 'trying to verify a file-annotated non-signed tag should fail' ' tag_exists file-annotated-tag && test_must_fail git tag -v file-annotated-tag ' -test_expect_success GPG \ - 'trying to verify two annotated non-signed tags should fail' ' +test_expect_success GPG 'trying to verify two annotated non-signed tags should fail' ' tag_exists annotated-tag file-annotated-tag && test_must_fail git tag -v annotated-tag file-annotated-tag ' @@ -1023,8 +981,7 @@ test_expect_success GPG '-u implies signed tag' ' test_cmp expect actual ' -test_expect_success GPG \ - 'creating a signed tag with -F messagefile should succeed' ' +test_expect_success GPG 'creating a signed tag with -F messagefile should succeed' ' cat >sigmsgfile <<-\EOF && Another signed tag message in a file. @@ -1059,8 +1016,7 @@ test_expect_success GPG '-s implies annotated tag' ' test_cmp expect actual ' -test_expect_success GPG \ - 'git tag -s implied if configured with tag.forcesignannotated' \ +test_expect_success GPG 'git tag -s implied if configured with tag.forcesignannotated' \ 'get_tag_header forcesignannotated-implied-sign $commit commit $time >expect && echo "A message" >>expect && echo "-----BEGIN PGP SIGNATURE-----" >>expect && @@ -1070,16 +1026,14 @@ test_expect_success GPG \ test_cmp expect actual ' -test_expect_success GPG \ - 'lightweight with no message when configured with tag.forcesignannotated' \ +test_expect_success GPG 'lightweight with no message when configured with tag.forcesignannotated' \ 'test_config tag.forcesignannotated true && git tag forcesignannotated-lightweight && tag_exists forcesignannotated-lightweight && test_must_fail git tag -v forcesignannotated-no-message ' -test_expect_success GPG \ - 'git tag -a disable configured tag.forcesignannotated' \ +test_expect_success GPG 'git tag -a disable configured tag.forcesignannotated' \ 'get_tag_header forcesignannotated-annotate $commit commit $time >expect && echo "A message" >>expect && test_config tag.forcesignannotated true && @@ -1089,8 +1043,7 @@ test_expect_success GPG \ test_must_fail git tag -v forcesignannotated-annotate ' -test_expect_success GPG \ - 'git tag --sign enable GPG sign' \ +test_expect_success GPG 'git tag --sign enable GPG sign' \ 'get_tag_header forcesignannotated-disabled $commit commit $time >expect && echo "A message" >>expect && echo "-----BEGIN PGP SIGNATURE-----" >>expect && @@ -1100,8 +1053,7 @@ test_expect_success GPG \ test_cmp expect actual ' -test_expect_success GPG \ - 'git tag configured tag.gpgsign enables GPG sign' \ +test_expect_success GPG 'git tag configured tag.gpgsign enables GPG sign' \ 'get_tag_header gpgsign-enabled $commit commit $time >expect && echo "A message" >>expect && echo "-----BEGIN PGP SIGNATURE-----" >>expect && @@ -1111,8 +1063,7 @@ test_expect_success GPG \ test_cmp expect actual ' -test_expect_success GPG \ - 'git tag --no-sign configured tag.gpgsign skip GPG sign' \ +test_expect_success GPG 'git tag --no-sign configured tag.gpgsign skip GPG sign' \ 'get_tag_header no-sign $commit commit $time >expect && echo "A message" >>expect && test_config tag.gpgsign true && @@ -1121,8 +1072,7 @@ test_expect_success GPG \ test_cmp expect actual ' -test_expect_success GPG \ - 'trying to create a signed tag with non-existing -F file should fail' ' +test_expect_success GPG 'trying to create a signed tag with non-existing -F file should fail' ' ! test -f nonexistingfile && ! tag_exists nosigtag && test_must_fail git tag -s -F nonexistingfile nosigtag && @@ -1135,8 +1085,7 @@ test_expect_success GPG 'verifying a signed tag should succeed' \ test_expect_success GPG 'verifying two signed tags in one command should succeed' \ 'git tag -v signed-tag file-signed-tag' -test_expect_success GPG \ - 'verifying many signed and non-signed tags should fail' ' +test_expect_success GPG 'verifying many signed and non-signed tags should fail' ' test_must_fail git tag -v signed-tag annotated-tag && test_must_fail git tag -v file-annotated-tag file-signed-tag && test_must_fail git tag -v annotated-tag \ @@ -1167,8 +1116,7 @@ test_expect_success GPG 'verifying a forged tag with --format should fail silent # blank and empty messages for signed tags: -test_expect_success GPG \ - 'creating a signed tag with an empty -m message should succeed' ' +test_expect_success GPG 'creating a signed tag with an empty -m message should succeed' ' get_tag_header empty-signed-tag $commit commit $time >expect && echo "-----BEGIN PGP SIGNATURE-----" >>expect && git tag -s -m "" empty-signed-tag && @@ -1177,8 +1125,7 @@ test_expect_success GPG \ git tag -v empty-signed-tag ' -test_expect_success GPG \ - 'creating a signed tag with an empty -F messagefile should succeed' ' +test_expect_success GPG 'creating a signed tag with an empty -F messagefile should succeed' ' >sigemptyfile && get_tag_header emptyfile-signed-tag $commit commit $time >expect && echo "-----BEGIN PGP SIGNATURE-----" >>expect && @@ -1188,8 +1135,7 @@ test_expect_success GPG \ git tag -v emptyfile-signed-tag ' -test_expect_success GPG \ - 'extra blanks in the message for a signed tag should be removed' ' +test_expect_success GPG 'extra blanks in the message for a signed tag should be removed' ' printf "\n\n \n\t\nLeading blank lines\n" >sigblanksfile && printf "\n\t \t \nRepeated blank lines\n" >>sigblanksfile && printf "\n\n\nTrailing spaces \t \n" >>sigblanksfile && @@ -1211,8 +1157,7 @@ test_expect_success GPG \ git tag -v blanks-signed-tag ' -test_expect_success GPG \ - 'creating a signed tag with a blank -m message should succeed' ' +test_expect_success GPG 'creating a signed tag with a blank -m message should succeed' ' get_tag_header blank-signed-tag $commit commit $time >expect && echo "-----BEGIN PGP SIGNATURE-----" >>expect && git tag -s -m " " blank-signed-tag && @@ -1221,8 +1166,7 @@ test_expect_success GPG \ git tag -v blank-signed-tag ' -test_expect_success GPG \ - 'creating a signed tag with blank -F file with spaces should succeed' ' +test_expect_success GPG 'creating a signed tag with blank -F file with spaces should succeed' ' echo " " >sigblankfile && echo "" >>sigblankfile && echo " " >>sigblankfile && @@ -1234,8 +1178,7 @@ test_expect_success GPG \ git tag -v blankfile-signed-tag ' -test_expect_success GPG \ - 'creating a signed tag with spaces and no newline should succeed' ' +test_expect_success GPG 'creating a signed tag with spaces and no newline should succeed' ' printf " " >sigblanknonlfile && get_tag_header blanknonlfile-signed-tag $commit commit $time >expect && echo "-----BEGIN PGP SIGNATURE-----" >>expect && @@ -1258,8 +1201,7 @@ test_expect_success GPG 'signed tag with embedded PGP message' ' # messages with commented lines for signed tags: -test_expect_success GPG \ - 'creating a signed tag with a -F file with #comments should succeed' ' +test_expect_success GPG 'creating a signed tag with a -F file with #comments should succeed' ' cat >sigcommentsfile <<-\EOF && # A comment @@ -1293,8 +1235,7 @@ test_expect_success GPG \ git tag -v comments-signed-tag ' -test_expect_success GPG \ - 'creating a signed tag with #commented -m message should succeed' ' +test_expect_success GPG 'creating a signed tag with #commented -m message should succeed' ' get_tag_header comment-signed-tag $commit commit $time >expect && echo "-----BEGIN PGP SIGNATURE-----" >>expect && git tag -s -m "#comment" comment-signed-tag && @@ -1303,8 +1244,7 @@ test_expect_success GPG \ git tag -v comment-signed-tag ' -test_expect_success GPG \ - 'creating a signed tag with #commented -F messagefile should succeed' ' +test_expect_success GPG 'creating a signed tag with #commented -F messagefile should succeed' ' echo "#comment" >sigcommentfile && echo "" >>sigcommentfile && echo "####" >>sigcommentfile && @@ -1316,8 +1256,7 @@ test_expect_success GPG \ git tag -v commentfile-signed-tag ' -test_expect_success GPG \ - 'creating a signed tag with a #comment and no newline should succeed' ' +test_expect_success GPG 'creating a signed tag with a #comment and no newline should succeed' ' printf "#comment" >sigcommentnonlfile && get_tag_header commentnonlfile-signed-tag $commit commit $time >expect && echo "-----BEGIN PGP SIGNATURE-----" >>expect && @@ -1329,8 +1268,7 @@ test_expect_success GPG \ # listing messages for signed tags: -test_expect_success GPG \ - 'listing the one-line message of a signed tag should succeed' ' +test_expect_success GPG 'listing the one-line message of a signed tag should succeed' ' git tag -s -m "A message line signed" stag-one-line && echo "stag-one-line" >expect && @@ -1354,8 +1292,7 @@ test_expect_success GPG \ test_cmp expect actual ' -test_expect_success GPG \ - 'listing the zero-lines message of a signed tag should succeed' ' +test_expect_success GPG 'listing the zero-lines message of a signed tag should succeed' ' git tag -s -m "" stag-zero-lines && echo "stag-zero-lines" >expect && @@ -1379,8 +1316,7 @@ test_expect_success GPG \ test_cmp expect actual ' -test_expect_success GPG \ - 'listing many message lines of a signed tag should succeed' ' +test_expect_success GPG 'listing many message lines of a signed tag should succeed' ' echo "stag line one" >sigtagmsg && echo "stag line two" >>sigtagmsg && echo "stag line three" >>sigtagmsg && @@ -1425,8 +1361,7 @@ test_expect_success GPG \ # tags pointing to objects different from commits: -test_expect_success GPG \ - 'creating a signed tag pointing to a tree should succeed' ' +test_expect_success GPG 'creating a signed tag pointing to a tree should succeed' ' tree=$(git rev-parse HEAD^{tree}) && get_tag_header tree-signed-tag $tree tree $time >expect && echo "A message for a tree" >>expect && @@ -1436,8 +1371,7 @@ test_expect_success GPG \ test_cmp expect actual ' -test_expect_success GPG \ - 'creating a signed tag pointing to a blob should succeed' ' +test_expect_success GPG 'creating a signed tag pointing to a blob should succeed' ' blob=$(git rev-parse HEAD:foo) && get_tag_header blob-signed-tag $blob blob $time >expect && echo "A message for a blob" >>expect && @@ -1447,8 +1381,7 @@ test_expect_success GPG \ test_cmp expect actual ' -test_expect_success GPG \ - 'creating a signed tag pointing to another tag should succeed' ' +test_expect_success GPG 'creating a signed tag pointing to another tag should succeed' ' tag=$(git rev-parse signed-tag 2>/dev/null) && get_tag_header tag-signed-tag $tag tag $time >expect && echo "A message for another tag" >>expect && @@ -1460,8 +1393,7 @@ test_expect_success GPG \ # usage with rfc1991 signatures -test_expect_success GPG,RFC1991 \ - 'creating a signed tag with rfc1991' ' +test_expect_success GPG,RFC1991 'creating a signed tag with rfc1991' ' get_tag_header rfc1991-signed-tag $commit commit $time >expect && echo "RFC1991 signed tag" >>expect && echo "-----BEGIN PGP MESSAGE-----" >>expect && @@ -1471,8 +1403,7 @@ test_expect_success GPG,RFC1991 \ test_cmp expect actual ' -test_expect_success GPG,RFC1991 \ - 'reediting a signed tag body omits signature' ' +test_expect_success GPG,RFC1991 'reediting a signed tag body omits signature' ' cat >fakeeditor <<-\EOF && #!/bin/sh cp "$1" actual @@ -1484,14 +1415,12 @@ test_expect_success GPG,RFC1991 \ test_cmp expect actual ' -test_expect_success GPG,RFC1991 \ - 'verifying rfc1991 signature' ' +test_expect_success GPG,RFC1991 'verifying rfc1991 signature' ' echo "rfc1991" >gpghome/gpg.conf && git tag -v rfc1991-signed-tag ' -test_expect_success GPG,RFC1991 \ - 'list tag with rfc1991 signature' ' +test_expect_success GPG,RFC1991 'list tag with rfc1991 signature' ' echo "rfc1991" >gpghome/gpg.conf && echo "rfc1991-signed-tag RFC1991 signed tag" >expect && git tag -l -n1 rfc1991-signed-tag >actual && @@ -1502,14 +1431,12 @@ test_expect_success GPG,RFC1991 \ test_cmp expect actual ' -test_expect_success GPG,RFC1991 \ - 'verifying rfc1991 signature without --rfc1991' ' +test_expect_success GPG,RFC1991 'verifying rfc1991 signature without --rfc1991' ' rm -f gpghome/gpg.conf && git tag -v rfc1991-signed-tag ' -test_expect_success GPG,RFC1991 \ - 'list tag with rfc1991 signature without --rfc1991' ' +test_expect_success GPG,RFC1991 'list tag with rfc1991 signature without --rfc1991' ' echo "rfc1991-signed-tag RFC1991 signed tag" >expect && git tag -l -n1 rfc1991-signed-tag >actual && test_cmp expect actual && @@ -1519,22 +1446,19 @@ test_expect_success GPG,RFC1991 \ test_cmp expect actual ' -test_expect_success GPG,RFC1991 \ - 'reediting a signed tag body omits signature' ' +test_expect_success GPG,RFC1991 'reediting a signed tag body omits signature' ' echo "RFC1991 signed tag" >expect && GIT_EDITOR=./fakeeditor git tag -f -s rfc1991-signed-tag $commit && test_cmp expect actual ' # try to sign with bad user.signingkey -test_expect_success GPG \ - 'git tag -s fails if gpg is misconfigured (bad key)' \ +test_expect_success GPG 'git tag -s fails if gpg is misconfigured (bad key)' \ 'test_config user.signingkey BobTheMouse && test_must_fail git tag -s -m tail tag-gpg-failure' # try to produce invalid signature -test_expect_success GPG \ - 'git tag -s fails if gpg is misconfigured (bad signature format)' \ +test_expect_success GPG 'git tag -s fails if gpg is misconfigured (bad signature format)' \ 'test_config gpg.program echo && test_must_fail git tag -s -m tail tag-gpg-failure' @@ -1557,34 +1481,29 @@ test_expect_success GPG 'git verifies tag is valid with double signature' ' ' # try to sign with bad user.signingkey -test_expect_success GPGSM \ - 'git tag -s fails if gpgsm is misconfigured (bad key)' \ +test_expect_success GPGSM 'git tag -s fails if gpgsm is misconfigured (bad key)' \ 'test_config user.signingkey BobTheMouse && test_config gpg.format x509 && test_must_fail git tag -s -m tail tag-gpg-failure' # try to produce invalid signature -test_expect_success GPGSM \ - 'git tag -s fails if gpgsm is misconfigured (bad signature format)' \ +test_expect_success GPGSM 'git tag -s fails if gpgsm is misconfigured (bad signature format)' \ 'test_config gpg.x509.program echo && test_config gpg.format x509 && test_must_fail git tag -s -m tail tag-gpg-failure' # try to verify without gpg: -test_expect_success GPG \ - 'verify signed tag fails when public key is not present' \ +test_expect_success GPG 'verify signed tag fails when public key is not present' \ 'rm -rf gpghome && test_must_fail git tag -v signed-tag ' -test_expect_success \ - 'git tag -a fails if tag annotation is empty' ' +test_expect_success 'git tag -a fails if tag annotation is empty' ' ! (GIT_EDITOR=cat git tag -a initial-comment) ' -test_expect_success \ - 'message in editor has initial comment' ' +test_expect_success 'message in editor has initial comment' ' ! (GIT_EDITOR=cat git tag -a initial-comment >actual) ' @@ -1595,15 +1514,13 @@ test_expect_success 'message in editor has initial comment: first line' ' test_cmp first.expect first.actual ' -test_expect_success \ - 'message in editor has initial comment: remainder' ' +test_expect_success 'message in editor has initial comment: remainder' ' # remove commented lines from the remainder -- should be empty sed -e 1d -e "/^#/d" rest.actual && test_must_be_empty rest.actual ' -test_expect_success \ - 'overwriting an annotated tag should use its previous body' ' +test_expect_success 'overwriting an annotated tag should use its previous body' ' get_tag_header reuse $commit commit $time >expect && echo "An annotation to be reused" >>expect && git tag -a -m "An annotation to be reused" reuse && From patchwork Mon Aug 5 23:59:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AbdAlRahman Gad X-Patchwork-Id: 13754273 Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) (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 F1DFB171E5F for ; Mon, 5 Aug 2024 23:59:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722902397; cv=none; b=IR7WFBE6mlFXN/KYhIv8W/TV2/wfTnP31rxhBwTQuWDyPE58b0ljGkltZyPv3kFq0xm1Pc+EKX/uWdy4zkt1K0h3Fwv4mlOdIE4lEkpITvaPzwE056L92YiSuDabf6XnQPnR+oU90kZkkSIXCJAKZEXv9Y925clfn57wn67W+Bo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722902397; c=relaxed/simple; bh=i7s8xi670FgFvwLuSBQ9fsq1/3J8V6Ht3tXnIEWyV6E=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ctGPTVFSLDGeuNdBiRazyuZMSpwTxJTSdofWsrIhtEyrhkGDSFf6AxN2AoglUpRzPRkZxswDSUK9klhheRjK/OHG4i7mqG13X7WDqs75wlBUO8wDsoOh35TmbcQJZX2gVsa0dp8/rF0YMlL7jTvnE5nsenpp2V83dzb3f92PXKw= 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=Wxc8Gaw5; arc=none smtp.client-ip=209.85.221.41 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="Wxc8Gaw5" Received: by mail-wr1-f41.google.com with SMTP id ffacd0b85a97d-36ba3b06186so3189052f8f.2 for ; Mon, 05 Aug 2024 16:59:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722902394; x=1723507194; 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=Jf9/6GuDTo3+VNry/KmF3EaQtXNlqBTPhf6IiTJY00k=; b=Wxc8Gaw574sn4ZzQapP4UPjjb1j3H/nLNJXI/ZgZgAOBxprDsYK8blrH74881FPpOw lFlOksAun216zGIU2iN5YqKGBSUNl60axyyYO6smYWn7Fv+QWJT8VoW2qmpJ8H6pVg8g 3YQLZ9tNS+mKHA7mGySvPaUdNlgpxPL31mppdJjNvW1sN2TMud3RFtK8k1NCVQbPq9Q2 EZJw0IPUFohFu7P28aO+moZv2i/rL01T5E6Y4eQ/IHOTb+lSPyAv6HeIOLtOpXEUb+RN +yUKVCGRWNaGJN+HIKmwuL1qLHUA+rascz1mRryfs8TkExbcwSKsDunMXmtdaiqjsOkw gliA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722902394; x=1723507194; 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=Jf9/6GuDTo3+VNry/KmF3EaQtXNlqBTPhf6IiTJY00k=; b=Kwd4QUkIpJhW/fQ2sN5z1ZEruth1yc5FQn6j5Dz0KEAcdgf74NglYErWtEU+pF4uVE +wVUiNrBvrGAKFHFuKDMa12BdGHDjsgacdQE8jmV2Z0r6NG+YA0UdYb4T6VGIUjaoXTg far63ke1LwNWjrRmJ97/UICcYmW+ZFCAzVFHgUQaATWNUUAts9hT2EpkgIIkB01u89n8 Sj5xtKY2v/a7A6S2jiG1HwIjSedD0/l72rMGEcGLycHLN17qGpwolwDWUMgafZBeMAZg FWUt2ICgOSAeO3/tdGogtsXuJkdAlNQXlWleCqVTy/kAcHluOpZfvYO8UIqb4CBMtLs9 QqTw== X-Gm-Message-State: AOJu0YwBOHIWYAnB7Qrz/GxmBUIa4IETA4avUJHNBarnMXp4LCvxso/c Kt0S0ntdOcsPv+pcWMOuaKRnBXpsSZsNkknhNgr0jASRYjyY+TuuaoIWSFaT X-Google-Smtp-Source: AGHT+IHydG20pmsexx5TAvH7UnNOLjV/VX8X0ZXsnnKTp36wOFGy7f8FRIFQTDYftsA5OCmjJ4D0mw== X-Received: by 2002:a5d:5f86:0:b0:368:445e:91cc with SMTP id ffacd0b85a97d-36bbc0e40bcmr10157342f8f.21.1722902393632; Mon, 05 Aug 2024 16:59:53 -0700 (PDT) Received: from abdobngad.. ([197.40.47.44]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36bbd074583sm11219065f8f.108.2024.08.05.16.59.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Aug 2024 16:59:53 -0700 (PDT) From: AbdAlRahman Gad To: git@vger.kernel.org Cc: AbdAlRahman Gad Subject: [PATCH v4 7/8] [Newcomer] t7004: test Description and test body seperated with backslash Date: Tue, 6 Aug 2024 02:59:16 +0300 Message-ID: <20240805235917.190699-8-abdobngad@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240805235917.190699-1-abdobngad@gmail.com> References: <20240805235917.190699-1-abdobngad@gmail.com> Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Test body should begin with a single quote right after the test description instead of backslash followed by new line. Signed-off-by: AbdAlRahman Gad --- t/t7004-tag.sh | 125 ++++++++++++++++++++++++++++--------------------- 1 file changed, 71 insertions(+), 54 deletions(-) diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh index 6c93192d5d..a46f8141d4 100755 --- a/t/t7004-tag.sh +++ b/t/t7004-tag.sh @@ -61,8 +61,9 @@ test_expect_success 'sort tags, ignore case' ' ) ' -test_expect_success 'looking for a tag in an empty tree should fail' \ - '! (tag_exists mytag)' +test_expect_success 'looking for a tag in an empty tree should fail' ' + ! (tag_exists mytag) +' test_expect_success 'creating a tag in an empty tree should fail' ' test_must_fail git tag mynotag && @@ -150,25 +151,31 @@ test_expect_success 'listing all tags if one exists should output that tag' ' # pattern matching: -test_expect_success 'listing a tag using a matching pattern should succeed' \ - 'git tag -l mytag' +test_expect_success 'listing a tag using a matching pattern should succeed' ' + git tag -l mytag +' -test_expect_success 'listing a tag with --ignore-case' \ - 'test $(git tag -l --ignore-case MYTAG) = mytag' +test_expect_success 'listing a tag with --ignore-case' ' + test $(git tag -l --ignore-case MYTAG) = mytag +' -test_expect_success 'listing a tag using a matching pattern should output that tag' \ - 'test $(git tag -l mytag) = mytag' +test_expect_success 'listing a tag using a matching pattern should output that tag' ' + test $(git tag -l mytag) = mytag +' -test_expect_success 'listing tags using a non-matching pattern should succeed' \ - 'git tag -l xxx' +test_expect_success 'listing tags using a non-matching pattern should succeed' ' + git tag -l xxx +' -test_expect_success 'listing tags using a non-matching pattern should output nothing' \ - 'test $(git tag -l xxx | wc -l) -eq 0' +test_expect_success 'listing tags using a non-matching pattern should output nothing' ' + test $(git tag -l xxx | wc -l) -eq 0 +' # special cases for creating tags: -test_expect_success 'trying to create a tag with the name of one existing should fail' \ - 'test_must_fail git tag mytag' +test_expect_success 'trying to create a tag with the name of one existing should fail' ' + test_must_fail git tag mytag +' test_expect_success 'trying to create a tag with a non-valid name should fail' ' test $(git tag -l | wc -l) -eq 1 && @@ -238,8 +245,9 @@ test_expect_success 'trying to delete two tags, existing and not, should fail in ! tag_exists nonexistingtag ' -test_expect_success 'trying to delete an already deleted tag should fail' \ - 'test_must_fail git tag -d mytag' +test_expect_success 'trying to delete an already deleted tag should fail' ' + test_must_fail git tag -d mytag +' # listing various tags with pattern matching: @@ -419,14 +427,17 @@ test_expect_success 'a non-annotated tag created without parameters should point test $(git rev-parse non-annotated-tag) = $(git rev-parse HEAD) ' -test_expect_success 'trying to verify an unknown tag should fail' \ - 'test_must_fail git tag -v unknown-tag' +test_expect_success 'trying to verify an unknown tag should fail' ' + test_must_fail git tag -v unknown-tag +' -test_expect_success 'trying to verify a non-annotated and non-signed tag should fail' \ - 'test_must_fail git tag -v non-annotated-tag' +test_expect_success 'trying to verify a non-annotated and non-signed tag should fail' ' + test_must_fail git tag -v non-annotated-tag +' -test_expect_success 'trying to verify many non-annotated or unknown tags, should fail' \ - 'test_must_fail git tag -v unknown-tag1 non-annotated-tag unknown-tag2' +test_expect_success 'trying to verify many non-annotated or unknown tags, should fail' ' + test_must_fail git tag -v unknown-tag1 non-annotated-tag unknown-tag2 +' # creating annotated tags: @@ -1016,8 +1027,8 @@ test_expect_success GPG '-s implies annotated tag' ' test_cmp expect actual ' -test_expect_success GPG 'git tag -s implied if configured with tag.forcesignannotated' \ - 'get_tag_header forcesignannotated-implied-sign $commit commit $time >expect && +test_expect_success GPG 'git tag -s implied if configured with tag.forcesignannotated' ' + get_tag_header forcesignannotated-implied-sign $commit commit $time >expect && echo "A message" >>expect && echo "-----BEGIN PGP SIGNATURE-----" >>expect && test_config tag.forcesignannotated true && @@ -1026,15 +1037,15 @@ test_expect_success GPG 'git tag -s implied if configured with tag.forcesignanno test_cmp expect actual ' -test_expect_success GPG 'lightweight with no message when configured with tag.forcesignannotated' \ - 'test_config tag.forcesignannotated true && +test_expect_success GPG 'lightweight with no message when configured with tag.forcesignannotated' ' + test_config tag.forcesignannotated true && git tag forcesignannotated-lightweight && tag_exists forcesignannotated-lightweight && test_must_fail git tag -v forcesignannotated-no-message ' -test_expect_success GPG 'git tag -a disable configured tag.forcesignannotated' \ - 'get_tag_header forcesignannotated-annotate $commit commit $time >expect && +test_expect_success GPG 'git tag -a disable configured tag.forcesignannotated' ' + get_tag_header forcesignannotated-annotate $commit commit $time >expect && echo "A message" >>expect && test_config tag.forcesignannotated true && git tag -a -m "A message" forcesignannotated-annotate && @@ -1043,8 +1054,8 @@ test_expect_success GPG 'git tag -a disable configured tag.forcesignannotated' \ test_must_fail git tag -v forcesignannotated-annotate ' -test_expect_success GPG 'git tag --sign enable GPG sign' \ - 'get_tag_header forcesignannotated-disabled $commit commit $time >expect && +test_expect_success GPG 'git tag --sign enable GPG sign' ' + get_tag_header forcesignannotated-disabled $commit commit $time >expect && echo "A message" >>expect && echo "-----BEGIN PGP SIGNATURE-----" >>expect && test_config tag.forcesignannotated false && @@ -1053,8 +1064,8 @@ test_expect_success GPG 'git tag --sign enable GPG sign' \ test_cmp expect actual ' -test_expect_success GPG 'git tag configured tag.gpgsign enables GPG sign' \ - 'get_tag_header gpgsign-enabled $commit commit $time >expect && +test_expect_success GPG 'git tag configured tag.gpgsign enables GPG sign' ' + get_tag_header gpgsign-enabled $commit commit $time >expect && echo "A message" >>expect && echo "-----BEGIN PGP SIGNATURE-----" >>expect && test_config tag.gpgsign true && @@ -1063,8 +1074,8 @@ test_expect_success GPG 'git tag configured tag.gpgsign enables GPG sign' \ test_cmp expect actual ' -test_expect_success GPG 'git tag --no-sign configured tag.gpgsign skip GPG sign' \ - 'get_tag_header no-sign $commit commit $time >expect && +test_expect_success GPG 'git tag --no-sign configured tag.gpgsign skip GPG sign' ' + get_tag_header no-sign $commit commit $time >expect && echo "A message" >>expect && test_config tag.gpgsign true && git tag -a --no-sign -m "A message" no-sign && @@ -1079,11 +1090,13 @@ test_expect_success GPG 'trying to create a signed tag with non-existing -F file ! tag_exists nosigtag ' -test_expect_success GPG 'verifying a signed tag should succeed' \ - 'git tag -v signed-tag' +test_expect_success GPG 'verifying a signed tag should succeed' ' + git tag -v signed-tag +' -test_expect_success GPG 'verifying two signed tags in one command should succeed' \ - 'git tag -v signed-tag file-signed-tag' +test_expect_success GPG 'verifying two signed tags in one command should succeed' ' + git tag -v signed-tag file-signed-tag +' test_expect_success GPG 'verifying many signed and non-signed tags should fail' ' test_must_fail git tag -v signed-tag annotated-tag && @@ -1453,14 +1466,16 @@ test_expect_success GPG,RFC1991 'reediting a signed tag body omits signature' ' ' # try to sign with bad user.signingkey -test_expect_success GPG 'git tag -s fails if gpg is misconfigured (bad key)' \ - 'test_config user.signingkey BobTheMouse && - test_must_fail git tag -s -m tail tag-gpg-failure' +test_expect_success GPG 'git tag -s fails if gpg is misconfigured (bad key)' ' + test_config user.signingkey BobTheMouse && + test_must_fail git tag -s -m tail tag-gpg-failure +' # try to produce invalid signature -test_expect_success GPG 'git tag -s fails if gpg is misconfigured (bad signature format)' \ - 'test_config gpg.program echo && - test_must_fail git tag -s -m tail tag-gpg-failure' +test_expect_success GPG 'git tag -s fails if gpg is misconfigured (bad signature format)' ' + test_config gpg.program echo && + test_must_fail git tag -s -m tail tag-gpg-failure +' # try to produce invalid signature test_expect_success GPG 'git verifies tag is valid with double signature' ' @@ -1481,21 +1496,23 @@ test_expect_success GPG 'git verifies tag is valid with double signature' ' ' # try to sign with bad user.signingkey -test_expect_success GPGSM 'git tag -s fails if gpgsm is misconfigured (bad key)' \ - 'test_config user.signingkey BobTheMouse && - test_config gpg.format x509 && - test_must_fail git tag -s -m tail tag-gpg-failure' +test_expect_success GPGSM 'git tag -s fails if gpgsm is misconfigured (bad key)' ' + test_config user.signingkey BobTheMouse && + test_config gpg.format x509 && + test_must_fail git tag -s -m tail tag-gpg-failure +' # try to produce invalid signature -test_expect_success GPGSM 'git tag -s fails if gpgsm is misconfigured (bad signature format)' \ - 'test_config gpg.x509.program echo && - test_config gpg.format x509 && - test_must_fail git tag -s -m tail tag-gpg-failure' +test_expect_success GPGSM 'git tag -s fails if gpgsm is misconfigured (bad signature format)' ' + test_config gpg.x509.program echo && + test_config gpg.format x509 && + test_must_fail git tag -s -m tail tag-gpg-failure +' # try to verify without gpg: -test_expect_success GPG 'verify signed tag fails when public key is not present' \ - 'rm -rf gpghome && +test_expect_success GPG 'verify signed tag fails when public key is not present' ' + rm -rf gpghome && test_must_fail git tag -v signed-tag ' From patchwork Mon Aug 5 23:59:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AbdAlRahman Gad X-Patchwork-Id: 13754274 Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.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 42DF316F824 for ; Mon, 5 Aug 2024 23:59:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722902399; cv=none; b=An13kjVqecPz4aDM/8Gh6TvrjNA3JuXQ8/tpvTnLfTEnOeVZp6MWtShBSL51oQhRnOeXkqs9YbLb7KPcGyfLioebuNP4lCRqL3bnAbNT9u8ZMM8ujtnV6XwUWCcG62Mx/ofVnarkkciqiH/2K9N+wGrXSLsoPFpzBVhVu4ZDEF0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722902399; c=relaxed/simple; bh=tBDbdBNWBIEnsYUql9KLc64Ox2tPd3rxNefyVLXnRR4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DwPc/QVzej0H1liUQCSSrIrXEyH8n63Afa6f7h0B2RJZNJOJwB2AyL6zQGQqD+FQs6v09BSKY6bFtXLthcQI/CfGJPCsdSwmcggVtpOYlv7eVtfcpObOcuFbdCX6KtCb7jw6MrcqCngLgi6F3ZoShXu1k0s/5YYpcjJEtvag26c= 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=QZ17Py9L; arc=none smtp.client-ip=209.85.221.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="QZ17Py9L" Received: by mail-wr1-f45.google.com with SMTP id ffacd0b85a97d-3683329f787so6267017f8f.1 for ; Mon, 05 Aug 2024 16:59:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722902395; x=1723507195; 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=yM/HBqdzIvgUmVNjDkTW1BR+vB34fB2qe5Grt2ZpzmI=; b=QZ17Py9Lv6K7qO9lHUhWuucQ0j5ihpj9ex73UkaSwg4WgclLNbGr3s/dPskH7vZV/V WKuB+h4ZjYwmMbuf8qpvQNyA1KFbgkiF5dWpvtzZGR5PAC97lM1+gebz9Zc463dJVU9L ZSbdeWQ9vybujMY+izNNLoUF9Ge1FFx38Ie+nlmfTxR/rqY3Lgt85/mhF1wLstfk+sIU aEDmxFi+ptNFijK0kItb6S/RX3u/MqdTKMkLixAQNDqDHr0ehA8XZdaxjsCUnxijNHkc po43sdeUIPWz5LWkPPAFMIYYtDdbPt0XVXaRnir1FtT/Iq4VS0ehQV7NcjAIqBlqQRiR o07w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722902395; x=1723507195; 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=yM/HBqdzIvgUmVNjDkTW1BR+vB34fB2qe5Grt2ZpzmI=; b=cFBhvKpiH6xnlH4K0oXB30YamTds419VEb5fnHNLP62ta1nTjIwP9E+KwFsc3YT/VK wVYE3YFf7eLU9S6wOGY7AbgBJLySyIEmRxkW6zRsUbNiuJdR5Yepr3HvKPGBUWw1Od3c 0DRsR190TzWRvCM3UcHu4csmdzJFrY4K5ZUdwM8rmx/R/XbrmtZtQDOdj7I4IF1Evzyd vJXw21+7TqR7QmrPxz+b8zTLLX82LAiFueQgsWulTLST2fooKK1bXbWyQ74BeNfMMHGf JZJ8HYzTg5IOR91374vzAIq8JuusRkbAkXZx8ejGLYWXi+tRnEw1Jm6+GoCtkhNwAv7i oQJw== X-Gm-Message-State: AOJu0YzXDYwAKs6h8Q3vnmoFWHxK+qV+I2yB7VKw/3SS9jPTB0xRh4qX k2SiXYlzOeOjJd84k7mNceLR7ZI/Rvy31FtexFcFHxHMq3fhVreTqEVAbzXD X-Google-Smtp-Source: AGHT+IETvcnFVZL25A3PZ6U7rwsBaVcK9E9kKB7AbOo8EZ9qA1rH4IN5jF/Kg4aJYiH/kAlXhkZypw== X-Received: by 2002:a5d:5248:0:b0:368:319c:9a77 with SMTP id ffacd0b85a97d-36bbc0fff6cmr9069906f8f.29.1722902394844; Mon, 05 Aug 2024 16:59:54 -0700 (PDT) Received: from abdobngad.. ([197.40.47.44]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36bbd074583sm11219065f8f.108.2024.08.05.16.59.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Aug 2024 16:59:54 -0700 (PDT) From: AbdAlRahman Gad To: git@vger.kernel.org Cc: AbdAlRahman Gad Subject: [PATCH v4 8/8] [Newcomer] t7004: Use single quotes instead of double quotes Date: Tue, 6 Aug 2024 02:59:17 +0300 Message-ID: <20240805235917.190699-9-abdobngad@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240805235917.190699-1-abdobngad@gmail.com> References: <20240805235917.190699-1-abdobngad@gmail.com> Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Some test bodies and test description are surrounded with double quotes instead of single quotes, violating our coding style. Signed-off-by: AbdAlRahman Gad --- t/t7004-tag.sh | 70 +++++++++++++++++++++++++------------------------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh index a46f8141d4..06f07b5524 100755 --- a/t/t7004-tag.sh +++ b/t/t7004-tag.sh @@ -1585,7 +1585,7 @@ test_expect_success 'creating third commit without tag' ' # simple linear checks of --continue -test_expect_success 'checking that first commit is in all tags (hash)' " +test_expect_success 'checking that first commit is in all tags (hash)' ' hash3=$(git rev-parse HEAD) && cat >expected <<-\EOF && v0.2.1 @@ -1596,10 +1596,10 @@ test_expect_success 'checking that first commit is in all tags (hash)' " EOF git tag -l --contains $hash1 v* >actual && test_cmp expected actual -" +' # other ways of specifying the commit -test_expect_success 'checking that first commit is in all tags (tag)' " +test_expect_success 'checking that first commit is in all tags (tag)' ' cat >expected <<-\EOF && v0.2.1 v1.0 @@ -1609,9 +1609,9 @@ test_expect_success 'checking that first commit is in all tags (tag)' " EOF git tag -l --contains v1.0 v* >actual && test_cmp expected actual -" +' -test_expect_success 'checking that first commit is in all tags (relative)' " +test_expect_success 'checking that first commit is in all tags (relative)' ' cat >expected <<-\EOF && v0.2.1 v1.0 @@ -1621,33 +1621,33 @@ test_expect_success 'checking that first commit is in all tags (relative)' " EOF git tag -l --contains HEAD~2 v* >actual && test_cmp expected actual -" +' # All the --contains tests above, but with --no-contains -test_expect_success 'checking that first commit is not listed in any tag with --no-contains (hash)' " +test_expect_success 'checking that first commit is not listed in any tag with --no-contains (hash)' ' git tag -l --no-contains $hash1 v* >actual && test_must_be_empty actual -" +' -test_expect_success 'checking that first commit is in all tags (tag)' " +test_expect_success 'checking that first commit is in all tags (tag)' ' git tag -l --no-contains v1.0 v* >actual && test_must_be_empty actual -" +' -test_expect_success 'checking that first commit is in all tags (relative)' " +test_expect_success 'checking that first commit is in all tags (relative)' ' git tag -l --no-contains HEAD~2 v* >actual && test_must_be_empty actual -" +' -test_expect_success 'checking that second commit only has one tag' " +test_expect_success 'checking that second commit only has one tag' ' cat >expected <<-\EOF && v2.0 EOF git tag -l --contains $hash2 v* >actual && test_cmp expected actual -" +' -test_expect_success 'inverse of the last test, with --no-contains' " +test_expect_success 'inverse of the last test, with --no-contains' ' cat >expected <<-\EOF && v0.2.1 v1.0 @@ -1656,14 +1656,14 @@ test_expect_success 'inverse of the last test, with --no-contains' " EOF git tag -l --no-contains $hash2 v* >actual && test_cmp expected actual -" +' -test_expect_success 'checking that third commit has no tags' " +test_expect_success 'checking that third commit has no tags' ' git tag -l --contains $hash3 v* >actual && test_must_be_empty actual -" +' -test_expect_success 'conversely --no-contains on the third commit lists all tags' " +test_expect_success 'conversely --no-contains on the third commit lists all tags' ' cat >expected <<-\EOF && v0.2.1 v1.0 @@ -1673,7 +1673,7 @@ test_expect_success 'conversely --no-contains on the third commit lists all tags EOF git tag -l --no-contains $hash3 v* >actual && test_cmp expected actual -" +' # how about a simple merge? @@ -1694,7 +1694,7 @@ test_expect_success 'checking that branch head only has one tag' ' test_cmp expected actual ' -test_expect_success 'checking that branch head with --no-contains lists all but one tag' " +test_expect_success 'checking that branch head with --no-contains lists all but one tag' ' cat >expected <<-\EOF && v0.2.1 v1.0 @@ -1704,22 +1704,22 @@ test_expect_success 'checking that branch head with --no-contains lists all but EOF git tag -l --no-contains $hash4 v* >actual && test_cmp expected actual -" +' test_expect_success 'merging original branch into this branch' ' git merge --strategy=ours main && git tag v4.0 ' -test_expect_success 'checking that original branch head has one tag now' " +test_expect_success 'checking that original branch head has one tag now' ' cat >expected <<-\EOF && v4.0 EOF git tag -l --contains $hash3 v* >actual && test_cmp expected actual -" +' -test_expect_success 'checking that original branch head with --no-contains lists all but one tag now' " +test_expect_success 'checking that original branch head with --no-contains lists all but one tag now' ' cat >expected <<-\EOF && v0.2.1 v1.0 @@ -1730,9 +1730,9 @@ test_expect_success 'checking that original branch head with --no-contains lists EOF git tag -l --no-contains $hash3 v* >actual && test_cmp expected actual -" +' -test_expect_success 'checking that initial commit is in all tags' " +test_expect_success 'checking that initial commit is in all tags' ' cat >expected <<-\EOF && v0.2.1 v1.0 @@ -1744,7 +1744,7 @@ test_expect_success 'checking that initial commit is in all tags' " EOF git tag -l --contains $hash1 v* >actual && test_cmp expected actual -" +' test_expect_success 'checking that --contains can be used in non-list mode' ' cat >expected <<-\EOF && @@ -1760,10 +1760,10 @@ test_expect_success 'checking that --contains can be used in non-list mode' ' test_cmp expected actual ' -test_expect_success 'checking that initial commit is in all tags with --no-contains' " +test_expect_success 'checking that initial commit is in all tags with --no-contains' ' git tag -l --no-contains $hash1 v* >actual && test_must_be_empty actual -" +' # mixing modes and options: @@ -1800,16 +1800,16 @@ test_expect_success 'mixing incompatibles modes and options is forbidden' ' for option in --contains --with --no-contains --without --merged --no-merged --points-at do - test_expect_success "mixing incompatible modes with $option is forbidden" " + test_expect_success 'mixing incompatible modes with $option is forbidden' ' test_must_fail git tag -d $option HEAD && test_must_fail git tag -d $option HEAD some-tag && test_must_fail git tag -v $option HEAD - " - test_expect_success "Doing 'git tag --list-like $option is permitted" " + ' + test_expect_success 'Doing "git tag --list-like $option is permitted' ' git tag -n $option HEAD HEAD && git tag $option HEAD HEAD && git tag $option - " + ' done # check points-at @@ -2185,7 +2185,7 @@ test_expect_success 'git tag -l with --format="%(rest)" must fail' ' test_must_fail git tag -l --format="%(rest)" "v1*" ' -test_expect_success "set up color tests" ' +test_expect_success 'set up color tests' ' echo "v1.0" >expect.color && echo "v1.0" >expect.bare && color_args="--format=%(color:red)%(refname:short) --list v1.0"