From patchwork Sun Aug 4 07:11:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AbdAlRahman Gad X-Patchwork-Id: 13752494 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (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 95D73101F2 for ; Sun, 4 Aug 2024 07:12:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722755547; cv=none; b=RVv0m+UV9qAP1IIvwLrvQrfQ+rqCe+picSRQrhVVBlAHsCbJgKUefwhc/EE6oPvzdaTnfYckY33lzNOmENlR/D3VXNSKCto/JueKG2dZB8LuRlJ6n5KIuVl5hbfWeu5RLuvdtCGCrHlGGuvti0Wtv0pUOD1IplqqcPufZGVFc4o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722755547; c=relaxed/simple; bh=zFt/5mqToZnJZvy+0xBTzq0ezWUrhKqpuN0rexFWx/4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=NDxzVhD9N5l++5TO9Bn9++U5Qa01EJyDQ+sIYoSLYbbPusLqIiAGZvmChwIqcAJa8gJBhHKJJB0ss0Yj72fQ7ndrZZKr/TI+MKFLVwEUXGIizHhMSr/mqF0n5vL7cXyB7pPg5InqsNk1HAKx/ucExSMGzsM4YiwUPawRf/dklRA= 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=GjesuFW0; arc=none smtp.client-ip=209.85.128.49 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="GjesuFW0" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-42816ca782dso63619265e9.2 for ; Sun, 04 Aug 2024 00:12:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722755544; x=1723360344; 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=U0oYkeQQovup8wxTSrg5Vch/rRizoqMurx0BKkimlug=; b=GjesuFW0A0B080OfPxji3Ox2hSq4ikg8ITfbqzHNv5lM2Eon0tuAJdvJvIAPMDqKKt wQjS3NgAMFor8xzNcJP89g7wiD+/4aPDYsmVnZDBEhmNpUFOhMJ+4lgcu/Bfrx/2yUZn /k9Sn1CrwNM9U4PPGLM0htzsVSILfNVEfXtNaJJigvSod2rMGcOPB74EDxqv1wdKxs0N GgTe1dvkcC2erGZrcYbnwpgPI0cSVgdhmuxuDGoDOg6LCIOomCNKbq4o6u95LF2Rj9rs uOcK3jRAJ20NhNtQnE5zvedQAxlIJp/R+Ui3CIpmCe02ahyeGKtl56zTIQvAJMoHMceU iBwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722755544; x=1723360344; 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=U0oYkeQQovup8wxTSrg5Vch/rRizoqMurx0BKkimlug=; b=etc8a9/tq/2uTx6Lpx9wXF/9DTpAc/ZicI6NZlDBsfvxaFMShUxZu4ommfs6H13YLQ 34qmB4aUY5dNfXEUS2xsGjBz46gUltRBjNJ2RiZB8algmzgnqKoQuogO7wFMKrtkMfGK o25vRmMDiZjyKUmeWwxfclIdPOmlP9qdwsnvki4PS1LCPK/x7dar4a650G6vd1EppjMS yuqJ29pnpfD+yi+aARVLBWJ5XjLaQThyCeQWTLz/S82wZknmiPg2Y9gdWlVewBVPHMHu Yiv0juzKCS9lZF7N7Xr6s7/0xkDoqDrXmNa6FYnWwmJ0wC7H/CbjZwUVmzS2qeqd/9Ga mhgA== X-Gm-Message-State: AOJu0YyPn4GghBlfuGslqlZ+BPhs/g40Sbs8/ndD/R1JnkXVFD9ApRnw zfOMKK/XZa2vtUj2vePgrBEfHrsb7jAmXyU+OK/eBrGMqOgxx4WL2jS5p8pfs70= X-Google-Smtp-Source: AGHT+IFSj+AgpcraFVZv54nhSnDFfQUEbNv8AgJBLDYBXYnzuxRWROuyd4vdMpahMtr7froGWu1ADg== X-Received: by 2002:a05:600c:4ed0:b0:428:2e9:65a9 with SMTP id 5b1f17b1804b1-428e6b7c5afmr53202845e9.28.1722755543496; Sun, 04 Aug 2024 00:12:23 -0700 (PDT) Received: from abdobngad.. ([197.40.96.43]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-428e6e3c0b7sm88477595e9.23.2024.08.04.00.12.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Aug 2024 00:12:23 -0700 (PDT) From: AbdAlRahman Gad To: git@vger.kernel.org Cc: AbdAlRahman Gad Subject: [PATCH v3 1/6] [Newcomer] t7004-tag: redirection operator Date: Sun, 4 Aug 2024 10:11:32 +0300 Message-ID: <20240804071137.30326-2-abdobngad@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240804071137.30326-1-abdobngad@gmail.com> References: <20240804071137.30326-1-abdobngad@gmail.com> Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Modernaize 't7004-tag.sh' by removing whitespace after the 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: 13752495 Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 69B43134A0 for ; Sun, 4 Aug 2024 07:12:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722755548; cv=none; b=TX5dbhM9cOJcivLdIH0kvsh1SkooORkRIXqc4cFXIRZq4nN19MNR8O17quvrrBYJAMdVvcpKD0DtnbzYfWtDcUqT5ScVHWc9wDnteV7qYpwb5fSLT5uuLnjOKvEo87jWHp7P0IVXqz1evi3x9iTy4J33/5BluXH6jsNsOcxOY7M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722755548; c=relaxed/simple; bh=7hmr9wL+NtllH0aGn10QJlVDUh8xsdj+NmpiKndMhHo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=immiAL6Qfe/ObMZTy+JuQg+ict3GXeG0GWyd0eE/GDTXB5mP4zr97Xk5i07A/EmdVHvv+y4tqkZRuSDFwGPvUQg/7WmB/AgGwdkcsbHKzELq6s8JeQqrneJzb8VMSEIR02N+hzxbKoSEba4et0Uksfu+cz1y4cR57/Bcl340ErU= 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=h3G399LK; arc=none smtp.client-ip=209.85.128.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="h3G399LK" Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-42808071810so64487355e9.1 for ; Sun, 04 Aug 2024 00:12:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722755544; x=1723360344; 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=bfawsjzsokzRLighIN3rPJT01us+vz5HIg83Gjw/5Xk=; b=h3G399LKLQXPpM3OPnkFiN6QEv+NKSRq3cM+m9I+R1sZBqO17BkrE+5NQOMpMIqOZ+ gfkPjDbcaehrU88dD3nxzbVN0FrOi8EXXs5MyAF8/sURxkm6en/uijZibX+n7BcNFn8d DyxCcNaQLOlocfbKxvlvsUrlDk0/Emq0wDtP7wfXMks7drr+A0bPcR2RClI/J76lqLjU BK9ezChvkg9buGVLlLEc1hZ+5wMeXlTcKDkPYfifeS5KlByTqgOROHFQuvgKRubaTfhN xpfulmkhajJgukm6gofr9jvEFHT7T+KrHCs0KBCMuuguxnJ67COli/dM3o80WIihIFKE BoGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722755544; x=1723360344; 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=bfawsjzsokzRLighIN3rPJT01us+vz5HIg83Gjw/5Xk=; b=hfa/Sh5PgUFKeIBqKe+JvdnWCk1LICi9YEdSioIi8RiBzKUx5+Vy2x+RQ8x+vbz6Jn tsccfe+41vIDRkluuzN6FzYK2vdSkAzvrorPvioCGyRs1d2bS7cOk12k6MCvlSahk7jy x0wl6q8isbms4lgc8E87Ld9CIMwUztuIQ4NONhr+pqFHLcENl7WyKJK637zi7UC8tErP jsPxlTw4lt1Qnk16k86PeC+xKsIQuXhVB5HWd2O6Qm68C62eEM1VBf8uRikf1Y7uj71N FTgsRuhwPTZDFNMfw5CTZdQ6QH+hSWXACE6AeRbpdvq5bUwWh4fqkVedzYglogZjL/yZ hxUQ== X-Gm-Message-State: AOJu0YwHUCMY2u5kOAI7oaaaLSOXR8Kam5rcBLlyJ3VEe6hQN2bn30mV Ks6lTOhb09VkxxaZ3W0tc8DHja0Lr+a8bfAhcHDviPXr/x/zwJRuY3kXXWth/Tk= X-Google-Smtp-Source: AGHT+IHZ55va5sy5BSxPsGJTc3WbNq108sunVC9ppVRbHXrS45DyAJvvM/X45C3TglryTzqr3Vxh2w== X-Received: by 2002:a05:600c:1f86:b0:428:1e8c:ff75 with SMTP id 5b1f17b1804b1-428e6b93fd6mr46328645e9.35.1722755544422; Sun, 04 Aug 2024 00:12:24 -0700 (PDT) Received: from abdobngad.. ([197.40.96.43]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-428e6e3c0b7sm88477595e9.23.2024.08.04.00.12.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Aug 2024 00:12:24 -0700 (PDT) From: AbdAlRahman Gad To: git@vger.kernel.org Cc: AbdAlRahman Gad Subject: [PATCH v3 2/6] [Newcomer] t7004-tag: do not lose exit status to pipe Date: Sun, 4 Aug 2024 10:11:33 +0300 Message-ID: <20240804071137.30326-3-abdobngad@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240804071137.30326-1-abdobngad@gmail.com> References: <20240804071137.30326-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 Sun Aug 4 07:11:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AbdAlRahman Gad X-Patchwork-Id: 13752496 Received: from mail-lj1-f177.google.com (mail-lj1-f177.google.com [209.85.208.177]) (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 E45C917C8B for ; Sun, 4 Aug 2024 07:12:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722755549; cv=none; b=Y3NjqFUnDZvJU2T+UTO38OMXfP4oc3nfgoi/DmZ4S8mVUJbagIsJ7QcZ6GQLqa9PJMlIqHl+Z58q8qAZTH0x6N25pYam07bQMeeTZhF8OUwasrkuAugqCJ556ZKwy6egEhW1UIIV3+qmWotNBqLE+SEXSNXHRxlEEREKj/+hTGs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722755549; c=relaxed/simple; bh=O80OWEFy/gRxqTYSAWRl36e/wy393PuuJng9bY62Heg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Rix5LanaunmLgIpM1F0aVMPjfM3ANuFD3DXSeGxIxWgGaqWiJ86Oneywsb/BZA8vNGtL0Zjo7NqTU5j60mlE9645Ddhn9Q9XPQ9fLW0eqDdITqIGgklrZwPwUJcROJyLkKFijh1KcmUmXadSFMn2455gG9WcqxC72Mfp/fIgHlM= 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=CHI/slWf; arc=none smtp.client-ip=209.85.208.177 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="CHI/slWf" Received: by mail-lj1-f177.google.com with SMTP id 38308e7fff4ca-2ef23d04541so108636111fa.2 for ; Sun, 04 Aug 2024 00:12:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722755546; x=1723360346; 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=t3jbrDza7f4qi2NyP/CznSHTutp14CJPJ3DFSkcS+AM=; b=CHI/slWfyf8cwraVWVl0cNMedwLivAkxbsbIUuQ36BH1DRWTtTyDz5xFjz5oVKgIBP AzUyXfpabQo7Bo7U7sR3pQFCFHUp9FO8KH6Iival5SJYPniM99liff2HWF2O50OBnKGv 1+Yz0RIhe6JvloOllDP5iKPQ1B5a/gwbBQ/wv9vK8PKcyVixYmDMw676/l+dYYO6Fk51 vnf//4oZPbpaHpg1HkHaLAB/Muqm5N3nu0gtzCzVSYoTcx/FC4aI6l5xgKpjhjTbuPel wRGQ/JDl/knfk3ZG7NePO5mkX0on8DnJpyTWstYua5GZLe/bXTB2n/JCzcuNkX/LtfY+ fiOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722755546; x=1723360346; 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=t3jbrDza7f4qi2NyP/CznSHTutp14CJPJ3DFSkcS+AM=; b=SezGntleT1H8bI1vOAbbI8c/2artecgUJCeeor7fcqKSTUUcdHSrnMqBUqH1V0utPf LtMSKvE0VhWqcqlMJjj0js8xYwSmBSF03vikW3ohlDHEvtOYPOcxYvg/wucv/I7c+CNJ cZsNFmI7UeMq+IavpYDjrl2KZai0JPhSan4Po/x2irj0vWg4dGWDhKtM6c+Tvb2TUA4w NJpYhBM/e7pT6UwrVB3bD9tQgdwORbWPuwl4Cq4m4D2DvMULwy3XAn8CKFBiBh4LUjTq e0GBAvlp6yC885nIrICbPLf8byGkxT7CenZa8NgDolZw+geCFROYVQNECjEveajCCPqO GVvw== X-Gm-Message-State: AOJu0YzfvxYCd8mEXNxuhHN36VOxDPerMF5KI7prK8HLm590Nb0syaO/ bjO6M+xCA10qQZWc8ki7LNi0QI3NUVCkscpmbzs5nPZbttTqLt1XkiFVYtO0aIQ= X-Google-Smtp-Source: AGHT+IHZAHJ0Qgwas6xBGRGv/uOgfTyjyy0HIAX4xWX3IXIg+QjedbjttY718LwHLSzRbR757asrUw== X-Received: by 2002:a2e:985a:0:b0:2ef:20ae:d116 with SMTP id 38308e7fff4ca-2f15aa026d3mr50937931fa.0.1722755545261; Sun, 04 Aug 2024 00:12:25 -0700 (PDT) Received: from abdobngad.. ([197.40.96.43]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-428e6e3c0b7sm88477595e9.23.2024.08.04.00.12.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Aug 2024 00:12:25 -0700 (PDT) From: AbdAlRahman Gad To: git@vger.kernel.org Cc: AbdAlRahman Gad Subject: [PATCH v3 3/6] [Newcomer] t7004-tag: one command per line Date: Sun, 4 Aug 2024 10:11:34 +0300 Message-ID: <20240804071137.30326-4-abdobngad@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240804071137.30326-1-abdobngad@gmail.com> References: <20240804071137.30326-1-abdobngad@gmail.com> Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 fix lines like these: git tag -l >actual && test_cmp expect actual && to git tag -l >actual && test_cmp expect actual && 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 Sun Aug 4 07:11:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AbdAlRahman Gad X-Patchwork-Id: 13752497 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 E3DED17C68 for ; Sun, 4 Aug 2024 07:12:27 +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=1722755549; cv=none; b=bBzBFo5EyKx7bIhncrCyisbfxeKWY5RdRfXkcvPOVNPjdgqadB4fAYoD7p+cGX5luTMKqtFO8TYa9Z7RCI9RMlxLKx32ajLWNVjtjMfqR52xICRqwFZe9RYDdJPaxuSjAHwsreF2AYH7uHG30jHru+gkQC+8aieK51UwWGJAqkA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722755549; c=relaxed/simple; bh=lPEGYsM4r9B/DDS2ryUgXtidzkDKslVbk5n1QHekN/o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=H6GaWWQWd7oX8e+e1X2bLuHwrVCTH7QloghfCqhpBTQ/2Dlu1/fwIANWVmu08TYIsrLBO1wQx2F26HYl6xno5kCdupoQnwrg4Dnos16lNiE3Xz3AYX3Yw0h82HK5StnX+Oji9DbE3C+u2TqD2967k6aT/AyerQh/ULEiNcHyYmg= 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=XwDqJ4J+; 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="XwDqJ4J+" Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-428119da952so61930785e9.0 for ; Sun, 04 Aug 2024 00:12:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722755546; x=1723360346; 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=hN+iBjdl5VgJ+EDLodIxjuEzgYb5lXYzOh+5XxEOW2k=; b=XwDqJ4J+2m5kDmazzJZ8cnyBeb0vxAao6n1zY1BIVgZFpvjaEmqMkNCM01+D5SG1i9 EB6A9Zm6C3nYUS3l/fVc13qIUvq7IUqztIUl7drVlONs+qej8V3x5y7x3g6cqYkHHEK7 nI6g8pS/NJyg1Nb0PjcUgw4Jei6UwGdUeBcyRM70tzQn+T6CxiVddJ//s3mbjLwv5FQx tTNRe6zpcf4pRke6IUfkDs14SSfOn1NlInvriGWtI4GuHzJmuIbPEEzpGMpr0RpA7x+k RbHl3Wz8a2ofwFTZOn4ezzUYDpnJp40vcYOHeDWr0lrISzJ3Ew9XHSZTknYI78+Lxvxk 00OQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722755546; x=1723360346; 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=hN+iBjdl5VgJ+EDLodIxjuEzgYb5lXYzOh+5XxEOW2k=; b=vSXIVhlL/OeI8iC3rjiCwX2ENJA/F5kvhJIPTCZtI1ux0XctXKpgRuJJMbgePJ4jm4 S2wPvUe4AyOFawsxruCZ6GXup3yJ2/emuVAI3SsVPZp4tFab24ZU92SCjsHB2wcHugWP BCivKgmprTHZHbba6sBIYK4z7F8EwD2ZEMYHlr6Qw9UgaZVjq7kS0ObsDelRu1FaPtPi WGaCi7blZiXYEQrKO+MXrCRj2dhD07S/Yqat2WvqprQydsu63rs6VPR/Bl2hniD5L+WT Y3cvjYWlqvW1WujW5zDv3pEoOVB/rnt7SnR8v0b0t/rPV1V0pv4XM5OcDafI+EXLx01i 267w== X-Gm-Message-State: AOJu0YxWKaAOdC+xbSHBt+ym0By8OzctgG4AJKL7e84NygqefBkWBOkm G8uZUqnvyfmHeQ361eRDNcjFdKatnduo0Iqzml4Ttx8wJ34ztLsM/QWdm4LOwr8= X-Google-Smtp-Source: AGHT+IEw8k17kuipSL8vMbbSgDRfmc1U8uAhaBJjtFmNcyu8vichIP2OmrRyfnPQeQmqEWdbewXNcQ== X-Received: by 2002:a05:600c:5489:b0:428:1965:450d with SMTP id 5b1f17b1804b1-428e6b2f279mr56485265e9.17.1722755545970; Sun, 04 Aug 2024 00:12:25 -0700 (PDT) Received: from abdobngad.. ([197.40.96.43]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-428e6e3c0b7sm88477595e9.23.2024.08.04.00.12.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Aug 2024 00:12:25 -0700 (PDT) From: AbdAlRahman Gad To: git@vger.kernel.org Cc: AbdAlRahman Gad Subject: [PATCH v3 4/6] [Newcomer] t7004-tag: do not prepare except outside test_expect_success Date: Sun, 4 Aug 2024 10:11:35 +0300 Message-ID: <20240804071137.30326-5-abdobngad@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240804071137.30326-1-abdobngad@gmail.com> References: <20240804071137.30326-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 outside test_expect_success Signed-off-by: AbdAlRahman Gad --- t/t7004-tag.sh | 224 +++++++++++++++++++++++++++---------------------- 1 file changed, 123 insertions(+), 101 deletions(-) diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh index cfe7653317..96aa908eaf 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 ' @@ -1683,23 +1695,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 +1719,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 " @@ -1734,24 +1743,22 @@ test_expect_success 'creating simple branch' ' 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,50 +1768,65 @@ 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 ' test_expect_success 'checking that initial commit is in all tags with --no-contains' " + cat >expected <<-\EOF && + v0.2.1 + v1.0 + v1.0.1 + v1.1.3 + v2.0 + v3.0 + v4.0 + EOF git tag -l --no-contains $hash1 v* >actual && test_must_be_empty actual " From patchwork Sun Aug 4 07:11:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AbdAlRahman Gad X-Patchwork-Id: 13752498 Received: from mail-lj1-f170.google.com (mail-lj1-f170.google.com [209.85.208.170]) (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 DA80918C31 for ; Sun, 4 Aug 2024 07:12:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722755550; cv=none; b=uQaixLpsVLXRbIMwP5BOcjkYmI07QZ/WFHiicYBbkbYdLeysK3/eohi/edqmbGtJu6OK3JiJ+0CuavpMH1fqGp62XjQ6Q5aGTbE/7647KpdYI0smHwvR3+uv2kMCtMbjEZlfWWPyRHwfu+P3BN2pK1E7ueAM52pnEc1fg4wr3o8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722755550; c=relaxed/simple; bh=FIc7u7PSsd+p+82+8PYzQcxeYsciFYXr2gqaBleH2kI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=IdtjKr35fVvSpvw7pBajZEhH1+VFr4ha+s/bcx2QnOLJd5zI0g+/GHZOKLcFZy4jreR3zUZpFW14JyYtksOzowG5rXkZr9gYo2UwtnyZHaWcsYdqoDgMRbS/uA/rm7qa5tLsqpuSjdDIU7njNAy0bWJP05S/GeTPQlrxeDYbXw4= 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=mRXbYDUW; arc=none smtp.client-ip=209.85.208.170 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="mRXbYDUW" Received: by mail-lj1-f170.google.com with SMTP id 38308e7fff4ca-2f035ae0fe0so109097061fa.3 for ; Sun, 04 Aug 2024 00:12:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722755547; x=1723360347; 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=Qo1R8BdgvI9wUEpxG3oBxTMVnqqDYE+Qdl1PcKH0/xc=; b=mRXbYDUW0c2VlLgAJ4tAqSVq0+e0nZuZ59epKgFmWO3n8PPEE0jhEG/kFGCMwN+1f8 LsYsRzJ2JoRBUCFxHsXgEqnv5S6SHNLc5zB/QkBCuDV1gYuTE114mZ4KjLBO9dgRh44L FTg3hdRVgh5u75pclOs1WtfFP+l3qC6HqZ1BMnrdFCtGBpCrZy37QoJKpPYufiYTGQOq NqQvmsqfRljxjUmM03p7pUcslGkX2Kaw7hJpR4HuZ1fKmj3+GWzof/Dbe+s806MLRNPO lu8lWCdVgosQsPJNJ5eZNgNntt6dKwi7KLCmxwGKprffBEu52eTWAqiQ0yrddI1y/2Dy Lp1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722755547; x=1723360347; 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=Qo1R8BdgvI9wUEpxG3oBxTMVnqqDYE+Qdl1PcKH0/xc=; b=VPX4oJI73OVsTv4awqATxhovBak7OlHhXF7Wp2Z3HIzQ4SXqJEN/T6bhhwSHgd7K3A 7ufIfMNDnu9giN2qR01F/GsVh0tRfjxy+Y2EyeZZQkghRAYQJE+DqkViw4Fo9n7OPdfw wUtCRjqv/o8y0+rejtRGzcRh1/8YGrhBQCi72wUg07U7vy1gE9PhjWU0PUYn/jqQsEmW gLqhDrfK2aUNHUL8ALr7bBJqjTG8JCqMkSgPcfDMK5Qg2OMGvwFExZbUX22LuWvp6l9d whlM/PwgWy4m1CBcUUxGRF1vtaT5ygdq9OtbITaGUzJBlZsShUcYoRxg2mL+vNfC5kki oQrQ== X-Gm-Message-State: AOJu0YzclVCH5l5/LRjYR5ZQ/HQfEzsGr8GWiaOhS9KnSlAke8O6DZFu AUpGWDw9qk+pTCVM6U8hV0GjXDSDRYrcCsJ3SMUVlsyNxxInkC+sa9phXRw6t4I= X-Google-Smtp-Source: AGHT+IE95rCc8WTiMQOaGNGegRMYKlOC5d12XKImvsM8O8Y3yWIbcDiiagLTSbvqvi9XHM+P98xT7A== X-Received: by 2002:a2e:979a:0:b0:2ef:2b53:c785 with SMTP id 38308e7fff4ca-2f15ab35233mr52075661fa.41.1722755546619; Sun, 04 Aug 2024 00:12:26 -0700 (PDT) Received: from abdobngad.. ([197.40.96.43]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-428e6e3c0b7sm88477595e9.23.2024.08.04.00.12.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Aug 2024 00:12:26 -0700 (PDT) From: AbdAlRahman Gad To: git@vger.kernel.org Cc: AbdAlRahman Gad Subject: [PATCH v3 5/6] [Newcomer] t7004-tag: here-doc modernization Date: Sun, 4 Aug 2024 10:11:36 +0300 Message-ID: <20240804071137.30326-6-abdobngad@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240804071137.30326-1-abdobngad@gmail.com> References: <20240804071137.30326-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 to indent 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 96aa908eaf..c60167d6fd 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 Sun Aug 4 07:11:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AbdAlRahman Gad X-Patchwork-Id: 13752499 Received: from mail-lj1-f172.google.com (mail-lj1-f172.google.com [209.85.208.172]) (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 56FCC1B7FD for ; Sun, 4 Aug 2024 07:12:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722755553; cv=none; b=DAJCg7x3OsWvfv4vdph/uVjrtvnXPKVrXUXtO2tJlO85jxptUuVL5IOW/I5KHaL6lDxpHnrA93l6NqylMa8iTu5rGCveCk+yavvOtWoiJPqH+RlPuFFxQiCa7YlW9i/RCS6CutrZ5qR7bRz/XZMAa8dWjAdmXb/ReB5UCn1y9gY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722755553; c=relaxed/simple; bh=2jKAO/KOrqrQkjHh/m2kX+WJDHiM0a2frExzigIyjFE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=R3M/kXHVW3B0S5Q8KJ5WPOydt1TOCOw0rZHw9j3XMlp79qcTdwZxlGSQp2fAM/kNcB3FrWQLCb8TsK7DEVss2sTD0ixyZWfpGPRd4g5WYGW5dMKKO0b8XvswjZFVOirOIigBN7vibXUFmEDl1MiRQM9NWYGN4gCvImd/GvQoRmM= 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=ZQhXsp9v; arc=none smtp.client-ip=209.85.208.172 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="ZQhXsp9v" Received: by mail-lj1-f172.google.com with SMTP id 38308e7fff4ca-2eeb1ba0468so140706151fa.0 for ; Sun, 04 Aug 2024 00:12:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722755548; x=1723360348; 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=LjPFWLuKuOAmzNQqQ5ZLKiAME4VcA7lEyje+Ub7PAUA=; b=ZQhXsp9v5fXN+uPppKZw0z0/WDMk7u3ZV6M9DwbgjoM/nCgIELbfMI6pxETK33oHdT K7BLm7HiJlNSvgnYNPlFMJ4uP8Bwad912ZPd6dyizr3yvHOOuOC+umeO/JvjaZVfrlY8 oVdUXk7wVZNrr8BLcY2V6Ad2Vzg/kreBZuaYyepN1QMu5eEQwoBKN4G41XePegL0m0Q1 H+XNCidRjWSxtHHWwy7WxM/3YrxCJIUotRziMp4rhWiI3cPIUdN7gyX/kfp4QEE2Xo+Q DiL2ZSOe0m5WC3zstVfSuSHsMyphqYciIadrGaKSMgH5Z/Tpw17c4TjQbJ2ot+GkIof9 zmVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722755548; x=1723360348; 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=LjPFWLuKuOAmzNQqQ5ZLKiAME4VcA7lEyje+Ub7PAUA=; b=hzJ8rZAuOujAWFlRceL7E+5AlT8jkIpgWNiuSmgQFgrms7gw1ebyxcarIWg7ueCDPU kqp2fLlK/DTN+W+cw1SgHlEScuE72e7tNY4pRUzqC0JnQprJa1NLo4dlJjv7jvZY3dsw GBnzlFnos1q5kDCujNYX9xHfJ7Yomx1oaU4BHxAK7PC/XI9nGUoLnCGJPMtG/XDK6NWk idVI6gOX5WEYp4P2Pxoc3o2G4brLbfgLFNcLVwS0qXk8HIhK/arDg0XfeE5q/IeqgDJB SwhIA6e7+RvfLM3FsVlyYDdTFnhHtTOUVpMu1MMNAwYFjrMzm4PuuYm4YsGRm8CffUeo cgjQ== X-Gm-Message-State: AOJu0YyxI1JQ/SShC8Bs9IhuhhHesyRho59t03qtmrkNFuScmogK0Lqy m2Z1Q+MMJPWlwpFZi6JilYceNXSzWWqGrRfjz+eD50LCPNNhlsB6d9svdShXnSI= X-Google-Smtp-Source: AGHT+IGDMokQM2/f3uXu2pL1OGzrrCIktEyZD8IC1lE7CR+zivpt4GS/WpF+OZfEAXeFVz1ODng77A== X-Received: by 2002:a2e:9344:0:b0:2ef:2272:177f with SMTP id 38308e7fff4ca-2f15ab237d9mr52377251fa.34.1722755547697; Sun, 04 Aug 2024 00:12:27 -0700 (PDT) Received: from abdobngad.. ([197.40.96.43]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-428e6e3c0b7sm88477595e9.23.2024.08.04.00.12.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Aug 2024 00:12:27 -0700 (PDT) From: AbdAlRahman Gad To: git@vger.kernel.org Cc: AbdAlRahman Gad Subject: [PATCH v3 6/6] [Newcomer] t7004-tag: description on the same line as test_expect_success Date: Sun, 4 Aug 2024 10:11:37 +0300 Message-ID: <20240804071137.30326-7-abdobngad@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240804071137.30326-1-abdobngad@gmail.com> References: <20240804071137.30326-1-abdobngad@gmail.com> Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 changed test_expect_success that are seperated from its name like: test_expect_success \ 'trying to delete tags without params ....' ' test_expect_success GPG \ 'trying to verify an annotated ....' ' to test_expect_success 'trying to delete tags without params ....' ' test_expect_success GPG 'trying to verify an annotated.... ' ' Signed-off-by: AbdAlRahman Gad --- t/t7004-tag.sh | 280 +++++++++++++++++++------------------------------ 1 file changed, 109 insertions(+), 171 deletions(-) diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh index c60167d6fd..c7674c9241 100755 --- a/t/t7004-tag.sh +++ b/t/t7004-tag.sh @@ -156,26 +156,25 @@ 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 $(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_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 +208,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 +220,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 +228,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 +274,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 +285,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 +294,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 +303,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 +311,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 +319,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 +328,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,23 +417,23 @@ 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) ' -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: @@ -470,8 +457,7 @@ 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' ' +test_expect_success 'creating an annotated tag with -m message should succeed' ' git tag -m "A message" annotated-tag && get_tag_msg annotated-tag >actual && test_cmp expect actual @@ -485,8 +471,7 @@ test_expect_success 'set up editor' ' mv "$1-" "$1" 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' ' GIT_EDITOR=./fakeeditor git tag -m "A message" --edit annotated-tag-edit && get_tag_msg annotated-tag-edit >actual && test_cmp expect actual @@ -498,8 +483,7 @@ in a file. EOF get_tag_header file-annotated-tag $commit commit $time >expect cat msgfile >>expect -test_expect_success \ - 'creating an annotated tag with -F messagefile should succeed' ' +test_expect_success 'creating an annotated tag with -F messagefile should succeed' ' git tag -F msgfile file-annotated-tag && get_tag_msg file-annotated-tag >actual && test_cmp expect actual @@ -513,8 +497,7 @@ test_expect_success 'set up editor' ' mv "$1-" "$1" 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' ' GIT_EDITOR=./fakeeditor git tag -F msgfile --edit file-annotated-tag-edit && get_tag_msg file-annotated-tag-edit >actual && test_cmp expect actual @@ -532,16 +515,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,8 +537,7 @@ 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' ' +test_expect_success 'creating a tag with an empty -m message should succeed' ' git tag -m "" empty-annotated-tag && get_tag_msg empty-annotated-tag >actual && test_cmp expect actual @@ -565,8 +545,7 @@ test_expect_success \ >emptyfile get_tag_header emptyfile-annotated-tag $commit commit $time >expect -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' ' git tag -F emptyfile emptyfile-annotated-tag && get_tag_msg emptyfile-annotated-tag >actual && test_cmp expect actual @@ -586,16 +565,14 @@ Trailing spaces Trailing blank lines EOF -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' ' 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' ' +test_expect_success 'creating a tag with blank -m message with spaces should succeed' ' git tag -m " " blank-annotated-tag && get_tag_msg blank-annotated-tag >actual && test_cmp expect actual @@ -605,8 +582,7 @@ 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' ' +test_expect_success 'creating a tag with blank -F messagefile with spaces should succeed' ' git tag -F blankfile blankfile-annotated-tag && get_tag_msg blankfile-annotated-tag >actual && test_cmp expect actual @@ -614,8 +590,7 @@ test_expect_success \ 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' ' +test_expect_success 'creating a tag with -F file of spaces and no newline should succeed' ' git tag -F blanknonlfile blanknonlfile-annotated-tag && get_tag_msg blanknonlfile-annotated-tag >actual && test_cmp expect actual @@ -649,16 +624,14 @@ Another line. Last line. EOF -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' ' 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' ' +test_expect_success 'creating a tag with a #comment in the -m message should succeed' ' git tag -m "#comment" comment-annotated-tag && get_tag_msg comment-annotated-tag >actual && test_cmp expect actual @@ -668,8 +641,7 @@ 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' ' +test_expect_success 'creating a tag with #comments in the -F messagefile should succeed' ' git tag -F commentfile commentfile-annotated-tag && get_tag_msg commentfile-annotated-tag >actual && test_cmp expect actual @@ -677,8 +649,7 @@ test_expect_success \ 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' ' +test_expect_success 'creating a tag with a file of #comment and no newline should succeed' ' git tag -F commentnonlfile commentnonlfile-annotated-tag && get_tag_msg commentnonlfile-annotated-tag >actual && test_cmp expect actual @@ -795,8 +766,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 && @@ -835,8 +805,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 && @@ -863,8 +832,7 @@ test_expect_success \ 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' ' +test_expect_success 'listing many message lines of a non-signed tag should succeed' ' git tag -F annotagmsg tag-lines && echo "tag-lines" >expect && @@ -952,20 +920,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 ' @@ -1029,8 +994,7 @@ EOF get_tag_header file-signed-tag $commit commit $time >expect cat sigmsgfile >>expect echo '-----BEGIN PGP SIGNATURE-----' >>expect -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' ' git tag -s -F sigmsgfile file-signed-tag && get_tag_msg file-signed-tag >actual && test_cmp expect actual @@ -1061,17 +1025,15 @@ test_expect_success GPG '-s implies annotated tag' ' 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 && +test_expect_success GPG 'git tag -s implied if configured with tag.forcesignannotated' ' + test_config tag.forcesignannotated true && git tag -m "A message" forcesignannotated-implied-sign && get_tag_msg forcesignannotated-implied-sign >actual && 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 @@ -1079,9 +1041,8 @@ test_expect_success GPG \ 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 && +test_expect_success GPG 'git tag -a disable configured tag.forcesignannotated' ' + test_config tag.forcesignannotated true && git tag -a -m "A message" forcesignannotated-annotate && get_tag_msg forcesignannotated-annotate >actual && test_cmp expect actual && @@ -1091,9 +1052,8 @@ test_expect_success GPG \ 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 && +test_expect_success GPG 'git tag --sign enable GPG sign' ' + test_config tag.forcesignannotated false && git tag --sign -m "A message" forcesignannotated-disabled && get_tag_msg forcesignannotated-disabled >actual && test_cmp expect actual @@ -1102,9 +1062,8 @@ test_expect_success GPG \ 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 && +test_expect_success GPG 'git tag configured tag.gpgsign enables GPG sign' ' + test_config tag.gpgsign true && git tag -m "A message" gpgsign-enabled && get_tag_msg gpgsign-enabled>actual && test_cmp expect actual @@ -1112,30 +1071,29 @@ test_expect_success GPG \ 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 && +test_expect_success GPG 'git tag --no-sign configured tag.gpgsign skip GPG sign' ' + 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 ' -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 && ! 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_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 \ @@ -1168,8 +1126,7 @@ test_expect_success GPG 'verifying a forged tag with --format should fail silent 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' ' +test_expect_success GPG 'creating a signed tag with an empty -m message should succeed' ' git tag -s -m "" empty-signed-tag && get_tag_msg empty-signed-tag >actual && test_cmp expect actual && @@ -1179,8 +1136,7 @@ test_expect_success GPG \ >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' ' +test_expect_success GPG 'creating a signed tag with an empty -F messagefile should succeed' ' git tag -s -F sigemptyfile emptyfile-signed-tag && get_tag_msg emptyfile-signed-tag >actual && test_cmp expect actual && @@ -1202,8 +1158,7 @@ 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' ' +test_expect_success GPG 'extra blanks in the message for a signed tag should be removed' ' git tag -s -F sigblanksfile blanks-signed-tag && get_tag_msg blanks-signed-tag >actual && test_cmp expect actual && @@ -1212,8 +1167,7 @@ test_expect_success GPG \ 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' ' +test_expect_success GPG 'creating a signed tag with a blank -m message should succeed' ' git tag -s -m " " blank-signed-tag && get_tag_msg blank-signed-tag >actual && test_cmp expect actual && @@ -1225,8 +1179,7 @@ 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' ' +test_expect_success GPG 'creating a signed tag with blank -F file with spaces should succeed' ' git tag -s -F sigblankfile blankfile-signed-tag && get_tag_msg blankfile-signed-tag >actual && test_cmp expect actual && @@ -1236,8 +1189,7 @@ test_expect_success GPG \ 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' ' +test_expect_success GPG 'creating a signed tag with spaces and no newline should succeed' ' git tag -s -F sigblanknonlfile blanknonlfile-signed-tag && get_tag_msg blanknonlfile-signed-tag >actual && test_cmp expect actual && @@ -1284,8 +1236,7 @@ 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' ' +test_expect_success GPG 'creating a signed tag with a -F file with #comments should succeed' ' git tag -s -F sigcommentsfile comments-signed-tag && get_tag_msg comments-signed-tag >actual && test_cmp expect actual && @@ -1294,8 +1245,7 @@ test_expect_success GPG \ 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' ' +test_expect_success GPG 'creating a signed tag with #commented -m message should succeed' ' git tag -s -m "#comment" comment-signed-tag && get_tag_msg comment-signed-tag >actual && test_cmp expect actual && @@ -1307,8 +1257,7 @@ 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' ' +test_expect_success GPG 'creating a signed tag with #commented -F messagefile should succeed' ' git tag -s -F sigcommentfile commentfile-signed-tag && get_tag_msg commentfile-signed-tag >actual && test_cmp expect actual && @@ -1318,8 +1267,7 @@ test_expect_success GPG \ 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' ' +test_expect_success GPG 'creating a signed tag with a #comment and no newline should succeed' ' git tag -s -F sigcommentnonlfile commentnonlfile-signed-tag && get_tag_msg commentnonlfile-signed-tag >actual && test_cmp expect actual && @@ -1328,8 +1276,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 && @@ -1353,8 +1300,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 && @@ -1381,8 +1327,7 @@ test_expect_success GPG \ 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' ' +test_expect_success GPG 'listing many message lines of a signed tag should succeed' ' git tag -s -F sigtagmsg stag-lines && echo "stag-lines" >expect && @@ -1431,8 +1376,7 @@ 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' ' +test_expect_success GPG 'creating a signed tag pointing to a tree should succeed' ' 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 @@ -1441,8 +1385,7 @@ test_expect_success GPG \ 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' ' +test_expect_success GPG 'creating a signed tag pointing to a blob should succeed' ' 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 @@ -1451,8 +1394,7 @@ test_expect_success GPG \ 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' ' +test_expect_success GPG 'creating a signed tag pointing to another tag should succeed' ' 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 @@ -1528,16 +1470,16 @@ test_expect_success GPG,RFC1991 \ ' # 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' ' @@ -1574,17 +1516,15 @@ 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' +test_expect_success GPG 'verify signed tag fails when public key is not present' ' + 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,8 +1535,7 @@ 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 @@ -1604,8 +1543,7 @@ test_expect_success \ 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' ' +test_expect_success 'overwriting an annotated tag should use its previous body' ' git tag -a -m "An annotation to be reused" reuse && GIT_EDITOR=true git tag -f -a reuse && get_tag_msg reuse >actual &&