From patchwork Thu Aug 8 16:32:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AbdAlRahman Gad X-Patchwork-Id: 13757926 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 EC06C190489 for ; Thu, 8 Aug 2024 16:33:52 +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=1723134834; cv=none; b=RtNDLQfRa4a3zmualyi/0pGRQ2qPEHpS8edkBoOXtv2uubquS7CztC4xY/9S2W8VmjI2OHhSfJo7xBns7FZVaSPP0y9FxUA2bK7MNYdMvsDj/Tfpdm6WQzCtH5gHKyw5MG17Pytk1e1aPj7j07MRfwXjmCSIgtsLbj/A8FQ6QCc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723134834; c=relaxed/simple; bh=xKwIZVK66lsDU83PNp+xWIJYWNqMc6cT6W45zMb4u98=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=EFYc50bghUsQ1++YptEedYdhhUzBDecM5OdmPxvNA2oxWF0MLs/fepHezmnFhv6ftkeO5Mltb9r6z7yLYXC0dOWmxbmoGsQQGFzXDA/qdGGgm6cLyONUkJa6kPgmc5hPbXzGe2r737F6ZQHy8J/8c+m3hn0/bVWMEIxF4qx130c= 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=aTow8hK6; 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="aTow8hK6" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-42816ca782dso8772905e9.2 for ; Thu, 08 Aug 2024 09:33:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723134831; x=1723739631; 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=aTow8hK6GZNiodDOglBBK6G+C5QKV1ugn64Dzm1QWRPTb1GNtFH3jxAHtAlBY6ddK8 sgmT/fNeqekmpmeTGbqxickzcOnF6bswKyOOwHZyq1O2YxzbJjuJbqXQoXtjl3WxJr9l BZuZ/1TkXsCW/Cf4QAky6uebTb88WabzJjbJP8SAW5T8pU4AJ0x/M/Hol3+TZQYoVqCG w9GP0GfnrL4eEhStOXDKT5g99uysHvt6uqcg0jQi1fFKvi+V6IfL534lB6as9GFFdheV 3jkO21KUnTBxk14t1BZJ7g7po4DM7eRZsu+XRAmnU0D5Uydublw8D1NKeK2azEOvOYKP Ksig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723134831; x=1723739631; 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=F3BQwMEWqEVR0fsOonvc5LFWuJRuSMHRqdJcdzQ+bb1fphIDSPPsH8aZiBeD5rH9uh noOXRIeQvPN06bH9WhCQ3Or+5vH+fV69xFxJHG+5CWy565ffxltfILRW3CMsAR5Z19iK hUCXTR6MCgQlHuRBniBgzPY75yoEiDHZwjR+2/kVW2nv28iYpbYzCq14r1hwXVd0CG2i TK3r9dZWd4ZRGlfH4OXmwaSlEoHtC6BDmlFrjEN35K90NQJmSPNuKP/CMP2WPHbms7Q3 RtyxYMRv9v53ZMlaSUXM5cvP6k8k7nRKi8Z+jhgQFfLHvmAcVc9fGda968ANt0j4iSLM WlYg== X-Gm-Message-State: AOJu0Yw5ucdB2R2Cwf1zFEhBUnVD7WB/MXLurc3Jw2vaaa+RKQfhFhyH yPo/rEQr6180XEtbzYebTWz1W42D6LAcVwUu3yJfs/783J1u94KFUEyUVzbBXZc= X-Google-Smtp-Source: AGHT+IE7fiWrRhybpHOIBq29vy2/BmQNonFlurYMC+Eu4inxA4dKc3/5UHU6NYTpfCkxvS+sS55Sqw== X-Received: by 2002:a5d:40c5:0:b0:367:f05a:8f6c with SMTP id ffacd0b85a97d-36d2760a110mr1420308f8f.57.1723134830884; Thu, 08 Aug 2024 09:33:50 -0700 (PDT) Received: from abdobngad.. ([154.182.250.245]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36d27229689sm2415765f8f.95.2024.08.08.09.33.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Aug 2024 09:33:50 -0700 (PDT) From: AbdAlRahman Gad To: git@vger.kernel.org Cc: AbdAlRahman Gad Subject: [PATCH v6 1/8] t7004: remove space after redirect operators Date: Thu, 8 Aug 2024 19:32:00 +0300 Message-ID: <20240808163302.17521-2-abdobngad@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240808163302.17521-1-abdobngad@gmail.com> References: <20240808163302.17521-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: 13757927 Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) (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 9D9C118E04F for ; Thu, 8 Aug 2024 16:33:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723134836; cv=none; b=nH4+ITxFcqikzXNSyNnhWiD/XJQ1jnNqF4rdA6VW1x+vUO8SApaZQg+je4WfpA9dgpQ1bCYGvQgaQ6Apc9Ome43yLstCknzkhWwqvWGbDTPtGaNQ+QkdrcXdRzyDGqzcqOwJZBfbHcLYMfPPMdZzUqXh4C5zwXkQ5F4mWiEy7Bw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723134836; c=relaxed/simple; bh=cVnzW/t7yDjmYeF1m4QYbod7/h9J1VyvJhohHmlXetU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Iu8LzOMiwiIaJETrgkRpKD9bQ0gkrmSLYW326gIaQFh2wDAyPKoji2dBQk43JWSiQ45l54UD7NYEjjpA8/SUfN3A3SnzN7mxbihjzWro12bgwtujFdRHa7rT27j3PlTIKXqdpO+W6mRFGuxGoNZf/w6zo35CdjE8eG52KIeXt34= 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=g0f2FpXL; arc=none smtp.client-ip=209.85.221.48 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="g0f2FpXL" Received: by mail-wr1-f48.google.com with SMTP id ffacd0b85a97d-369cb9f086aso673507f8f.0 for ; Thu, 08 Aug 2024 09:33:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723134833; x=1723739633; 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=ChTqVIhedESt7Td/x+aw8MzbS+2WwLSHTWPfcu2d+8k=; b=g0f2FpXLX7dlatSrdhHRfrNHliEtijZAQTfdUwLhlNypZOOkVh1To5HjH0sSqgSjeG CGsqrGO1/Sipl1JDTJIeFOOHlOr/np80F723G6ST15Db1bPiPkZtAh3id2R56DvrSSrW JppmP6sWFcWzqDkz+3TWtdWOFcrTAjLIfV/jlo3C5UO381W/BfWy2UmgB5HaG7OOA6ry eT9x7aN2vApjhSn6KqRohfVumhNsxTRRulpEGnwdJhFPFLVhbtmRD5GikxO30tosEop2 1hQ4aLll4Aoe0FWPGd7tkP3YsPXW3ZMfrBv56d9MvXinSNiFK1wPsa4yArc6NCVbF1B7 Yb5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723134833; x=1723739633; 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=ChTqVIhedESt7Td/x+aw8MzbS+2WwLSHTWPfcu2d+8k=; b=Amz5THCpRvhDw0PhuXzplA14WyIed7kXsS/vTtiFtN8JUwoac73Vjv9KOCJy3NnZfG Q2KZCdr7j8bP1IH6NfpmDTh/AN/u02b4XnWL4eJYwHmq66NadjM0w4R5xpmmYQSoty/T 1AR0lMrcalKRPtseyW8slfZI5v2MfhZRffMe8lMzCfSkKiH1c2TQmF5XixoS0elasHRN /+J/QLpCUfqhxIU1Up7tn/y47rcyDPmqhywP9j1BGsfQIqqjEXBkkzTbb9YMjKbNfA/2 xMxeeViMmjl4rrN5asme7Z1dyMYLEM28Nhqs3Tw5SVdJ7H7Vanb5b+jR28KXM/4VqACh HkjQ== X-Gm-Message-State: AOJu0YwZ7NejZwHmjf4Ck+xkma+zf7u+bd2fi6jOAoBbwYFJrYAT5tO8 RO5ZS8gsHMVx+BaVrMBEC55ocqsDmC/3b5IMEUkkTwE8LLCQNti+VMIs+JoDlw8= X-Google-Smtp-Source: AGHT+IHLWLaC9qtw4i+Ms4jatRGIsjPc6CPMDeXIO5CBbd67yb+U4C41AoaPZDtcTpaKZVk4axdcoQ== X-Received: by 2002:a05:6000:12c8:b0:35f:122e:bd8c with SMTP id ffacd0b85a97d-36d273e0b10mr1818307f8f.17.1723134832643; Thu, 08 Aug 2024 09:33:52 -0700 (PDT) Received: from abdobngad.. ([154.182.250.245]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36d27229689sm2415765f8f.95.2024.08.08.09.33.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Aug 2024 09:33:52 -0700 (PDT) From: AbdAlRahman Gad To: git@vger.kernel.org Cc: AbdAlRahman Gad Subject: [PATCH v6 2/8] t7004: one command per line Date: Thu, 8 Aug 2024 19:32:01 +0300 Message-ID: <20240808163302.17521-3-abdobngad@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240808163302.17521-1-abdobngad@gmail.com> References: <20240808163302.17521-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 3100a4c219..09ce287559 100755 --- a/t/t7004-tag.sh +++ b/t/t7004-tag.sh @@ -213,9 +213,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 Thu Aug 8 16:32:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AbdAlRahman Gad X-Patchwork-Id: 13757929 Received: from mail-lj1-f169.google.com (mail-lj1-f169.google.com [209.85.208.169]) (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 4C0A118E04F for ; Thu, 8 Aug 2024 16:33:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723134841; cv=none; b=SJTydY1kT6TlpzAq4xGzjxJc0G2HJKAcBJAQxP1xaTmb3fjMYTlIIzetagNsBHLTiouO/ba45zcCIeNj2DUPStp2BGZbkrKv+FiS0WUbfhczXWcVju4+fNBb1dM3B3J3DTh0oecHejW3aRKOrxvshNlcH76SGEz8M9g8KZdAhFA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723134841; c=relaxed/simple; bh=DAjvUpj5YKpzDjFcoAH6KbTNIdIoG+X3FfUwG5Gxtks=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZDt7koVZUecFD4+AYkLykgMV0+/sPln1u3BKbhetSGofyxK00H90eWKRABwYNI4M7SWHbwahajPNnXr9WnlwjHVfnIC9vJd6G8gMM2f9/7ycOpZ75dLbc3pBKVI3t8T6Zx8SmcNQzZ8ktirbklkQLBJ6ayP+kVGNU5CTJ+5iSvk= 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=FPZY3FQ5; arc=none smtp.client-ip=209.85.208.169 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="FPZY3FQ5" Received: by mail-lj1-f169.google.com with SMTP id 38308e7fff4ca-2eeb1ba0481so14839131fa.2 for ; Thu, 08 Aug 2024 09:33:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723134836; x=1723739636; 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=Q/1V447xjaQbmyKIvu33fiFlG/zMC+KXGSPiRyJ8wag=; b=FPZY3FQ5dXLBM77TqeGE4NsJ68x3YkQ92V+3C7hPOF5VDPKrgs29hmnmnGbn85Bn9x M+L/d8mo5tcCyYU8MpioYgKcAw9EoLvsHnS7Fh6qYfz+kEtz9QJ5q8dz1yI02KTJVn2L gNOM1PHryZ+tRbKZIxPsjQhBXJCATZ34kCQkLC4g121ryo3SHiPf9zOJ7+LTfk/RtD8q j5WBOLZ06qLJ0Cta2fRJlOuLaH37339SmDbN4NaeuGxZ46gOkc3Xua4UMiOenxCaP6wE vjQ2QCelsUgdqt46LW8SZ9Be2Of6ABf5dEAo/PjFv7ayIcx2iYyrau2BkPmW2vh0T2s/ EbIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723134836; x=1723739636; 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=Q/1V447xjaQbmyKIvu33fiFlG/zMC+KXGSPiRyJ8wag=; b=ESZUbVtaKgrxEIyBMVZ3MSEKAoPlZzaf46DyycyTDPj4vsPk8/i3gP16EPVritp49d SZ3UtWwh6PX1oiBQ2o7t2KIcyMGv6Ts6T3fXMqRXQ10R/Yt1hwxqKc+eVo+FCQUh3joQ 1858S6WW12Y4Rt2EcSpuRB/chjFfFCCcuXSLKWxclj4mG0dbjj7dD9aY3shhKxYWGSeg jUZHib8MYQmBYoM8T+vNfO98zWAEqkTWhAt8YG4w+wRlgxysscP4/q8qgDxdHjhxEa43 NeVf5/3s/Bh7CYqDV3aQ5lhGiPLVECsW0pd71D0+/6dPG+XjuczWH94RQ7l72tVgjgG0 /crg== X-Gm-Message-State: AOJu0Yw9hnGp8bszsRKiyFunLuztIiqmjyJyAvDu2Oc/xxd47vuGyUAH YGH9p/deJrMeoeAeGQN+BhOzjgOtt6wVSjByV9X0TZE2EUBauj3/qAEqLjbvE6U= X-Google-Smtp-Source: AGHT+IEte0bnjDdgnCnxVj4BoaSy5Q4zkzD8d0+OsT6mOgnaZYK2N0ubuSi/yjrcBNPz2oaT4TfBWw== X-Received: by 2002:a2e:88d6:0:b0:2ef:2a68:beca with SMTP id 38308e7fff4ca-2f19de3fc98mr17357881fa.24.1723134835394; Thu, 08 Aug 2024 09:33:55 -0700 (PDT) Received: from abdobngad.. ([154.182.250.245]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36d27229689sm2415765f8f.95.2024.08.08.09.33.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Aug 2024 09:33:55 -0700 (PDT) From: AbdAlRahman Gad To: git@vger.kernel.org Cc: AbdAlRahman Gad Subject: [PATCH v6 3/8] t7004: do not prepare things outside test_expect_success Date: Thu, 8 Aug 2024 19:32:02 +0300 Message-ID: <20240808163302.17521-4-abdobngad@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240808163302.17521-1-abdobngad@gmail.com> References: <20240808163302.17521-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. If such code fails for some reason, we won't necessarily hear about it in a timely fashion (or perhaps at all). By placing all code inside `test_expect_success` it ensures that we know immediately if it fails. 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 09ce287559..a755d3be00 100755 --- a/t/t7004-tag.sh +++ b/t/t7004-tag.sh @@ -129,10 +129,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 && @@ -207,12 +207,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 && @@ -250,18 +250,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 && @@ -277,62 +277,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 ' @@ -343,19 +343,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 ' @@ -369,6 +375,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 ' @@ -451,68 +463,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 @@ -541,67 +554,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 @@ -609,62 +622,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 @@ -846,11 +859,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 && @@ -958,20 +971,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 @@ -991,65 +1004,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 @@ -1063,44 +1076,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 @@ -1152,78 +1165,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 && @@ -1243,69 +1256,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 && @@ -1364,11 +1377,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 && @@ -1410,60 +1423,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 && @@ -1488,10 +1500,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 ' @@ -1559,10 +1570,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' ' @@ -1588,10 +1600,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 && @@ -1620,47 +1632,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 " @@ -1681,23 +1703,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 " @@ -1707,15 +1727,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 " @@ -1730,26 +1749,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 " @@ -1759,45 +1775,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 Thu Aug 8 16:32:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AbdAlRahman Gad X-Patchwork-Id: 13757928 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 1C3D818EFDC for ; Thu, 8 Aug 2024 16:33:58 +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=1723134840; cv=none; b=YArtOxMGZ3UOOIx75Fd74EJgE5JK5GmcjbqFC97syusYj//CyXxIgJMMtSKzCXEGwZdQh25zYntTNeyAm6QcOGdQsnl/NQVrXU5bVB1Z4C9Bn8gmSFHbA/XneTH42gRMVtuDvImdUPHxrQXdER43u3Wczz1OhUgbyVZXy/ap0YA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723134840; c=relaxed/simple; bh=oFYS2aOLX0gtC4AdpzGUage+IULhVMWpeCmmgC2RoFk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YZPYpVQf73kZvSCdKFw59sDrBAyW40nhiC+qEoTLKbvMNrqw6SJ0wNPcXuTeLZ46OZHLex0ts0jsdBsBDK7jJRZq10TFrHjUqwTbS0kfvAIM3lWeu+qOtFUGFCRa1yHrpRArJuv8fIXW6HAOVgoZvXAt179oCwNV05mHQcEFnks= 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=G0Dl0UuD; 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="G0Dl0UuD" Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-368526b1333so1358101f8f.1 for ; Thu, 08 Aug 2024 09:33:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723134837; x=1723739637; 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=YsP+fpx6wh7dK6VZ6gajPM0W75dy7xU0B9edgo9xG4Y=; b=G0Dl0UuDQPkbQ6AeM2No35R2O0laDfZf7tX9DxP7vnI3VJ4TphUTwH539Qn3GLfTsi n/rRMfBDdghAx1yGJqU5KMvdhbz+c4jiRKmkRi3qgGPWe9mLRZWObTWgMPrlX+5S0Hrb 11BiRBvcfxJAPZFF4XCwRZPeFv0DgfJpMoV3Ukprp+GCgXalcxz2cytexiwKUH7q60e/ oRW/hXu2EtY6Nk2lvZwoNzMBxqkAIo0znLdm0X5iOMUEXjTd0MO9VPox3oKbUZEi4fSM GYnHt47MI626vyjKWCvAuS0KKh5t7NNsLQPpVINNBGC7vhiPt6LW8uZXPg/5yMah21c6 AzVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723134837; x=1723739637; 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=YsP+fpx6wh7dK6VZ6gajPM0W75dy7xU0B9edgo9xG4Y=; b=Dzf6SlUyM3Mwrvw/X9ZSaS7WrYwXFLHuPolWe9lplDBqWjwL5cYktBe7BuauloYwmr zx1xwkTgDzcdigm7ARvxtV91LTFafrIXXGMTXix0+KvQpqX1PbD+MTbJT6Q34KpxNVO/ l48FJIKtAOo4f/tYEjQmnb9e2ixp7NXJmkc4yrkNpsGfVSlZzkY1BxKEYkOUCzSadump qpUzNv/QxqgXCQEra2+4JtoPbF7uNHVkcENZbNVHlNf0k2ACxCY66Nh6z/axjxJ8GAwB hy8YHe0bG0Fcx0OSpYBOnW9udZEBsZ1V7RhG125y/58aROo07XWbkGxyx0KeeW5ealk8 r5Vg== X-Gm-Message-State: AOJu0YxWzJFPsXiy0aD/YpYs5UWTaPKcaAXqLRV1UC4MnVaPcCns3W1p xAR86ImlGDp8G1esik3IwX2BbtJ7FmitlsFJYc/+hGOy0xLTf1a8WzRwf4jP24U= X-Google-Smtp-Source: AGHT+IEhjf10kVr02PFWs83K5CqtCEMAz62OiFIeJ070jJW9GstJgUeCdsf3nNRyu91ua+T4gyaluQ== X-Received: by 2002:a05:6000:50:b0:360:866f:5083 with SMTP id ffacd0b85a97d-36d281d5433mr1962921f8f.32.1723134837146; Thu, 08 Aug 2024 09:33:57 -0700 (PDT) Received: from abdobngad.. ([154.182.250.245]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36d27229689sm2415765f8f.95.2024.08.08.09.33.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Aug 2024 09:33:56 -0700 (PDT) From: AbdAlRahman Gad To: git@vger.kernel.org Cc: AbdAlRahman Gad Subject: [PATCH v6 4/8] t7004: use indented here-doc Date: Thu, 8 Aug 2024 19:32:03 +0300 Message-ID: <20240808163302.17521-5-abdobngad@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240808163302.17521-1-abdobngad@gmail.com> References: <20240808163302.17521-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 a755d3be00..996020fd7c 100755 --- a/t/t7004-tag.sh +++ b/t/t7004-tag.sh @@ -387,10 +387,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 ' @@ -398,10 +398,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 ' @@ -412,17 +412,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 Thu Aug 8 16:32:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AbdAlRahman Gad X-Patchwork-Id: 13757930 Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B7CFF191466 for ; Thu, 8 Aug 2024 16:34:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723134843; cv=none; b=iB50jWnZ/YOZDyxKP4WirQoPir9Kc/KD3zg3NGOVcSutKcl5n5bW7bCT5wqex/DaLY4s5vRYjU/WUewM1Cy2j15EgYTOzE3aR3Q9mu1DKjqXRGl/9pUpuz9EIDo8uIGk6RRcM21E2bfC09ZhzMQWwXswggmnzDlgDszFr4oLQnI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723134843; c=relaxed/simple; bh=MsrH1E/WGU6noklHawkX+POBlnScUaB1qnS13SbDS40=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZFfAb1p61jf0MB1AtqZiR7/Bm4fVaartHA+8AT6o7BGP897W/1f9WnscE7hlR9YenGTerzIUjA7xvK1ZrLBh3N42vU2fBYN9vhBEN9gMENeV+LlGsFRPkoNvOcxuFLEqOVExHazU9lreUmylZqpVeqcQG9rKGI0kw3Apv8MYWC0= 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=UVMqYmZq; arc=none smtp.client-ip=209.85.128.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="UVMqYmZq" Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-428e0d184b4so7863325e9.2 for ; Thu, 08 Aug 2024 09:34:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723134839; x=1723739639; 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=Ig9z7FaK00EDz03L9ynFwXV2P5PuDDjA9OL8w3Kf6jg=; b=UVMqYmZqCJC3Ry4/Bec61u3YdsDXhrCCI5l64rh9h1yMTsqeRtfkgk6AEe2FtoDCff PL+C1PcXnJbDOq4qD4DJzSabJvzcJzGinHaAUI+MjlMbkvwSf79Q6Vgr4V5cf4KzlZDf KjO19zQLZ6S9ejYVqzg4PPiYaD2qSjw43UrgZPCYFnKprPjTkILdkVa6yN4hYwdesJLz tzy6UpF1X3QuCSJAkSgyccHTlnG4JyI+ZawyVJe7UCt98q/px49lFT+D07xvKLr09WCb z6X4RFa72qBIr0KPXp8B9AQXP2OyK2JiGHT0cmpyqlX6oF+59bHHo1wqfBEl0dxmESVr +8vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723134839; x=1723739639; 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=Ig9z7FaK00EDz03L9ynFwXV2P5PuDDjA9OL8w3Kf6jg=; b=MDSUuD5OTThkhaJm8M4Y8CkMLMxyVBSft+mVCyMwmlEr2miFCHwceyrCWevTVOMq6I KRdtphtmFhmNNcXBg3BdUcPqlI0m7BMhMuuvoj/kmyJtsL+mUv7M0WooHjh7wnFV0fGX zA+JAqREoJnExrtSpRBDC9X0UkGNxZ5QK/VEW5JKmaPxXwAf9MkjA6XTGQdh6bdWVDK5 kNqQneek99GAPWU8yR+SSV8w1SmeBvnVZIudCN5sFJkYTZZtj52RrJcT4xETChRGCPS7 QtOTMp7/7ZyLa7ygdc9XtpCiq8UaULxgNuFnKU0kHLvJhj0o777gTYv/y3JAilxS1rGj f41w== X-Gm-Message-State: AOJu0YztaPaJd4kwN4I6Iiv8E5Qvins15OH2myq7GIfDQigDhbQBDz7Q 7J+AHsRwafc0W8ZhMHFKH0b3Tx5AkVD0CZ2s3m0YP13odH2yBp9sYnBGkIU+MoU= X-Google-Smtp-Source: AGHT+IE1sLs6NGEqttHGpwMZeIssjG+hgAgkJCf7l93ZifzlQzKEWq/vwQ015LmMVXfpaCz8M7PaVQ== X-Received: by 2002:a05:600c:4752:b0:426:51ce:bb14 with SMTP id 5b1f17b1804b1-4290af3b9aemr17018235e9.30.1723134838651; Thu, 08 Aug 2024 09:33:58 -0700 (PDT) Received: from abdobngad.. ([154.182.250.245]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36d27229689sm2415765f8f.95.2024.08.08.09.33.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Aug 2024 09:33:58 -0700 (PDT) From: AbdAlRahman Gad To: git@vger.kernel.org Cc: AbdAlRahman Gad Subject: [PATCH v6 5/8] t7004: description on the same line as test_expect_success Date: Thu, 8 Aug 2024 19:32:04 +0300 Message-ID: <20240808163302.17521-6-abdobngad@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240808163302.17521-1-abdobngad@gmail.com> References: <20240808163302.17521-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 996020fd7c..5cbb13a603 100755 --- a/t/t7004-tag.sh +++ b/t/t7004-tag.sh @@ -154,26 +154,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 && @@ -207,8 +202,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 @@ -220,8 +214,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 && @@ -229,15 +222,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 && @@ -277,8 +268,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 @@ -289,8 +279,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 @@ -299,8 +288,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 @@ -309,8 +297,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 @@ -318,8 +305,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 @@ -327,8 +313,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 @@ -337,14 +322,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 @@ -428,8 +411,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) @@ -438,12 +420,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: @@ -463,8 +443,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 && @@ -481,8 +460,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 && @@ -490,8 +468,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. @@ -510,8 +487,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 && @@ -531,16 +507,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 && @@ -554,16 +528,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 && @@ -571,8 +543,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 && @@ -592,16 +563,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 && @@ -611,8 +580,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 && @@ -622,8 +590,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 @@ -655,16 +622,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 && @@ -674,8 +639,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 && @@ -794,8 +758,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 && @@ -834,8 +797,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 && @@ -859,8 +821,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 && @@ -951,20 +912,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 ' @@ -1021,8 +979,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. @@ -1057,8 +1014,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 && @@ -1068,16 +1024,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 && @@ -1087,8 +1041,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 && @@ -1098,8 +1051,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 && @@ -1109,8 +1061,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 && @@ -1119,8 +1070,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 && @@ -1133,8 +1083,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 \ @@ -1165,8 +1114,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 && @@ -1175,8 +1123,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 && @@ -1186,8 +1133,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 && @@ -1209,8 +1155,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 && @@ -1219,8 +1164,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 && @@ -1232,8 +1176,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 && @@ -1256,8 +1199,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 @@ -1291,8 +1233,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 && @@ -1301,8 +1242,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 && @@ -1314,8 +1254,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 && @@ -1327,8 +1266,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 && @@ -1352,8 +1290,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 && @@ -1377,8 +1314,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 && @@ -1423,8 +1359,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 && @@ -1434,8 +1369,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 && @@ -1445,8 +1379,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 && @@ -1458,8 +1391,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 && @@ -1469,8 +1401,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 @@ -1482,14 +1413,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 && @@ -1500,14 +1429,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 && @@ -1517,22 +1444,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' @@ -1555,34 +1479,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) ' @@ -1593,15 +1512,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 Thu Aug 8 16:32:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AbdAlRahman Gad X-Patchwork-Id: 13757931 Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.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 549201917CE for ; Thu, 8 Aug 2024 16:34:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723134844; cv=none; b=hehNId05P7o0bLHcJsj3KKGtbzsVsa8JBb18yiTxAGohs4s1UFYgLHyAQSO370Az1rIx4aKhS6f1rQ232V8JQYSoSwGdO1cGyg6YwISyfZ59ZECEkkCYtWb0pmcdw2NG43NeS1bPZfbzE6t+UzJO6R2BUNSnjq9SiltY7bXRE2Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723134844; c=relaxed/simple; bh=TqxR93We0Jzw3S+HgfcmOstzB9/095t878nhZEiDQEA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=oHrM9bXIriRQSJEyRaTR33weSfSKP3Hl2hNpYjCZs1IwAvaxyVz+j3hTKJhBjkMifHTXzsjlr/LXJTkWV/hxfxOgeyqOehVrgmWVMeqVE61p1UH6LAZ83lCpluzdOOGBrAe2PNk1UihTDkO78vT1EXPo7soR9zv2jOsdDxNvZqA= 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=EmwbJlP4; arc=none smtp.client-ip=209.85.128.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="EmwbJlP4" Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-42809d6e719so8759745e9.3 for ; Thu, 08 Aug 2024 09:34:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723134840; x=1723739640; 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=b8h7I8Bsuk9bxkpPbSf4fcRiRr8dxq6vFqTK5db6Qo0=; b=EmwbJlP4TcCEKgh7SMa/Jix+AjDZoOQLi1eruWyn8eK+KQmM1ZjXC8NmyY1qF1Rx3u AZ/xqBdx8PjG3GdgDe3Zdcc+++kehBhNk6NDJeuvcnpHqLq7M1BE/PLRPkeFLaZ1AIj2 vthF2ILql2dL9YSVM+JHpAhD5jgulG2Q6krV/MqCCSVkTM3KF/RuGdnmisIzD0q+IxGL EzSmK9D5H/xMeFzv947bQcgDBphHXzAWN7/hjf9t4vPR4lyroPgAiw7udxtI9pEiliog Y/cSCzPbkz4hG4LSX1kIZCGZnbvFA2xzu35oPK3OUPWxzHRIbzza07ex9oOc0ejaFySY H+8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723134840; x=1723739640; 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=b8h7I8Bsuk9bxkpPbSf4fcRiRr8dxq6vFqTK5db6Qo0=; b=N0h0eUSp4cRDmr9DgOyPhkS+D0PHtPgKv3ohJ409SNK0edpfCxwvVyU6iNCgYoI6np NxjD7xz2xtybofSz0B4kUM2MbZomEGK9QE0ySxnSoZfQEQGE0bPK1EDacrijimO/M/EA vbC52UWGc+CKh/2WUiFuN3C2/4KqrwuPqQyuez3ZMui6NGaNY0JvPy67iYfzKr1iHbJw cp0itObPNobw0uW/BoHmMYKA0x646xIxHU42yKkPc2zRFX0FRumbx1JpQ+TtBar40Huq Lvb+QjuF6tGUJwePOKAQ4awDvGyfpMXzpOgn1bhJUMJsrNzvGQ+bDCs66FrK6ROMYGKu iVSg== X-Gm-Message-State: AOJu0YwmIVwiFMdHZWV8Ioyr4mxt2y8dcRRALf1j8uV6FwxqJZcZIRMp z6c1ccUCQEg6wnPOa9OurBlYjB44Qa93UljOWTYjwQ3gDSl0FhRnWseAsPorq8k= X-Google-Smtp-Source: AGHT+IFKaGiCMPvGZKtqnV5ydKY5wBHcVHVG1wih/COxPPxAJ9zXqS3iN6EhTa4edPVezr7B5K106A== X-Received: by 2002:adf:b357:0:b0:368:4e28:47f7 with SMTP id ffacd0b85a97d-36d27525489mr1954710f8f.6.1723134840225; Thu, 08 Aug 2024 09:34:00 -0700 (PDT) Received: from abdobngad.. ([154.182.250.245]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36d27229689sm2415765f8f.95.2024.08.08.09.33.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Aug 2024 09:34:00 -0700 (PDT) From: AbdAlRahman Gad To: git@vger.kernel.org Cc: AbdAlRahman Gad Subject: [PATCH v6 6/8] t7004: begin the test body on the same line as test_expect_success Date: Thu, 8 Aug 2024 19:32:05 +0300 Message-ID: <20240808163302.17521-7-abdobngad@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240808163302.17521-1-abdobngad@gmail.com> References: <20240808163302.17521-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 5cbb13a603..2b15ede1f3 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 && @@ -148,25 +149,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 && @@ -236,8 +243,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: @@ -417,14 +425,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: @@ -1014,8 +1025,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 && @@ -1024,15 +1035,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 && @@ -1041,8 +1052,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 && @@ -1051,8 +1062,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 && @@ -1061,8 +1072,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 && @@ -1077,11 +1088,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 && @@ -1451,14 +1464,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' ' @@ -1479,21 +1494,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 Thu Aug 8 16:32:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AbdAlRahman Gad X-Patchwork-Id: 13757932 Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.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 226F7191F61 for ; Thu, 8 Aug 2024 16:34:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723134846; cv=none; b=FiQEgHCD0tS4rKPZUPLzRe/6yq0CgJ6VyBGm/LleUv8F9xchvoQbY5PJwBoGD/GknQXE0Y7kFfmzcPj6DksanJtrAf6+YB7rr18Xpj/8ZByUfKvfAuyf98gDDcj99vudYYWlCCKV8FDQL13z6dRm8hyAuvk3CC+W174SvLzy9y8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723134846; c=relaxed/simple; bh=BoQ0IAUos8x1kUByUP+3xBErycbQy5BCQM9YfcvaZBQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=q9b6NKHFhQ9D0X+REZ1UnqCqO9kONF2hpY7lM0PsAp32+gvUimQRl9iYT7iSVUV02dmGbovhxymWq1/gR1aMSvjgk/pAZPu+0sLbBcqRGX0yFuI8CmFkuujznNUSHircl7AHL2Gig/Eg4VjJRNZcTZHTrAd+JU7dZsLmDceTZpU= 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=V/R914K2; arc=none smtp.client-ip=209.85.221.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="V/R914K2" Received: by mail-wr1-f47.google.com with SMTP id ffacd0b85a97d-36868fcb919so721104f8f.2 for ; Thu, 08 Aug 2024 09:34:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723134842; x=1723739642; 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=Tmz1h4+VcqBpkCDYpWTREoovppaJQx36IZs7F77BpEo=; b=V/R914K2k25I+JDsZ0xikD1BehJQi36veAxoUDnyt7pK83aBKgyDU0LUTUSzvQCQx7 /vP+QLpeic3o754VUDrmI0l5virux5BbnjVknyW6t6HXrj6Ednggrdk5z64RGTU4xFQh eue2C3wf9EuVEDZIp7on779zXYN0b4an17Mpx2gjJfglrfCi7w3nqxC4mEVVBhRXra1a rv5ta/iqFwgEvL4YHQ9LA1paqqQB2VvkTj7regCWgNTCp1POy69FXGSA2oghMjLeQoxB L0W8Slr3EwM1rp9RFVY404wReB3ketgzl5HWt5HwNYy8QrtxDFN4xotJ0pq4KXqbdvnd aI3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723134842; x=1723739642; 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=Tmz1h4+VcqBpkCDYpWTREoovppaJQx36IZs7F77BpEo=; b=lo78v0HfGhTkPA9l3paxT56+mFfPTXd0b4M55UdPHxjfkpwlDMxqs/sE4k3O4TxkG/ /F1EaA716S9PfW9QPpjobQHNs19Y2wWHwIyq446sitoCWK/bhmfgrUFbreZOkI56FHbR etGCGsZt6H7sulCm0TalPuobOlJBFpU5B7gZVUENU0MbhVg5OKkG1SSdMw5/N4dewPMl 08JsMFnaMxufCCK4HcKcji2CzqpTX0b5krqr3iGI6tMpUweGbdgqxG/Zj7iG92OULNBO toiw23xNHohUJu7iKHnudWUBhPb9zvWdMTZyX4QJ3hlR5jXLF9a1qv+sc9SSx7zCr2vT iXaQ== X-Gm-Message-State: AOJu0YxKzg6bRzc3wpn4AYP8Qrl0puj8oKhOuzMd1BMkz+MAHUol+6GF ggTKPfdOTfkEIv3/xhWAkInWzrwNbpydqZ/ywBUMHqyYZq1qdSSQsI+DCmkki8s= X-Google-Smtp-Source: AGHT+IH6jMGWwOCaWTJU1U+b91wmDIRQtdka8tOFiMxwNo73FPIon3Xn5ZoaLY5YPmbO9JGGRf+z1Q== X-Received: by 2002:a5d:6c6b:0:b0:367:4dbb:ed51 with SMTP id ffacd0b85a97d-36d27276865mr2142610f8f.0.1723134842054; Thu, 08 Aug 2024 09:34:02 -0700 (PDT) Received: from abdobngad.. ([154.182.250.245]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36d27229689sm2415765f8f.95.2024.08.08.09.34.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Aug 2024 09:34:01 -0700 (PDT) From: AbdAlRahman Gad To: git@vger.kernel.org Cc: AbdAlRahman Gad Subject: [PATCH v6 7/8] t7004: use single quotes instead of double quotes Date: Thu, 8 Aug 2024 19:32:06 +0300 Message-ID: <20240808163302.17521-8-abdobngad@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240808163302.17521-1-abdobngad@gmail.com> References: <20240808163302.17521-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 2b15ede1f3..046a5bd9bc 100755 --- a/t/t7004-tag.sh +++ b/t/t7004-tag.sh @@ -1583,7 +1583,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 @@ -1594,10 +1594,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 @@ -1607,9 +1607,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 @@ -1619,33 +1619,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 @@ -1654,14 +1654,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 @@ -1671,7 +1671,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? @@ -1692,7 +1692,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 @@ -1702,22 +1702,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 @@ -1728,9 +1728,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 @@ -1742,7 +1742,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 && @@ -1758,10 +1758,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: @@ -1798,16 +1798,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 @@ -2183,7 +2183,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" From patchwork Thu Aug 8 16:32:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AbdAlRahman Gad X-Patchwork-Id: 13757933 Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.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 21A511922C9 for ; Thu, 8 Aug 2024 16:34:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723134847; cv=none; b=se6lFA3Gbl+pBrAp6ZX+MlQQARQirfKv1OQBZPybGjN84tPzSVFbBn4syOtXXHyhuF93A8PmlGBqfVzZiI5HetgHK0ASphrShYBw7L8I2k8LvPeKxYTOTbNpdW3eDf1znnk2DUNhNii1U+Hw3qtJfZw1i88krdffzOicpe0IpSQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723134847; c=relaxed/simple; bh=82LBgI+r1uoEbXpHhpXqwtsjlfx4Tj7PQr2ZiAaFQLc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=C5VNFyWAKrs+tA5BC16l4dvn3JrJOw2SxjxiOh/SR5ewBw4NT2Sp8IPnFLH1mFK2rHIv4x+q+fQxq7apNtk4CF1dTAzctHOYuvynn82++QNWO1h+FQLlbpBCHkjPcTllhqh2Ps9yA8HEp2hfoo+q82SkKXE28+V8DvDMwCQ4kpY= 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=A3t53JXP; arc=none smtp.client-ip=209.85.221.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="A3t53JXP" Received: by mail-wr1-f44.google.com with SMTP id ffacd0b85a97d-367940c57ddso612806f8f.3 for ; Thu, 08 Aug 2024 09:34:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723134844; x=1723739644; 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=uMSNiupLF5UrDzBeRLBNNFi69PIu7pbmJ9KBAk2lI2c=; b=A3t53JXPWC6xlAVGocI3xFH8xLAiMzZxyIeT5gVgDg9Qky9MsNENbyANhNBPh0G1tw IwvBC9lm38JUeGaVZSZK6AfnNzH+jRjhhuBqm4B04R6wWuc/Pft1sslgHNb0ShjsjSL7 yIwKHZZ0/jYl/bnLHtpl6UxBMJy05uYs7BZAefyuDQgTtle6Oe0NRsvOGWR3uT8J4YbX S7TAtI8JWB+geywSx7jVTowvpGaRaBvTa9KFNAd5ymD7Nhru5fL9eaNjK99xHokZhgyr zTiqVVUi9q+k19mbOZRIXP4hlgQ4T0+e3xnaQUy9Tqh49telfNvwQw8EaCKwGwZmpN45 6P5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723134844; x=1723739644; 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=uMSNiupLF5UrDzBeRLBNNFi69PIu7pbmJ9KBAk2lI2c=; b=w8rQUNkKkMgrCVqlThNQu2iZGGfTSSqdRvc8mrx5sf9USKKoueITyBBFQ93Z5hwTy3 ICC8ORGKhL3l3X+Ovs8TkaZtUC7Jxm6Nnh7z71fTeBAHM2kOU/QmL0VXnDhxF+kvwbTV KSGip5zn2arnQ1+Ct3VXfnyjKP0irN0dvcyUAYqWiWHym+OfQs73TbxRZ3kmWWLfe6l5 zuky7PFKsbIwrdC8kwL2fXICU9bW4rrjzqOvPFnEwcOoQDCCVnoFb8cASImL6GyLXcnx AHb1euSLCk1jv07c3R021xOb1hJllEvmwK3azUGuTKJPimyQO5Zf6JiiX8ctkxc2y9eO Zzjw== X-Gm-Message-State: AOJu0YyDRhfWjfJRSU2eqgFOP9G/RKxDOSYf2rDmpr3H7F4j1I/WspBu Z5LjTlWxtyYa5JfPVSwSNCERZjKM1pENzfnol4MYa0fl0wf6FLf3o4KhEJFpRfM= X-Google-Smtp-Source: AGHT+IFGP07ibp4+frePFpl0lpCLGi+pN7ubqUIdMEv/DzQyOgn0eEsqrHqqBdp90n60U/qEvqcMUA== X-Received: by 2002:a05:6000:184e:b0:368:6ab:ba69 with SMTP id ffacd0b85a97d-36d274ef602mr1934803f8f.28.1723134844085; Thu, 08 Aug 2024 09:34:04 -0700 (PDT) Received: from abdobngad.. ([154.182.250.245]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36d27229689sm2415765f8f.95.2024.08.08.09.34.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Aug 2024 09:34:03 -0700 (PDT) From: AbdAlRahman Gad To: git@vger.kernel.org Cc: AbdAlRahman Gad Subject: [PATCH v6 8/8] t7004: make use of write_script Date: Thu, 8 Aug 2024 19:32:07 +0300 Message-ID: <20240808163302.17521-9-abdobngad@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240808163302.17521-1-abdobngad@gmail.com> References: <20240808163302.17521-1-abdobngad@gmail.com> Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Use write_script which takes care of emitting the `#!/bin/sh` line and the `chmod +x`. Signed-off-by: AbdAlRahman Gad --- t/t7004-tag.sh | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh index 046a5bd9bc..b1316e62f4 100755 --- a/t/t7004-tag.sh +++ b/t/t7004-tag.sh @@ -974,13 +974,11 @@ test_expect_success GPG 'sign with an unknown id (2)' ' ' test_expect_success GPG '-u implies signed tag' ' - cat >fakeeditor <<-\EOF && - #!/bin/sh + write_script fakeeditor <<-\EOF && 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 && @@ -1415,11 +1413,9 @@ test_expect_success GPG,RFC1991 'creating a signed tag with rfc1991' ' ' test_expect_success GPG,RFC1991 'reediting a signed tag body omits signature' ' - cat >fakeeditor <<-\EOF && - #!/bin/sh + write_script fakeeditor <<-\EOF && 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 &&