From patchwork Wed Aug 7 12:58:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AbdAlRahman Gad X-Patchwork-Id: 13756222 Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 93AF31E3CA9 for ; Wed, 7 Aug 2024 13:03:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723035813; cv=none; b=uPGNFKOvwtNQeZ0Aa3yBdauL3ZV+WmwHn5fw5UMektGyBnJLQy689+czEgavv8rM4J2TxNLuCxK2iMhsbfBFiJDlJ1kNr+i8yEB4PQHeo7bCfJtQM1OhTHt+DJdQCPBlJDflr1ZmeWYExDBsYyBfVqUhQTr8Y5k3wP1x1v6w6yY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723035813; c=relaxed/simple; bh=xKwIZVK66lsDU83PNp+xWIJYWNqMc6cT6W45zMb4u98=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=SJpkRnszkNRC5untrgL8pqcsLCsyZctc4a2xWIh/4tmwOf5CYssb0oeb5RlkcFaUZrAyixhnYiZ9wCpq8DqNps6fIOokQeiGyoIG5GkCxh277JZxM+vGnuN6JdtlKMSGMTmetnS6X0KPXpl+wQ2LNv4db3wmhSSgVM27XIeIUug= 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=l1EfahTZ; arc=none smtp.client-ip=209.85.128.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="l1EfahTZ" Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-42819654737so12297825e9.1 for ; Wed, 07 Aug 2024 06:03:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723035809; x=1723640609; 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=l1EfahTZCGg8ZKNE18ineJHP9zQInA3CRWxFy9ZjwT6YB/ghFVxEgRJEStNRmzFovb ZZ8ONUFiY1vI07iQ7PQGuGkz8/co9LW8yLoeRNkmMHzZqOLUvQwKSY9PaWz3hMtexssp Yc1gf6QQomP/Fi+HMLYQd+pIsh4rYcyM47grE4mnrTtANcJmfVSwOf3ipGROurITr7bO kS9htLDaa23WPffpvYw5OwhRRMl06sD/Av21A6wgZf78Rvffvs1MI9zR+CboIeokzviC sVw263h8Wz6Mw1DsQRNd6kNcMhRnjzQ0IQEmIHvikBc2x7uJAvaLq2wdDx142UiYMSMW kDsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723035809; x=1723640609; 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=G9AE9NU4ZsRhr+DKwzkHJsAq6XCL8OUwjevnGMjXCzX9E78yetYlmut3sojfLqJl/t jWSLveHVVcoLAN3EHA4p8uFsHMxOW3y0+jWo98zrDC9fscbKz1WJVGPLn9vRVBZ6Qx7C lD9/o6JP/QOnIm8zItyj1fMZ8LgBd05BT+CWvSxivej0X5L4qMR0lpOz+0liP771AG0j IOo5Ep34PCaO097VqGQOPse/aLsV0xvw40XdEKPfcD3BsA8V6ZiDjpC2RoiCsyrhfV6f 3+CwWEFAm9K+pUEy0z2ENwPdvnDwl5AtRDqTtepYcctO66EleSDmTzSIIzzzLJff/67M cQ+w== X-Gm-Message-State: AOJu0Yw90qe2iE4YXnTCJ5GU1HazB381wV6a8pKHEAOx6ayHMIEMKzP2 PFgo3bqKI9PX9w2E19VsBQo67QzsPTDJ7Oq3FCYQ0KMBiyHsdaDSFav75ugC X-Google-Smtp-Source: AGHT+IGIwKyUo1xk5Brf8W5nWgK7V3IndlXdHOZkE9BSJMHTtZcj1eXk6ya3SHwVGEDUIwUs4RSgIg== X-Received: by 2002:a05:600c:3ba8:b0:426:5269:9827 with SMTP id 5b1f17b1804b1-428e6f88acfmr137862735e9.0.1723035808536; Wed, 07 Aug 2024 06:03:28 -0700 (PDT) Received: from abdobngad.. ([154.182.238.58]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-429057968d8sm29196825e9.9.2024.08.07.06.03.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Aug 2024 06:03:28 -0700 (PDT) From: AbdAlRahman Gad To: git@vger.kernel.org Cc: AbdAlRahman Gad Subject: [PATCH v5 1/8] t7004: remove space after redirect operators Date: Wed, 7 Aug 2024 15:58:37 +0300 Message-ID: <20240807130259.28381-2-abdobngad@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240807130259.28381-1-abdobngad@gmail.com> References: <20240807130259.28381-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: 13756223 Received: from mail-lj1-f173.google.com (mail-lj1-f173.google.com [209.85.208.173]) (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 8325D1E6755 for ; Wed, 7 Aug 2024 13:03:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723035814; cv=none; b=BrMBHchgj7Xl0Fn/PfOQ3WyerbM4njMCdWMG8IG+uzeU4JCVVI8TVfWfWCGP7hzymKQzE+MXLoAEGJaTJUWaKMi4KaaVDni4nNyzsoDoS0k+MCdYI1cosYkhZp3/pM+BQAubMQSAaxCRE9Ja6AhbKGD3Fnm0dA9zoGGZt6MNLls= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723035814; c=relaxed/simple; bh=cVnzW/t7yDjmYeF1m4QYbod7/h9J1VyvJhohHmlXetU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KmWtr0XrZp6wapPSeKlUGICV7Kq+wUs4HofNi45SxWweN8M/n8lOuxm8xsLQT1VZoSnEA/vzx+/XnLPeUjUgborUfHDQWgy/Wlv1fJpUZS20WQdUku8ULKDKCoLV4g2kHjYzK29okiXxLRacfldskajiBScfdeJB7HlZSetZB0w= 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=DJ4a5vZC; arc=none smtp.client-ip=209.85.208.173 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="DJ4a5vZC" Received: by mail-lj1-f173.google.com with SMTP id 38308e7fff4ca-2f032cb782dso16535021fa.3 for ; Wed, 07 Aug 2024 06:03:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723035810; x=1723640610; 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=DJ4a5vZCpDk7DTjaOYcKk6gZFesuX98kbXy8np+NQHjxQVBazUVVREsHdcbU5WcC3s 3ziUn/WGMM7TYBl+W3CA1JbsvjZQli8LcyyJEnEXKs6/Z1Rwh8rKN6UZt6WHRx2l1VC7 7F5QA5VyyBQNxqdkljyBD+M2xki8fZSjlULHlrARRT9cYxdmMMcOdcGdJOrwWzaT1JeV +qfUxR2rUIyvZ3qhj55HYudGbsf6V2mxgTZw0e9k4InKDREzXdoO1iIs0Q7hqF2fF1Ub xxddwFlKbGZSJJVXZFarYV8Yde1t2z5MGD2OW5pFG0RzHK+OIwKEu/ACoJVUa1cNqHQb ox7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723035810; x=1723640610; 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=c9g4S3QsFXEN7d++VCatYbseImQ9TlrQrJDQOSbxUF95J3p1hmw+irxQVrRRibGWy4 mlK/JcUISVrdQFjpy3MY7huyFJtic052DicNFcME8sBnih2Go/NpG9N97L718VD2GMQz Sbar5x8OqHLFLs0xJRpU+oStyCubwH0lbXaQ30HLYTKKBZeaKtXSM6D2laB1lnX9eTyX ZOjWq1AcvHGHTLX7NEBwu2JTJ4QuiszEywAmCJPqfKtpemxM+V+90Oqu3eVME9UM1b0O wnoEcVHoVyrCBoeN7zZmz70EDJIDZMtc9U+P96PCfHAygrW4uzvKpdSIlrNi+yRd9ijG ukLw== X-Gm-Message-State: AOJu0YwkGGEvSLNpuM3IU0A4aM6gzpTloxO0s/SRKML9/e89ISixGbGY TMeGQQrB2Vzo+nhGo781RbW30vJ5fNDc5VJOHQZw/hh1uFF9y+zYXd7sZl8B X-Google-Smtp-Source: AGHT+IGjKXcFGETKOGWKtIWGOK6kQrTxpoUDrw8Sr2wn1zvGeEUln6QsNQQCFKQrun/EVRyij5GBcQ== X-Received: by 2002:a05:651c:95:b0:2ef:1db2:c02c with SMTP id 38308e7fff4ca-2f15aa83909mr123920331fa.10.1723035809605; Wed, 07 Aug 2024 06:03:29 -0700 (PDT) Received: from abdobngad.. ([154.182.238.58]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-429057968d8sm29196825e9.9.2024.08.07.06.03.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Aug 2024 06:03:29 -0700 (PDT) From: AbdAlRahman Gad To: git@vger.kernel.org Cc: AbdAlRahman Gad Subject: [PATCH v5 2/8] t7004: one command per line Date: Wed, 7 Aug 2024 15:58:38 +0300 Message-ID: <20240807130259.28381-3-abdobngad@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240807130259.28381-1-abdobngad@gmail.com> References: <20240807130259.28381-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 Wed Aug 7 12:58:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AbdAlRahman Gad X-Patchwork-Id: 13756225 Received: from mail-lj1-f171.google.com (mail-lj1-f171.google.com [209.85.208.171]) (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 696604AEE5 for ; Wed, 7 Aug 2024 13:03:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723035816; cv=none; b=tZTGKYAbNj1K7l8xgDOIdSiLvdNL8vjj440KJALr5555OtXp01gcQLSjEi2MB/5rQlxcx1LScyBFA1vXxxu7fiU0qe/PcaiIsNrTi0mzAVIP/hSvWwJttr79wBIWyVIUWfidljZ8+ZH3emvQVHp58uN+9AAMw569pXoNvfRl4OY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723035816; c=relaxed/simple; bh=DAjvUpj5YKpzDjFcoAH6KbTNIdIoG+X3FfUwG5Gxtks=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=J7BDHy40jctv4BBawF9RoFh3/TRSZV3YzNs3LJAEwfaSwe27g8LQmijwYmK8EQmY/2bKDj+ehWoDwFJV+PjFDqNCi8jsDJpQ0fBhkXhcLNvXcGvDBox0nl1svku2yjOO6XVfiNOM+RFClI2lggE67VXRmGJ7B9nDwf/nhZKHVbk= 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=RKQct92F; arc=none smtp.client-ip=209.85.208.171 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="RKQct92F" Received: by mail-lj1-f171.google.com with SMTP id 38308e7fff4ca-2eeb1ba0468so25833351fa.0 for ; Wed, 07 Aug 2024 06:03:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723035811; x=1723640611; 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=RKQct92FR8nR/1m/CNRhHx9WH3AhJlfAFxvmeNrQt5NiswOg5ecd3ejl5zusUnjLTf s9KQc7WW+QfhrgUQNzWyKJkv/nYdO9ieXBf0sHA2oLaIWwydflkZmeAztk9215pachMe xLEO90uynUhvsveKMrO3PnsQqYWfm5vlTLbw0NjzEkGOB9OCdlGYy36NtM9y25YF8DyV u2q8N5wrfFz/rXb8yYf2HG81/Jnwb0D2su9aHnzNzHtIIBO2Q1TCjpC+fAVDA33duiYs Q2g+/srSbVWkaixrd6Q/LPQ7hgbsq4AG0uQPtdQTfT4wJbqxLgX42GvFzsqLSibpDk77 XVmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723035811; x=1723640611; 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=oXLNHMQ68pz7c/GJEf2erHf2JzdL/Unxn4oy6dRp7JBrstPU8s4dgHSZlAnLs0wgMM lIyWwRDcUQ7bk7jfo4KdR5Gx5BHCnQNpEwYubnUH9itfT/O+CXh97LMEIau7Ua5qlBmc 6GMzaIsbjdJN9tG8sI1osPTfwQmde49T8xxTOZK/+qHMNTNRs2B6+1ghgEC40H42kNca eWah8r8NStSylJC6Yq6DTgu+BjUHFIGE/4D4JHRXgx7MO7/Ptm9QyS+QLsH1frZCtf/V k2bqry1UpY+9hjxrZdNvfrvQYUapUJitn1sgdOYE460G6alcqmnErTDSml6TEZ5wo3IA 86KA== X-Gm-Message-State: AOJu0YxH3DYP8lsu+Kg7vAHA+mHKpFW1VVIGx/Hvt3Cu9DmtmhBZ0KC4 dLgBJSzPPHMhxQIy4IK4x2Jr27MPH28T7ry0Ie8zLfcUcKDKdmb6iJ4LvujH X-Google-Smtp-Source: AGHT+IF6F799KFr85zezVczUUjtygpB8PVwjwd9CWpY34DF210BMkKnl/eZL3DSZmpNWD+3qQ/bWIw== X-Received: by 2002:a2e:8609:0:b0:2ec:55b5:ed45 with SMTP id 38308e7fff4ca-2f15aac36d2mr120125681fa.24.1723035810655; Wed, 07 Aug 2024 06:03:30 -0700 (PDT) Received: from abdobngad.. ([154.182.238.58]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-429057968d8sm29196825e9.9.2024.08.07.06.03.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Aug 2024 06:03:30 -0700 (PDT) From: AbdAlRahman Gad To: git@vger.kernel.org Cc: AbdAlRahman Gad Subject: [PATCH v5 3/8] t7004: do not prepare things outside test_expect_success Date: Wed, 7 Aug 2024 15:58:39 +0300 Message-ID: <20240807130259.28381-4-abdobngad@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240807130259.28381-1-abdobngad@gmail.com> References: <20240807130259.28381-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 Wed Aug 7 12:58:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AbdAlRahman Gad X-Patchwork-Id: 13756224 Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.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 976E71E6758 for ; Wed, 7 Aug 2024 13:03:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723035815; cv=none; b=RaR+ARCGQ0jaw5bc1PQVGRYGacF8nI4GDWk2jlFFNEUxzLK0Bhelu08a7AO2sOcBXQ6ZYs7ieCzoklXOgOTMGrlLd467K2BKH1vzupDMDUQVONn0R6DdIazqukXAwpZJOo24SR8znNca0gee0XthVTfSnuyZzgwHw6TY+WjcK/M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723035815; c=relaxed/simple; bh=oFYS2aOLX0gtC4AdpzGUage+IULhVMWpeCmmgC2RoFk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=AOLT6E0CG+NJ3lGZCl7Lrjc+PgXZQ6Qft8vmZJQOf6Mok3Y+ediOh33yNFiplGktpjtrR1bI/s/r6uzNjJNdXsLywZ7NWuARBh5jXrx/ob8qhdUjXPLi/ErzxTq/M64tXend2GJBipyBvmhA+HtI5+p4vHnJJitXAYEbsTepAgw= 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=HScZOAN2; arc=none smtp.client-ip=209.85.128.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="HScZOAN2" Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-4280b3a7efaso11918445e9.0 for ; Wed, 07 Aug 2024 06:03:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723035812; x=1723640612; 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=HScZOAN2+rrN8RYbxJNRnFZT7KPcyoNaC3GXRSzo2cFEo8Y3ejQOByjIj3raEEIfMu 1WdfapJAX1OL/ZJjAmtlh/mU1dqXV3U3D7XNi/TZM7TIQ7jEYB881EyoWcNuT++EZEot RIU8Y+GKzR8Wv2fXtSelyTWYZWNlv2HlfO1MxedAu5UJYxuOAOojIhRclvhWwez+nMBH alb3OL29ZoJRpYT17lnkAQEo47YmBVLiGOnyE7yA/Np0n/P+PDxpN0lC063nbGJGtben 0aJ5Lcot00IZZ/Tkb63ngFYVbXAnGrzAQxla+ZGMxPJTJilyaBAVvBt9+AmOsJSWIhwc sz+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723035812; x=1723640612; 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=xHkKbSRuzxgOJNckAJm9E5ES0gKNBLyc51BlObvrutq0fVFi3fYfeRr1LBwpW6cWPq rlFaxBA0ZtaZN6JDWgeaOXwgq5GCrj1vOjTD3n4fly52iRZm04+oobDJ+2Wbs3loXH9S jIP4NqvVly1Jj1RnYpwQvHpC+US2ePEqIMPUIXrMufpO/CabxqmdHGzYb9UUds1CPA/3 vCX7r8IXuzZ4gaq7Z/MjcrWSzSu7IpJa4Qo3eE03pcFWrsjql3urd/7MfeIwLCR2Nvo+ HJqB4HVfcDEGWEiTKi/Du8JIjtvydFU0oioyS68CGF37oApJTexgR0UukGOskF60N9sC d7vw== X-Gm-Message-State: AOJu0YyjACONUdbLlMeQN7g5fnve1Iu23B4XXd3i8tM4oTQBo1oHNysm ex4VFCEigmkE1m09TZLKbNYX0Im7SjOEV5d/9o4lrwKgD8t9VRWSJ1YtJlMf X-Google-Smtp-Source: AGHT+IHVjrlLSQK+YqVwpbXnSmxBvunJMGTi9K8WNwmkrg+/4gqwWnYOYm2JDUeaOIdOPobwrev6gA== X-Received: by 2002:a05:600c:1393:b0:426:65bf:5cc2 with SMTP id 5b1f17b1804b1-428e6af1af1mr129201455e9.1.1723035811469; Wed, 07 Aug 2024 06:03:31 -0700 (PDT) Received: from abdobngad.. ([154.182.238.58]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-429057968d8sm29196825e9.9.2024.08.07.06.03.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Aug 2024 06:03:31 -0700 (PDT) From: AbdAlRahman Gad To: git@vger.kernel.org Cc: AbdAlRahman Gad Subject: [PATCH v5 4/8] t7004: use indented here-doc Date: Wed, 7 Aug 2024 15:58:40 +0300 Message-ID: <20240807130259.28381-5-abdobngad@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240807130259.28381-1-abdobngad@gmail.com> References: <20240807130259.28381-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 Wed Aug 7 12:58:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AbdAlRahman Gad X-Patchwork-Id: 13756226 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 C01B81E7A2D for ; Wed, 7 Aug 2024 13:03:34 +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=1723035817; cv=none; b=WQsevMJEMqIqt3K/jnCH0CwVVhFSC0VoyKAtq8qmp5GWgNfG4U5rQCQgv70N2hbRPVaz+mY95GCasb52Mk58n/Wjm5yYZCxQuqcFGrAyDMhoXB/SnoROuWBY7uW9aOa3FyNVIuquKSOvfvc8DesGtcs/9XToTTq0w7fX1HImGag= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723035817; c=relaxed/simple; bh=MsrH1E/WGU6noklHawkX+POBlnScUaB1qnS13SbDS40=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=m5BnjwZJDERcdsNmCOF8A0pJE2jRtvckZBfxm6bDVszL0/yViTcatASDVUYoUjuOp+rXQkPL21Uou7CV2jOlZhHsBDS61dE4274jbMwmCsz3VtkJD/GcCgAONezyj6L9n7WmSfwOJDjPaiLdWXGwMm1BwsJVE6fdUoQO/Wt/QXc= 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=Gg320MvQ; 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="Gg320MvQ" Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-428e3129851so12172385e9.3 for ; Wed, 07 Aug 2024 06:03:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723035813; x=1723640613; 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=Gg320MvQji3MmjGEqW0aCs+qorT4cnLXXlUBpAAXr1H5NXojWflreREfJmHWIDz1GP 0clr8Lfjl5o8KxTvV75MCdseJTmuRO9nkcHrLPv0+mrMYXdrq75AbmXrn++Y66ssbS7l nyS90vwWQJxo/rdsiIDR6p0rvKDkYfhjuQkohgc9eQVc6b+VsXD30hZfedG36RPxbhzn fQO9DqOwICljxrwgn516/T52MVvqEmxSlGKbsgGTrDfyor2AdF89A/7Xs0DIxg4sMVsf O1IdU4eo6N/xLNdhXrjJBfO9hVLjse5ZbidIRhc4TTJqY58hiihtDFi064Y9K8Qo7ckc qo+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723035813; x=1723640613; 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=QxJ6qbgxcF11cLh8gp1R1wNwlO4rfGwV7SqzBRRS2x/UwSr/AHxrjVWRuNwP2MuJts i4LVEQGWrGbgkKOavJrkqS8XjWH1ty9T9a2dU+K6yyMJ1SzcVLD0XeRo56DF32JYgeja BpeMiB4fy0V/i2tOf8K9ZTwHbALMwQZl2CmLeFBW0Tq5pFUWlKcwJU9QubR8WBB8krmM YmoKS5cAgTl8gwcdpP9/NXHfZOW5OPCLnIih/WxYpOwMP/XR1CggKTQ5GFKukI8GmAn8 ldJFpoqEGpIHMJcc8lzNc1GM4LP1i3KGWvX5JVqTygUvdySBiRSBc2M1lkL9XpGFkox4 c3vg== X-Gm-Message-State: AOJu0YwhlxQb3Tfy0Z4yiT73ceqHwN4UP7uMC6n3Fb+54b+WUraNiA4M /LjoZZwLk5MpE2M2b3UNjqLaPmbdcoYH4aVQXyzWsLDIogoCqQ02ZbTXmDUX X-Google-Smtp-Source: AGHT+IErYeA2ROAKgREzO7XkiARqIY0mFU7ixiewjvzDBBsgDLOhGD/jjJNbtJnuWptWKihG57gjig== X-Received: by 2002:a05:600c:1f90:b0:427:fa39:b0db with SMTP id 5b1f17b1804b1-428e6b7b54amr131089345e9.27.1723035812501; Wed, 07 Aug 2024 06:03:32 -0700 (PDT) Received: from abdobngad.. ([154.182.238.58]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-429057968d8sm29196825e9.9.2024.08.07.06.03.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Aug 2024 06:03:32 -0700 (PDT) From: AbdAlRahman Gad To: git@vger.kernel.org Cc: AbdAlRahman Gad Subject: [PATCH v5 5/8] t7004: description on the same line as test_expect_success Date: Wed, 7 Aug 2024 15:58:41 +0300 Message-ID: <20240807130259.28381-6-abdobngad@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240807130259.28381-1-abdobngad@gmail.com> References: <20240807130259.28381-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 Wed Aug 7 12:58:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AbdAlRahman Gad X-Patchwork-Id: 13756227 Received: from mail-lj1-f170.google.com (mail-lj1-f170.google.com [209.85.208.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 46EC31E7A37 for ; Wed, 7 Aug 2024 13:03:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723035818; cv=none; b=hrIb6CReQDfkMzh5cSoKRVpR2UjnyNETEFoYUz9+SWojCeEqfUVxlseVFvA2i5km5Q7gM8RXkvJg9ssoNZFI0fL3KHIQaHjq+vlWliJI6ZbcUTU67qJopMMhuJqMv5ZdXMG2+UEFRxWzjQiIG7iDqbn/VkQ/Xhafjc7RyiHaPQ8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723035818; c=relaxed/simple; bh=TqxR93We0Jzw3S+HgfcmOstzB9/095t878nhZEiDQEA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ibDVtV5IUNFxvGX1SspjRCBeD6uJyZTiUhikYoOicL4LjLKTL9HmU0cSA15taq7lfSuLBKR87qarSjEgf8cmAji5sF6etfe0X33iOL8G5ENtidDuPt1cm7OxjsJ1pfC4A3jy6xYpqP40d1Ns1FUdMJl7w9XQ4gD4RbagwP4Fwe8= 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=bHf3BzPm; arc=none smtp.client-ip=209.85.208.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bHf3BzPm" Received: by mail-lj1-f170.google.com with SMTP id 38308e7fff4ca-2f032cb782dso16535841fa.3 for ; Wed, 07 Aug 2024 06:03:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723035814; x=1723640614; 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=bHf3BzPm/+fJahbWeFh6setyYWMT2HcgcL7JsxNH/jDEZK0bqoqAHXATuy69y7+cb4 HvLdhvS4vy2VatjZFInmLS7hneS9pRjsbV9ZamldLl/jlLSFF1iPhC3DYIuP9B+xInyg NtGxT54fu6wMgbmfT5aOPwNnVoYzpVre4TPMy5+o7YQXxW0yJAHFHNFESyASu9aMZMzY zVFe79PGP3iG5yfywWcdK9y5dW4/bri2VT2jH7mbioFbDvyXLZIB43NY5ewZ93pI6y6o xsdJ6spV4dLXT9e4Gu7zzOdo7CX5KlNWU8hnF7WzxGg+bSZOQPyo/Ytj+i8n6hiR2+lp uyMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723035814; x=1723640614; 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=YPPDouyinU2wHnLOdWtKcuZ8M75C3exyVkdELtruIMQwy6TlYaHDWSGcpDCyD/DkJy 3ny3Ih56DMbB9CP+P/J4FCWElfeML+OUOgAhf3Ll7dQ65cnSy7v1V2HQaKi70+QBN7CN JBig2dByub6OMuBAiaYiUOhq8U53sImsUoUUHS23ib9g60z9udA9wunyVWqBwGr/kseJ Zc9yIHggAAdKHd1prhXKShjh0bHk5aQGl031C9FIahGQJwnzMs1uOfsrfgiVFytFWWvq LiYwCxDwEl3zwGrrcc+wE/jEEYGzQX+T/0CALo0IK3phwCDeoOWPJTgdcmKkkpay6dKo Sfvg== X-Gm-Message-State: AOJu0YzH3DR9sDQwbdGodYYDva4p0wo4P2blOoLSOm3MXY/AC2JKsBOJ iYXr+YPTJ51Z7jx53WgkT8p11hvQY0umfcKYdr6rrLBpTQHBXMd9qRjfgrAu X-Google-Smtp-Source: AGHT+IHw+zoz9URkk720L9cP7fN/sllRERjC7J8dTyNKZPgieQuCKZepqDFwaeXBhQ5PZWkhtksn7A== X-Received: by 2002:a2e:3305:0:b0:2ef:2006:bfb1 with SMTP id 38308e7fff4ca-2f15aa934cfmr131862731fa.15.1723035813690; Wed, 07 Aug 2024 06:03:33 -0700 (PDT) Received: from abdobngad.. ([154.182.238.58]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-429057968d8sm29196825e9.9.2024.08.07.06.03.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Aug 2024 06:03:33 -0700 (PDT) From: AbdAlRahman Gad To: git@vger.kernel.org Cc: AbdAlRahman Gad Subject: [PATCH v5 6/8] t7004: test description and test body seperated with backslash Date: Wed, 7 Aug 2024 15:58:42 +0300 Message-ID: <20240807130259.28381-7-abdobngad@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240807130259.28381-1-abdobngad@gmail.com> References: <20240807130259.28381-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 Wed Aug 7 12:58:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AbdAlRahman Gad X-Patchwork-Id: 13756228 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 088211E7A40 for ; Wed, 7 Aug 2024 13:03:36 +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=1723035818; cv=none; b=se2/ml/+JrQ/hOx4H9VhFqW8WS+a6RvuMRnreWGmlJDEogCPUJZrENoqw1XdxA/AuVx5ST15yo5wJgWBmD2XZKOKt+LRsKHwW51MZyZABG/w2BI6el6JvQO6x2KIZKgjl3ELXBpK0sZtofB1ZJ9+4cmE0qpACnAciHTrDGFMRBk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723035818; c=relaxed/simple; bh=BoQ0IAUos8x1kUByUP+3xBErycbQy5BCQM9YfcvaZBQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=emBCHTbEitZpAlqag1FqgxVjnf67XrZo6O3wZ7SgAw9uFQWvT/3+LwTdmTKoswujg7rsTzo49LqlHuBAigsCs7aryahg48ygI41U6vFZFQ3OMm+TX7xLyRfblS9nj8aXEo2vwo0ZKaZjMZAqsgxI0fYV+fvVHskCD9obHKombwQ= 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=lgOrBuTd; 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="lgOrBuTd" Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-428119da952so11977125e9.0 for ; Wed, 07 Aug 2024 06:03:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723035815; x=1723640615; 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=lgOrBuTdlJseOPjfxFGknM+Hpun2FZy8AsgoH4qfcayyW/MBUiowCqj3Zc1tFUQyLy fKrw8XiG/r6zgh0AzPabzgONWfPs+wAIxIl1ZP6w2KnafTGvDQW/v2x4CrCW0qKRoTU6 x2C63LKg/Lr6emMYBRauxxJVAv6VYaxmLAKZQIUrhDwh2/tpAtlNiZhEtvrvCzJ+AQMd GCBWVE0ZBjtd+SlsdmxwJH8YHF71x2u7l4jGcFFtTHzotEQBKTkzvosNuuF45Ha0Vsk0 SqlSYOiq30S4N288W2sQpMxUIzz4VLBLBool3dyudZSNPjIcAbrVUDHcloIHPyYEroiN nMTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723035815; x=1723640615; 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=G14GX7RZrXf0PRAU6y+9N3HM4dkwiJC8pNC9ft2DpWDG06mjY24pauShiSVeB7C4zp uKvXM5fICiywTv7B8ijQ0nTIVLixax+RCBZiFEbEOZh3FJ66NBCBVglnPzyfYrxUhjHV G6DKbU7VjPxACBhW4+RwaofeMd3N7lU2L3dLeJaNuyVhYJsNqzI9+Pf4XigB3iamp76Z Hcj/HTrpiTw/eKYeqNA/gkKKchx3A8O3vXE534hIIKmb/KBH3TMNi/4rLW8SZR7wYElh UzZtjqsHL5mKihJe0hKhoJEIhIV+4UxJoUA0JTMp0QP4d7s2vJ/uIhhlKx7ABTGWpvr6 SWrQ== X-Gm-Message-State: AOJu0YyPoxkbu0L2tQou2KIYQJ2C7S0zSRPby0Hm3yURRHiRy3KA3Xbs cRkOifpHlfSfHVj7obWL0YdtrOv5E2Uj1bSClnUQWjZoXcDZsHIXWVgNNATJ X-Google-Smtp-Source: AGHT+IHA0cVSkvFQxhsz45bq94UYBFFoOUhDvSR4ke6AKnGMI050ZiplSA3W0dDcBrkctsFrwTCJSQ== X-Received: by 2002:a05:600c:d5:b0:426:62a0:eb6b with SMTP id 5b1f17b1804b1-428e6b04666mr127820285e9.13.1723035814567; Wed, 07 Aug 2024 06:03:34 -0700 (PDT) Received: from abdobngad.. ([154.182.238.58]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-429057968d8sm29196825e9.9.2024.08.07.06.03.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Aug 2024 06:03:34 -0700 (PDT) From: AbdAlRahman Gad To: git@vger.kernel.org Cc: AbdAlRahman Gad Subject: [PATCH v5 7/8] t7004: use single quotes instead of double quotes Date: Wed, 7 Aug 2024 15:58:43 +0300 Message-ID: <20240807130259.28381-8-abdobngad@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240807130259.28381-1-abdobngad@gmail.com> References: <20240807130259.28381-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 Wed Aug 7 12:58:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AbdAlRahman Gad X-Patchwork-Id: 13756229 Received: from mail-lj1-f177.google.com (mail-lj1-f177.google.com [209.85.208.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 064C34AEE5 for ; Wed, 7 Aug 2024 13:03:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723035819; cv=none; b=FgAadqyvHw2xLJbkoyNDHT9sqCsxL9ht1sl7yPhckw2CDrOLfvYC4n2NZXyeVp2HnKeu1rgNZwgrjMibFdCD2RpO6wOJjxibm3dTUDWhi4YStLUpakynWywldr8uABX52HlYg20o26DBkO/ijMbJiEEX/xGgJN1Z72ILVAy3Q3I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723035819; c=relaxed/simple; bh=82LBgI+r1uoEbXpHhpXqwtsjlfx4Tj7PQr2ZiAaFQLc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ca56NZ6N4b2zh2650Djln8de/0Y0mvqaQBJkV+KKITIN+AOJZR3XxhPWLVIIDtzGyOYAmOa9vFjehp2Grho6J2Hfd0t+WvSqLks2UWH6fDQMG7Vvougb3P3pO3KC7SrcwS41UW41WjtoNipD2IGFKdZEMskrburryP4UDy/9mFY= 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=bJryUXOq; arc=none smtp.client-ip=209.85.208.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bJryUXOq" Received: by mail-lj1-f177.google.com with SMTP id 38308e7fff4ca-2eeb1ba040aso26597501fa.1 for ; Wed, 07 Aug 2024 06:03:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723035816; x=1723640616; 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=bJryUXOqWH5Ct5t7ggLLI/pNRwLq3eeLHebAnC8y5Bfc4YmUVqxBVf17hMDfy7D5QE P0cTxNX5y6D36tYRA7nDs8C6wBR6ZUl+ddA4J5rswodQlNgkQyYVqd3IHKLRoYzcrstH LtNu22RG3n6MA9aeQOCmKszVQNEjeIApcdwEDDEh2ZX0RyprAX77RS9HD7wgjT342Sve gMn4WU/dJ8jzgBDnfu71D87tLrsi0HS3/aBb6HYO4aRivTvXR4js0GpghNcAlFiHKMJs 6aCxbxODpIxC1DR8Ro481yx8BHYy5LXQLAfKm7aGrKjQ/Zj84hCFawJITNRo7zWRX9QP t9XA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723035816; x=1723640616; 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=LFPuJ7GXY68DuWpmoRj6JetHiRoKfhVo9qT1JvHp1A4WArlFd++VON7l2ojdSdPUG9 1AVok0B/YD4guNfKZ5nk+hEnKaTPx9PeYYM0i0LIqX5m3FNaGCg4L58vJ/UHHEvXdYiX w+6FHJnv9UOUaWxzMydVHWCOr4/IB3eAuOToVXmd8zyvSEoMhE5ySUdjSOwcCU13e9wU cpH+stf1ZX5X3/t/PhZTo/OgTGvgSBLepYn6Rr9pgJgL12E/tQwAhCbtLIvfe8WIj3xb 3QyIAhVGb4yurRumq7p5zAfJJa+UCgpThBrG09+6+9DLYk+lUryA903604wHtbZflbXK N+6w== X-Gm-Message-State: AOJu0YwBHm3iP+taw8fTtwBmIvK9yMCkcx5lPcEm/T9e1s2r9L2QYY6P psEnR1iF1Enk4eybb0Kp/MJDhNcNav0CkbBDMWWqK8NZBl4b7igK8lLoSV9N X-Google-Smtp-Source: AGHT+IElSG4A/KplUOljxJgf2+IiJ7a3BMc2sD7BI9CGb3w8j5RpCiGJUZvZ3K+Ff8SbmOhYmh5KdA== X-Received: by 2002:a2e:9cc9:0:b0:2ef:259f:a569 with SMTP id 38308e7fff4ca-2f15aa872a4mr130087051fa.15.1723035815409; Wed, 07 Aug 2024 06:03:35 -0700 (PDT) Received: from abdobngad.. ([154.182.238.58]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-429057968d8sm29196825e9.9.2024.08.07.06.03.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Aug 2024 06:03:35 -0700 (PDT) From: AbdAlRahman Gad To: git@vger.kernel.org Cc: AbdAlRahman Gad Subject: [PATCH v5 8/8] t7004: make use of write_script Date: Wed, 7 Aug 2024 15:58:44 +0300 Message-ID: <20240807130259.28381-9-abdobngad@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240807130259.28381-1-abdobngad@gmail.com> References: <20240807130259.28381-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 &&