From patchwork Tue Aug 20 07:18:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Denton Liu X-Patchwork-Id: 11103037 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4707D174A for ; Tue, 20 Aug 2019 07:18:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1C8EA22CF4 for ; Tue, 20 Aug 2019 07:18:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ctP1q/jO" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729298AbfHTHSv (ORCPT ); Tue, 20 Aug 2019 03:18:51 -0400 Received: from mail-io1-f53.google.com ([209.85.166.53]:33902 "EHLO mail-io1-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729047AbfHTHSu (ORCPT ); Tue, 20 Aug 2019 03:18:50 -0400 Received: by mail-io1-f53.google.com with SMTP id s21so10107673ioa.1 for ; Tue, 20 Aug 2019 00:18:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=cn5jFarKJ6VpDNdkWy0N5jDxwa8FQX6TLwwg9G5+5dY=; b=ctP1q/jO1giB5TSkztYIfRiDCeoOevig+ZjjTp8kD9OSyMp4kKW8U6n83289dKwixH 8MBx0zbRgwmgBTHjI6+NQxggG3iLW+70SXDcG2pBNo0vkRnbXmYpifuthX3EtUqw60XE eRXzX6enCr/rb0uRQVNGc2qOXjdDVd2r53OWYRNLFzYJaFQKUuYcL4vRuMJNn2lyH0m6 O9IeQxwaeWokiENMQgB1qrHSgGek/TNvfjWmxOHMdjwty5ZmDPMdZAmiil6EPtJoTCK5 5OZa5ceH2mqlbjs0Qo7bVCFSnCH75vEOIE291QLIXyRtP8m9auxwGbWN4YoAletm5NK6 9lpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=cn5jFarKJ6VpDNdkWy0N5jDxwa8FQX6TLwwg9G5+5dY=; b=hQQrC2jEVILo71KC2EhoyyCr2SLXLpszuYSs+3+SRn3RyDx/7bhqzgGEdnq896aIdb AGTSpgVAVjsl3oyoxv0IqwM4Ggj1vQ0r//qm7u8WGYNuQYcmd28afguVMSzYFZQNxndX 0nrZ16ItZMym3s1clsGYT0v6PSpXUb8Rb7sV3nhaiF0HtgzlnbqUTbmiAoburpEdhNGf b2nwvpejDJ5ZuTLSL+7kPqZigDE8KOiQFEYwLAhUZ7FMJY4+iuiDXy1aDTcbfTnYWHSZ DOz2q5NFhRxrV2jQADS2bIPjvzfKApF0yIb2XmIaBg7JsI9JsSXafsbCS0R2zAXSF2AJ qeMw== X-Gm-Message-State: APjAAAWeyQzB9LLRoFoyJu0SvPcV0vPe6PNNZ3jjVIJ/NKzg1qW5OaFb E2yD/eo3O6RFr7BumYseQOXly62F X-Google-Smtp-Source: APXvYqzk0eOrX64Hc0utmAJGGpJFv/adU/K52aUXw6YSo/RmgmqiTWzhqXpZC9j91w84GD2qrfUBmQ== X-Received: by 2002:a02:ce49:: with SMTP id y9mr2249151jar.63.1566285528604; Tue, 20 Aug 2019 00:18:48 -0700 (PDT) Received: from archbookpro.localdomain (CPE18593399858a-CM185933998587.cpe.net.cable.rogers.com. [174.112.89.95]) by smtp.gmail.com with ESMTPSA id w6sm15076519iob.29.2019.08.20.00.18.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Aug 2019 00:18:48 -0700 (PDT) Date: Tue, 20 Aug 2019 03:18:46 -0400 From: Denton Liu To: Git Mailing List Cc: =?iso-8859-1?q?=C6var_Arnfj=F6r=F0?= Bjarmason , Junio C Hamano , Eric Sunshine Subject: [PATCH v3 01/13] t4014: drop unnecessary blank lines from test cases Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.1 (2019-06-15) Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Signed-off-by: Denton Liu --- t/t4014-format-patch.sh | 47 ----------------------------------------- 1 file changed, 47 deletions(-) diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh index ca7debf1d4..3ed3feabfe 100755 --- a/t/t4014-format-patch.sh +++ b/t/t4014-format-patch.sh @@ -9,7 +9,6 @@ test_description='various format-patch tests' . "$TEST_DIRECTORY"/lib-terminal.sh test_expect_success setup ' - for i in 1 2 3 4 5 6 7 8 9 10; do echo "$i"; done >file && cat file >elif && git add file elif && @@ -60,20 +59,16 @@ test_expect_success setup ' ' test_expect_success "format-patch --ignore-if-in-upstream" ' - git format-patch --stdout master..side >patch0 && cnt=$(grep "^From " patch0 | wc -l) && test $cnt = 3 - ' test_expect_success "format-patch --ignore-if-in-upstream" ' - git format-patch --stdout \ --ignore-if-in-upstream master..side >patch1 && cnt=$(grep "^From " patch1 | wc -l) && test $cnt = 2 - ' test_expect_success "format-patch --ignore-if-in-upstream handles tags" ' @@ -85,7 +80,6 @@ test_expect_success "format-patch --ignore-if-in-upstream handles tags" ' ' test_expect_success "format-patch doesn't consider merge commits" ' - git checkout -b slave master && echo "Another line" >>file && test_tick && @@ -101,7 +95,6 @@ test_expect_success "format-patch doesn't consider merge commits" ' ' test_expect_success "format-patch result applies" ' - git checkout -b rebuild-0 master && git am -3 patch0 && cnt=$(git rev-list master.. | wc -l) && @@ -109,7 +102,6 @@ test_expect_success "format-patch result applies" ' ' test_expect_success "format-patch --ignore-if-in-upstream result applies" ' - git checkout -b rebuild-1 master && git am -3 patch1 && cnt=$(git rev-list master.. | wc -l) && @@ -117,26 +109,19 @@ test_expect_success "format-patch --ignore-if-in-upstream result applies" ' ' test_expect_success 'commit did not screw up the log message' ' - git cat-file commit side | grep "^Side .* with .* backslash-n" - ' test_expect_success 'format-patch did not screw up the log message' ' - grep "^Subject: .*Side changes #3 with .* backslash-n" patch0 && grep "^Subject: .*Side changes #3 with .* backslash-n" patch1 - ' test_expect_success 'replay did not screw up the log message' ' - git cat-file commit rebuild-1 | grep "^Side .* with .* backslash-n" - ' test_expect_success 'extra headers' ' - git config format.headers "To: R E Cipient " && git config --add format.headers "Cc: S E Cipient @@ -145,22 +130,18 @@ test_expect_success 'extra headers' ' sed -e "/^\$/q" patch2 > hdrs2 && grep "^To: R E Cipient \$" hdrs2 && grep "^Cc: S E Cipient \$" hdrs2 - ' test_expect_success 'extra headers without newlines' ' - git config --replace-all format.headers "To: R E Cipient " && git config --add format.headers "Cc: S E Cipient " && git format-patch --stdout master..side >patch3 && sed -e "/^\$/q" patch3 > hdrs3 && grep "^To: R E Cipient \$" hdrs3 && grep "^Cc: S E Cipient \$" hdrs3 - ' test_expect_success 'extra headers with multiple To:s' ' - git config --replace-all format.headers "To: R E Cipient " && git config --add format.headers "To: S E Cipient " && git format-patch --stdout master..side > patch4 && @@ -170,7 +151,6 @@ test_expect_success 'extra headers with multiple To:s' ' ' test_expect_success 'additional command line cc (ascii)' ' - git config --replace-all format.headers "Cc: R E Cipient " && git format-patch --cc="S E Cipient " --stdout master..side | sed -e "/^\$/q" >patch5 && grep "^Cc: R E Cipient ,\$" patch5 && @@ -178,7 +158,6 @@ test_expect_success 'additional command line cc (ascii)' ' ' test_expect_failure 'additional command line cc (rfc822)' ' - git config --replace-all format.headers "Cc: R E Cipient " && git format-patch --cc="S. E. Cipient " --stdout master..side | sed -e "/^\$/q" >patch5 && grep "^Cc: R E Cipient ,\$" patch5 && @@ -186,14 +165,12 @@ test_expect_failure 'additional command line cc (rfc822)' ' ' test_expect_success 'command line headers' ' - git config --unset-all format.headers && git format-patch --add-header="Cc: R E Cipient " --stdout master..side | sed -e "/^\$/q" >patch6 && grep "^Cc: R E Cipient \$" patch6 ' test_expect_success 'configuration headers and command line headers' ' - git config --replace-all format.headers "Cc: R E Cipient " && git format-patch --add-header="Cc: S E Cipient " --stdout master..side | sed -e "/^\$/q" >patch7 && grep "^Cc: R E Cipient ,\$" patch7 && @@ -201,40 +178,34 @@ test_expect_success 'configuration headers and command line headers' ' ' test_expect_success 'command line To: header (ascii)' ' - git config --unset-all format.headers && git format-patch --to="R E Cipient " --stdout master..side | sed -e "/^\$/q" >patch8 && grep "^To: R E Cipient \$" patch8 ' test_expect_failure 'command line To: header (rfc822)' ' - git format-patch --to="R. E. Cipient " --stdout master..side | sed -e "/^\$/q" >patch8 && grep "^To: \"R. E. Cipient\" \$" patch8 ' test_expect_failure 'command line To: header (rfc2047)' ' - git format-patch --to="R Ä Cipient " --stdout master..side | sed -e "/^\$/q" >patch8 && grep "^To: =?UTF-8?q?R=20=C3=84=20Cipient?= \$" patch8 ' test_expect_success 'configuration To: header (ascii)' ' - git config format.to "R E Cipient " && git format-patch --stdout master..side | sed -e "/^\$/q" >patch9 && grep "^To: R E Cipient \$" patch9 ' test_expect_failure 'configuration To: header (rfc822)' ' - git config format.to "R. E. Cipient " && git format-patch --stdout master..side | sed -e "/^\$/q" >patch9 && grep "^To: \"R. E. Cipient\" \$" patch9 ' test_expect_failure 'configuration To: header (rfc2047)' ' - git config format.to "R Ä Cipient " && git format-patch --stdout master..side | sed -e "/^\$/q" >patch9 && grep "^To: =?UTF-8?q?R=20=C3=84=20Cipient?= \$" patch9 @@ -249,7 +220,6 @@ check_patch () { } test_expect_success 'format.from=false' ' - git -c format.from=false format-patch --stdout master..side | sed -e "/^\$/q" >patch && check_patch patch && @@ -257,7 +227,6 @@ test_expect_success 'format.from=false' ' ' test_expect_success 'format.from=true' ' - git -c format.from=true format-patch --stdout master..side | sed -e "/^\$/q" >patch && check_patch patch && @@ -265,7 +234,6 @@ test_expect_success 'format.from=true' ' ' test_expect_success 'format.from with address' ' - git -c format.from="F R Om " format-patch --stdout master..side | sed -e "/^\$/q" >patch && check_patch patch && @@ -273,7 +241,6 @@ test_expect_success 'format.from with address' ' ' test_expect_success '--no-from overrides format.from' ' - git -c format.from="F R Om " format-patch --no-from --stdout master..side | sed -e "/^\$/q" >patch && check_patch patch && @@ -281,7 +248,6 @@ test_expect_success '--no-from overrides format.from' ' ' test_expect_success '--from overrides format.from' ' - git -c format.from="F R Om " format-patch --from --stdout master..side | sed -e "/^\$/q" >patch && check_patch patch && @@ -289,7 +255,6 @@ test_expect_success '--from overrides format.from' ' ' test_expect_success '--no-to overrides config.to' ' - git config --replace-all format.to \ "R E Cipient " && git format-patch --no-to --stdout master..side | @@ -299,7 +264,6 @@ test_expect_success '--no-to overrides config.to' ' ' test_expect_success '--no-to and --to replaces config.to' ' - git config --replace-all format.to \ "Someone " && git format-patch --no-to --to="Someone Else " \ @@ -311,7 +275,6 @@ test_expect_success '--no-to and --to replaces config.to' ' ' test_expect_success '--no-cc overrides config.cc' ' - git config --replace-all format.cc \ "C E Cipient " && git format-patch --no-cc --stdout master..side | @@ -321,7 +284,6 @@ test_expect_success '--no-cc overrides config.cc' ' ' test_expect_success '--no-add-header overrides config.headers' ' - git config --replace-all format.headers \ "Header1: B E Cipient " && git format-patch --no-add-header --stdout master..side | @@ -331,7 +293,6 @@ test_expect_success '--no-add-header overrides config.headers' ' ' test_expect_success 'multiple files' ' - rm -rf patches/ && git checkout side && git format-patch -o patches/ master && @@ -594,7 +555,6 @@ test_expect_success 'thread config + --no-thread' ' ' test_expect_success 'excessive subject' ' - rm -rf patches/ && git checkout side && before=$(git hash-object file) && @@ -622,7 +582,6 @@ test_expect_success 'cover-letter inherits diff options' ' ! grep "file => foo .* 0 *\$" 0000-cover-letter.patch && git format-patch --cover-letter -1 -M && grep "file => foo .* 0 *\$" 0000-cover-letter.patch - ' cat > expect << EOF @@ -636,11 +595,9 @@ cat > expect << EOF EOF test_expect_success 'shortlog of cover-letter wraps overly-long onelines' ' - git format-patch --cover-letter -2 && sed -e "1,/A U Thor/d" -e "/^\$/q" < 0000-cover-letter.patch > output && test_cmp expect output - ' cat > expect << EOF @@ -656,13 +613,11 @@ index $before..$after 100644 EOF test_expect_success 'format-patch respects -U' ' - git format-patch -U4 -2 && sed -e "1,/^diff/d" -e "/^+5/q" \ <0001-This-is-an-excessively-long-subject-line-for-a-messa.patch \ >output && test_cmp expect output - ' cat > expect << EOF @@ -679,11 +634,9 @@ index $before..$after 100644 EOF test_expect_success 'format-patch -p suppresses stat' ' - git format-patch -p -2 && sed -e "1,/^\$/d" -e "/^+5/q" < 0001-This-is-an-excessively-long-subject-line-for-a-messa.patch > output && test_cmp expect output - ' test_expect_success 'format-patch from a subdirectory (1)' ' From patchwork Tue Aug 20 07:18:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denton Liu X-Patchwork-Id: 11103041 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 739561399 for ; Tue, 20 Aug 2019 07:18:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 490F622CF4 for ; Tue, 20 Aug 2019 07:18:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="XbJyk9e/" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729326AbfHTHSx (ORCPT ); Tue, 20 Aug 2019 03:18:53 -0400 Received: from mail-io1-f68.google.com ([209.85.166.68]:38142 "EHLO mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729047AbfHTHSw (ORCPT ); Tue, 20 Aug 2019 03:18:52 -0400 Received: by mail-io1-f68.google.com with SMTP id p12so7640661iog.5 for ; Tue, 20 Aug 2019 00:18:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=ZMJgUQj6PsL1h4340jQxou3fRQCVPRyij40y0ivGSrs=; b=XbJyk9e/4Z+GyaH+j2Z48YQLXT9KPVhrxD9FiXuIRovExcXiHY+5tp9VbdVIYCnzCB aomOEYb6Jyg+tMRorkKHN4Sob8mw3LAfk7x5wRgCCR+Kh4KUI+3LjZEaTJLEvBBfS2JH ljCZcs/f0Y9RW+dyzb1WdIXwqpOhjJqolIdQtHmdgblS2z79wpYb+FQiU8zR/EFLdvId FiVfmmo85/u4mY5D8N5Jg4N+2tS7vk84Zi5R4sD35pQhsOkLyNIIqQdRz0nwAMZ9QP94 +qhKHOi3RVFYqfyRHkTr0o07KwM46YjJcpIT2j3hHUjeM2Zkr0XSGnNvdLZ8KAGCXTvp UVVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=ZMJgUQj6PsL1h4340jQxou3fRQCVPRyij40y0ivGSrs=; b=cudSOPm7qplFAjJuQBkjQyt4ScQGZy6Bx4IrAzbo8MPWF7n1P4IuGWY4kpYQI4/+PO h0/CZwXmAqGdXgaNROSGPrCFPMZDb5kPs4FBaHKEgJ3dsMhc1T32oQ0gydULRh0cEkDQ dfqZTyxmO2FXOz8xmB+SisQ3z2o/M5skCtnU3/Slx1Awbww9Na2Kcr2GkKwxTNgxFTI7 Vw9NDFZnNtNTR5lUXm2Ejg/vvDZ2PLw40WOPa8FvJf6A6QO8WUR5J8WNPcQNezUkIRtV lLq+nVk7L0MPlUiDXaNCqDSmZw+TMVRnR5jPxYncysqb5dwIGJmotR1BhJMReKIe1fzK qEJQ== X-Gm-Message-State: APjAAAXxZJWb/NYHg+MJKCE4HAdmhAuEdBffItraIqlb8+5nI2LFeN4i X5XXVBAD+pq6qSFJhcfu47JId3+F X-Google-Smtp-Source: APXvYqwqzFBjZ9xMNIk2dxxPDd2Jpq3zK5Bc17GADDWvqG9VwFMLCweQ/1GNByDQvue/jJ54fvuOFQ== X-Received: by 2002:a05:6638:a12:: with SMTP id 18mr2098865jan.123.1566285531197; Tue, 20 Aug 2019 00:18:51 -0700 (PDT) Received: from archbookpro.localdomain (CPE18593399858a-CM185933998587.cpe.net.cable.rogers.com. [174.112.89.95]) by smtp.gmail.com with ESMTPSA id q3sm10954235ios.70.2019.08.20.00.18.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Aug 2019 00:18:50 -0700 (PDT) Date: Tue, 20 Aug 2019 03:18:48 -0400 From: Denton Liu To: Git Mailing List Cc: =?iso-8859-1?q?=C6var_Arnfj=F6r=F0?= Bjarmason , Junio C Hamano , Eric Sunshine Subject: [PATCH v3 02/13] t4014: s/expected/expect/ Message-ID: <568b3a03a08faf109220aff47c1fd3e68fde3bfe.1566285151.git.liu.denton@gmail.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.1 (2019-06-15) Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org For test cases, the usual convention is to name expected output files "expect", not "expected". Replace all instances with "expected" with "expect" except for one case where the "expected" is used as the name of a test case. Signed-off-by: Denton Liu --- t/t4014-format-patch.sh | 106 ++++++++++++++++++++-------------------- 1 file changed, 53 insertions(+), 53 deletions(-) diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh index 3ed3feabfe..62f5680f05 100755 --- a/t/t4014-format-patch.sh +++ b/t/t4014-format-patch.sh @@ -1209,32 +1209,32 @@ append_signoff() test_expect_success 'signoff: commit with no body' ' append_signoff actual && - cat <<\EOF | sed "s/EOL$//" >expected && + cat <<\EOF | sed "s/EOL$//" >expect && 4:Subject: [PATCH] EOL 8: 9:Signed-off-by: C O Mitter EOF - test_cmp expected actual + test_cmp expect actual ' test_expect_success 'signoff: commit with only subject' ' echo subject | append_signoff >actual && - cat >expected <<\EOF && + cat >expect <<\EOF && 4:Subject: [PATCH] subject 8: 9:Signed-off-by: C O Mitter EOF - test_cmp expected actual + test_cmp expect actual ' test_expect_success 'signoff: commit with only subject that does not end with NL' ' printf subject | append_signoff >actual && - cat >expected <<\EOF && + cat >expect <<\EOF && 4:Subject: [PATCH] subject 8: 9:Signed-off-by: C O Mitter EOF - test_cmp expected actual + test_cmp expect actual ' test_expect_success 'signoff: no existing signoffs' ' @@ -1243,24 +1243,24 @@ subject body EOF - cat >expected <<\EOF && + cat >expect <<\EOF && 4:Subject: [PATCH] subject 8: 10: 11:Signed-off-by: C O Mitter EOF - test_cmp expected actual + test_cmp expect actual ' test_expect_success 'signoff: no existing signoffs and no trailing NL' ' printf "subject\n\nbody" | append_signoff >actual && - cat >expected <<\EOF && + cat >expect <<\EOF && 4:Subject: [PATCH] subject 8: 10: 11:Signed-off-by: C O Mitter EOF - test_cmp expected actual + test_cmp expect actual ' test_expect_success 'signoff: some random signoff' ' @@ -1271,14 +1271,14 @@ body Signed-off-by: my@house EOF - cat >expected <<\EOF && + cat >expect <<\EOF && 4:Subject: [PATCH] subject 8: 10: 11:Signed-off-by: my@house 12:Signed-off-by: C O Mitter EOF - test_cmp expected actual + test_cmp expect actual ' test_expect_success 'signoff: misc conforming footer elements' ' @@ -1292,14 +1292,14 @@ Signed-off-by: my@house Tested-by: Some One Bug: 1234 EOF - cat >expected <<\EOF && + cat >expect <<\EOF && 4:Subject: [PATCH] subject 8: 10: 11:Signed-off-by: my@house 15:Signed-off-by: C O Mitter EOF - test_cmp expected actual + test_cmp expect actual ' test_expect_success 'signoff: some random signoff-alike' ' @@ -1309,13 +1309,13 @@ subject body Fooled-by-me: my@house EOF - cat >expected <<\EOF && + cat >expect <<\EOF && 4:Subject: [PATCH] subject 8: 11: 12:Signed-off-by: C O Mitter EOF - test_cmp expected actual + test_cmp expect actual ' test_expect_success 'signoff: not really a signoff' ' @@ -1324,14 +1324,14 @@ subject I want to mention about Signed-off-by: here. EOF - cat >expected <<\EOF && + cat >expect <<\EOF && 4:Subject: [PATCH] subject 8: 9:I want to mention about Signed-off-by: here. 10: 11:Signed-off-by: C O Mitter EOF - test_cmp expected actual + test_cmp expect actual ' test_expect_success 'signoff: not really a signoff (2)' ' @@ -1341,13 +1341,13 @@ subject My unfortunate Signed-off-by: example happens to be wrapped here. EOF - cat >expected <<\EOF && + cat >expect <<\EOF && 4:Subject: [PATCH] subject 8: 10:Signed-off-by: example happens to be wrapped here. 11:Signed-off-by: C O Mitter EOF - test_cmp expected actual + test_cmp expect actual ' test_expect_success 'signoff: valid S-o-b paragraph in the middle' ' @@ -1359,7 +1359,7 @@ Signed-off-by: your@house A lot of houses. EOF - cat >expected <<\EOF && + cat >expect <<\EOF && 4:Subject: [PATCH] subject 8: 9:Signed-off-by: my@house @@ -1368,7 +1368,7 @@ EOF 13: 14:Signed-off-by: C O Mitter EOF - test_cmp expected actual + test_cmp expect actual ' test_expect_success 'signoff: the same signoff at the end' ' @@ -1379,24 +1379,24 @@ body Signed-off-by: C O Mitter EOF - cat >expected <<\EOF && + cat >expect <<\EOF && 4:Subject: [PATCH] subject 8: 10: 11:Signed-off-by: C O Mitter EOF - test_cmp expected actual + test_cmp expect actual ' test_expect_success 'signoff: the same signoff at the end, no trailing NL' ' printf "subject\n\nSigned-off-by: C O Mitter " | append_signoff >actual && - cat >expected <<\EOF && + cat >expect <<\EOF && 4:Subject: [PATCH] subject 8: 9:Signed-off-by: C O Mitter EOF - test_cmp expected actual + test_cmp expect actual ' test_expect_success 'signoff: the same signoff NOT at the end' ' @@ -1408,14 +1408,14 @@ body Signed-off-by: C O Mitter Signed-off-by: my@house EOF - cat >expected <<\EOF && + cat >expect <<\EOF && 4:Subject: [PATCH] subject 8: 10: 11:Signed-off-by: C O Mitter 12:Signed-off-by: my@house EOF - test_cmp expected actual + test_cmp expect actual ' test_expect_success 'signoff: tolerate garbage in conforming footer' ' @@ -1428,13 +1428,13 @@ Tested-by: my@house Some Trash Signed-off-by: C O Mitter EOF - cat >expected <<\EOF && + cat >expect <<\EOF && 4:Subject: [PATCH] subject 8: 10: 13:Signed-off-by: C O Mitter EOF - test_cmp expected actual + test_cmp expect actual ' test_expect_success 'signoff: respect trailer config' ' @@ -1444,13 +1444,13 @@ subject Myfooter: x Some Trash EOF - cat >expected <<\EOF && + cat >expect <<\EOF && 4:Subject: [PATCH] subject 8: 11: 12:Signed-off-by: C O Mitter EOF - test_cmp expected actual && + test_cmp expect actual && test_config trailer.Myfooter.ifexists add && append_signoff <<\EOF >actual && @@ -1459,12 +1459,12 @@ subject Myfooter: x Some Trash EOF - cat >expected <<\EOF && + cat >expect <<\EOF && 4:Subject: [PATCH] subject 8: 11:Signed-off-by: C O Mitter EOF - test_cmp expected actual + test_cmp expect actual ' test_expect_success 'signoff: footer begins with non-signoff without @ sign' ' @@ -1479,13 +1479,13 @@ Change-id: Ideadbeef Signed-off-by: C O Mitter Bug: 1234 EOF - cat >expected <<\EOF && + cat >expect <<\EOF && 4:Subject: [PATCH] subject 8: 10: 14:Signed-off-by: C O Mitter EOF - test_cmp expected actual + test_cmp expect actual ' test_expect_success 'format patch ignores color.ui' ' @@ -1604,13 +1604,13 @@ test_expect_success 'format-patch --base' ' git checkout patchid && git format-patch --stdout --base=HEAD~3 -1 | tail -n 7 >actual1 && git format-patch --stdout --base=HEAD~3 HEAD~.. | tail -n 7 >actual2 && - echo >expected && - echo "base-commit: $(git rev-parse HEAD~3)" >>expected && - echo "prerequisite-patch-id: $(git show --patch HEAD~2 | git patch-id --stable | awk "{print \$1}")" >>expected && - echo "prerequisite-patch-id: $(git show --patch HEAD~1 | git patch-id --stable | awk "{print \$1}")" >>expected && - signature >> expected && - test_cmp expected actual1 && - test_cmp expected actual2 && + echo >expect && + echo "base-commit: $(git rev-parse HEAD~3)" >>expect && + echo "prerequisite-patch-id: $(git show --patch HEAD~2 | git patch-id --stable | awk "{print \$1}")" >>expect && + echo "prerequisite-patch-id: $(git show --patch HEAD~1 | git patch-id --stable | awk "{print \$1}")" >>expect && + signature >> expect && + test_cmp expect actual1 && + test_cmp expect actual2 && echo >fail && echo "base-commit: $(git rev-parse HEAD~3)" >>fail && echo "prerequisite-patch-id: $(git show --patch HEAD~2 | git patch-id --unstable | awk "{print \$1}")" >>fail && @@ -1625,8 +1625,8 @@ test_expect_success 'format-patch --base errors out when base commit is in revis test_must_fail git format-patch --base=HEAD~1 -2 && git format-patch --stdout --base=HEAD~2 -2 >patch && grep "^base-commit:" patch >actual && - echo "base-commit: $(git rev-parse HEAD~2)" >expected && - test_cmp expected actual + echo "base-commit: $(git rev-parse HEAD~2)" >expect && + test_cmp expect actual ' test_expect_success 'format-patch --base errors out when base commit is not ancestor of revision list' ' @@ -1652,8 +1652,8 @@ test_expect_success 'format-patch --base errors out when base commit is not ance test_must_fail git format-patch --base=$(cat commit-id-Z) -3 && git format-patch --stdout --base=$(cat commit-id-base) -3 >patch && grep "^base-commit:" patch >actual && - echo "base-commit: $(cat commit-id-base)" >expected && - test_cmp expected actual + echo "base-commit: $(cat commit-id-base)" >expect && + test_cmp expect actual ' test_expect_success 'format-patch --base=auto' ' @@ -1664,8 +1664,8 @@ test_expect_success 'format-patch --base=auto' ' test_commit N2 && git format-patch --stdout --base=auto -2 >patch && grep "^base-commit:" patch >actual && - echo "base-commit: $(git rev-parse upstream)" >expected && - test_cmp expected actual + echo "base-commit: $(git rev-parse upstream)" >expect && + test_cmp expect actual ' test_expect_success 'format-patch errors out when history involves criss-cross' ' @@ -1701,8 +1701,8 @@ test_expect_success 'format-patch format.useAutoBaseoption' ' git config format.useAutoBase true && git format-patch --stdout -1 >patch && grep "^base-commit:" patch >actual && - echo "base-commit: $(git rev-parse upstream)" >expected && - test_cmp expected actual + echo "base-commit: $(git rev-parse upstream)" >expect && + test_cmp expect actual ' test_expect_success 'format-patch --base overrides format.useAutoBase' ' @@ -1710,8 +1710,8 @@ test_expect_success 'format-patch --base overrides format.useAutoBase' ' git config format.useAutoBase true && git format-patch --stdout --base=HEAD~1 -1 >patch && grep "^base-commit:" patch >actual && - echo "base-commit: $(git rev-parse HEAD~1)" >expected && - test_cmp expected actual + echo "base-commit: $(git rev-parse HEAD~1)" >expect && + test_cmp expect actual ' test_expect_success 'format-patch --base with --attach' ' From patchwork Tue Aug 20 07:18:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denton Liu X-Patchwork-Id: 11103043 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5ADFE1399 for ; Tue, 20 Aug 2019 07:18:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3A11622CF4 for ; Tue, 20 Aug 2019 07:18:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="JmqjUX/x" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729351AbfHTHSz (ORCPT ); Tue, 20 Aug 2019 03:18:55 -0400 Received: from mail-io1-f67.google.com ([209.85.166.67]:38149 "EHLO mail-io1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729047AbfHTHSz (ORCPT ); Tue, 20 Aug 2019 03:18:55 -0400 Received: by mail-io1-f67.google.com with SMTP id p12so7640861iog.5 for ; Tue, 20 Aug 2019 00:18:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=IUxUkhQu8IKRPJnJfvXqpZRjIm/zAINbPLEtvMCz0aY=; b=JmqjUX/xCHBsN1GZPgljmb+T57lOx9hY91LiPl/X4StEURGiKrP6qn+MPZyfn/iPux SjTB/61wqKXToEHAkt9U2/e7K2uuXuMMvQ5FYCr7BWJR4+Whn6uJpjHC3AuaTlLEUWg3 kF7HTipZ9I5kdoemmy3VEwjrWNDs4y7XqB4iAXtqCq3YhMnzFtZtV8A1QPw9YvTk73aF teDoLrUeoXE4oYZzbYQ3ndVw5c7jki6RrJkjMf9ezxTffuZpG8XYFNzLuEQpv1JcbBe8 bOScTDdkT7U1gDyIiI7DadXB1xJp+mlZogklknxtSM3aAJOyFGdJc3buUvu3LNjh6EWc cMMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=IUxUkhQu8IKRPJnJfvXqpZRjIm/zAINbPLEtvMCz0aY=; b=mdvz0asi5plKO4EUwQfDq90JmRxgWE8JnfIvSpcJA6g5JdRSOeDewEW3ij2bts0I7U i3UUZI7oUVMs8KHpxrQO0a6YSBPdjMvHBWMidACgW4F85e0HvtBzdchFrha8guz371Iy dYw8KjAY6YsJtBCYnsOSXnnQwbGuvG4B53dXt/uExefqlvxS1tsAKMPHimPPpUWK5Pic zHXWnvOxb8LC55wXyQMO1tZs17L3D+vPZdiCsyK6mwJpdGzW75ZVnmfmiIEBuIIyknqX 6ylmjwKcbzpdF9r3nzmfTREJEofXpDMFVAZBRJsjvSCqijEWH71yhIkDd7A3+BGkWVzE rT7w== X-Gm-Message-State: APjAAAU61qLY8qb6Mj1yfjQmQ9bFgrzLk/CuAhI2ZmJ31xylMaf3vRgh hOMMYzEsST9mnI3Ytqo3ej98O+yy X-Google-Smtp-Source: APXvYqzihmuSgpK4uTiQr4OSenhWTVQ6e1AQwTrTP3mA5pQw7/YkWGicMVSuF4ADNIdrMkbd7b5t4g== X-Received: by 2002:a5d:824e:: with SMTP id n14mr6674174ioo.205.1566285533648; Tue, 20 Aug 2019 00:18:53 -0700 (PDT) Received: from archbookpro.localdomain (CPE18593399858a-CM185933998587.cpe.net.cable.rogers.com. [174.112.89.95]) by smtp.gmail.com with ESMTPSA id q8sm14357321ion.82.2019.08.20.00.18.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Aug 2019 00:18:53 -0700 (PDT) Date: Tue, 20 Aug 2019 03:18:51 -0400 From: Denton Liu To: Git Mailing List Cc: =?iso-8859-1?q?=C6var_Arnfj=F6r=F0?= Bjarmason , Junio C Hamano , Eric Sunshine Subject: [PATCH v3 03/13] t4014: move closing sq onto its own line Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.1 (2019-06-15) Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org The usual convention for test cases is for the closing sq to be on its own line. Move the sq onto its own line for cases that do not conform to this style. Signed-off-by: Denton Liu --- t/t4014-format-patch.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh index 62f5680f05..5e8eb6fb27 100755 --- a/t/t4014-format-patch.sh +++ b/t/t4014-format-patch.sh @@ -790,11 +790,13 @@ test_expect_success 'options no longer allowed for format-patch' ' test_must_fail git format-patch --name-status 2> output && test_i18ncmp expect.name-status output && test_must_fail git format-patch --check 2> output && - test_i18ncmp expect.check output' + test_i18ncmp expect.check output +' test_expect_success 'format-patch --numstat should produce a patch' ' git format-patch --numstat --stdout master..side > output && - test 5 = $(grep "^diff --git a/" output | wc -l)' + test 5 = $(grep "^diff --git a/" output | wc -l) +' test_expect_success 'format-patch -- ' ' git format-patch master..side -- file 2>error && From patchwork Tue Aug 20 07:18:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denton Liu X-Patchwork-Id: 11103045 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A8817112C for ; Tue, 20 Aug 2019 07:18:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 869E4214DA for ; Tue, 20 Aug 2019 07:18:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="QU/j/+Vb" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729362AbfHTHS5 (ORCPT ); Tue, 20 Aug 2019 03:18:57 -0400 Received: from mail-io1-f68.google.com ([209.85.166.68]:39320 "EHLO mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729047AbfHTHS5 (ORCPT ); Tue, 20 Aug 2019 03:18:57 -0400 Received: by mail-io1-f68.google.com with SMTP id l7so9347643ioj.6 for ; Tue, 20 Aug 2019 00:18:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Il9LwpJVzdzduiFquLf1KD7uEGxhXQfU8tLcnW9qImI=; b=QU/j/+Vb6dJ4qymUrPH8SKuu4ZcybgBKrox0q7d71TjDjVBq7iZVGte76ZaThEi/Xg 2i95LS9fPif85ozp1XbTXLx7h9IGYEKImcP9GqSKBzbrp0BLWBva7VDGaFjVG8lu7fST 6Swq7VF7UfFmEAwMLJy1fU9IqNDSlUJ3nZk8pRTkEVBhdwQkTAsvJtxHnik9/ITV/qAJ Hatet7s9YczQn0t/QEzBtMeWhXiU23Guw98juzFQK0hQ6cGteQrQQsb4+Jj8bkD+Q2dB 7lazvTlmKugFHswxyW6rdFIbtV9VS6SvKFpi0+TJqXUhO6Gi5Wn2mIaz/+ZwNjuPU95f Ru+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Il9LwpJVzdzduiFquLf1KD7uEGxhXQfU8tLcnW9qImI=; b=XG5Yh0QVYKhwH/v2GqA/xyG2CaUBL3zMP5HLyK3qqzmVp7R26Od6EJasZ30kij09Tm JuYq6tArWIsCrqf2kbyWFczDrEMFTX1TNdOg3wpWPFnkNmPCQHDlHSeW6xlfDiAJO51l zx+hmR/A9uQmEFXVAJXx2qu/F3xwO63Kdy7UGZt1sUKlaej/V72jXiKrAvGu8DfOiprg qi4zkPPMgPG0PXSrCdfWNA5y7cgRk1Yqii9zYN9zI5+EkZYJyN003Q11C7GWJd/wPRns 5CnBbXX84LOnkdNZlQAklLnza20p1MU6IWu3MtMvgVD8Yq9Nj8J5D97+9ITUw9IgwvqS rspw== X-Gm-Message-State: APjAAAWGg34WZqe/wgu1EFaKYWPu2nLjWN3iEm09m+jLbmN/ju4ZBkn6 D3sxMoCUx0BphASGzthblRzmpHP4 X-Google-Smtp-Source: APXvYqwmjZlrh2vrEHm2gTPvNzXSR3n+SPz/6GNJV1LUc/Okr6smQG/uI21l5E5SGQONAPZ2OizPRA== X-Received: by 2002:a05:6602:c7:: with SMTP id z7mr1034624ioe.130.1566285536168; Tue, 20 Aug 2019 00:18:56 -0700 (PDT) Received: from archbookpro.localdomain (CPE18593399858a-CM185933998587.cpe.net.cable.rogers.com. [174.112.89.95]) by smtp.gmail.com with ESMTPSA id n21sm10536389iom.69.2019.08.20.00.18.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Aug 2019 00:18:55 -0700 (PDT) Date: Tue, 20 Aug 2019 03:18:53 -0400 From: Denton Liu To: Git Mailing List Cc: =?iso-8859-1?q?=C6var_Arnfj=F6r=F0?= Bjarmason , Junio C Hamano , Eric Sunshine Subject: [PATCH v3 04/13] t4014: use sq for test case names Message-ID: <66bf2e3dd4ecfa2d389d3865929226ad02818b55.1566285151.git.liu.denton@gmail.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.1 (2019-06-15) Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org The usual convention is for test case names to be written between single-quotes. Change all double-quoted test case names to single-quotes except for one test case name that uses a sq for a contraction. Signed-off-by: Denton Liu --- t/t4014-format-patch.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh index 5e8eb6fb27..a7b440b003 100755 --- a/t/t4014-format-patch.sh +++ b/t/t4014-format-patch.sh @@ -58,20 +58,20 @@ test_expect_success setup ' git checkout master ' -test_expect_success "format-patch --ignore-if-in-upstream" ' +test_expect_success 'format-patch --ignore-if-in-upstream' ' git format-patch --stdout master..side >patch0 && cnt=$(grep "^From " patch0 | wc -l) && test $cnt = 3 ' -test_expect_success "format-patch --ignore-if-in-upstream" ' +test_expect_success 'format-patch --ignore-if-in-upstream' ' git format-patch --stdout \ --ignore-if-in-upstream master..side >patch1 && cnt=$(grep "^From " patch1 | wc -l) && test $cnt = 2 ' -test_expect_success "format-patch --ignore-if-in-upstream handles tags" ' +test_expect_success 'format-patch --ignore-if-in-upstream handles tags' ' git tag -a v1 -m tag side && git tag -a v2 -m tag master && git format-patch --stdout --ignore-if-in-upstream v2..v1 >patch1 && @@ -94,14 +94,14 @@ test_expect_success "format-patch doesn't consider merge commits" ' test $cnt = 3 ' -test_expect_success "format-patch result applies" ' +test_expect_success 'format-patch result applies' ' git checkout -b rebuild-0 master && git am -3 patch0 && cnt=$(git rev-list master.. | wc -l) && test $cnt = 2 ' -test_expect_success "format-patch --ignore-if-in-upstream result applies" ' +test_expect_success 'format-patch --ignore-if-in-upstream result applies' ' git checkout -b rebuild-1 master && git am -3 patch1 && cnt=$(git rev-list master.. | wc -l) && From patchwork Tue Aug 20 07:18:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denton Liu X-Patchwork-Id: 11103047 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 876D91399 for ; Tue, 20 Aug 2019 07:19:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5C291214DA for ; Tue, 20 Aug 2019 07:19:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="lclcKbU0" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729374AbfHTHTA (ORCPT ); Tue, 20 Aug 2019 03:19:00 -0400 Received: from mail-io1-f67.google.com ([209.85.166.67]:43713 "EHLO mail-io1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729047AbfHTHTA (ORCPT ); Tue, 20 Aug 2019 03:19:00 -0400 Received: by mail-io1-f67.google.com with SMTP id 18so10041609ioe.10 for ; Tue, 20 Aug 2019 00:18:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=gxFfx/GtskVA+8qxu2cO2SZogZyMuZZHPSx3Y+yQlTw=; b=lclcKbU01o+fEaBAUKdZ1yTaGfVRkAfIqOhMuadj/eerO+hGvDwSGIUxg9f4A/y7Yn heDtZPqAIy+Qop1fnL+kB97e0zL4lloJWJiX7iCH4QjVjcelPLv4t82XCJn46CXanjUO qGM1dKmfaCNbD/wFAG0Pw+h9kWaPi0JHHgcqe2oNNrrosaldPrZGVB58LObWX7qtcubO xS8//N2yl1xDy1I1DYUsEJP8Anuum2rcRrxp/uqKP3Lo5nvFhNzJB/CCkncaF8uXRN6v gnFR6cdyISr95GTOV6WXzZ+hPqpH7A3qYbGmqhdr0IUqGaYcQe9xWl9B8f/iweSQSMQl WYZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=gxFfx/GtskVA+8qxu2cO2SZogZyMuZZHPSx3Y+yQlTw=; b=ZqWZI6/k85m/8/RfYU6x5rugD41GxgpSCUEu9Isxtof54S2eQnQidv2MjLgZMigOj3 VKaTcngUyz0Y8c30Wsb8q16gyaXTpnXEeynckKRagH1o8iBqXZrYmW4fu/cXURUhJlW5 68M5u2FIfIA//O9CRF6BiBjlXyjFx1d/F+Opu+PrpdKbcV+RRu9n/D15PkMsfYPV3VWf HnpJ5iMWKxpR3q7w3z6eFpn20TxQQKbpV3Tr1a1Yrz9/ogAurCu3cycmSS5i83FF0xnX cuDvXSUY+RVV9WvOQfpp9dodycD3o7sokJjzbkK4Y5rBXXFG37tt1phiytI3tBdU4RuV c2Sw== X-Gm-Message-State: APjAAAWn5WWPZaeJ1kvLFvPP45PvR9AIvBgNUAEh8J06UoSw1z1omQCH ORkJbaHf6eaoRI/yh54wSz4U1NT0 X-Google-Smtp-Source: APXvYqwZBIw7gtnUNitYUNbBBq8lmYMKuEFo2AV7E+vxOQimTnJrpvPr1qQvTqpsbiwK3uFNEmRdCg== X-Received: by 2002:a6b:f711:: with SMTP id k17mr20319956iog.273.1566285538432; Tue, 20 Aug 2019 00:18:58 -0700 (PDT) Received: from archbookpro.localdomain (CPE18593399858a-CM185933998587.cpe.net.cable.rogers.com. [174.112.89.95]) by smtp.gmail.com with ESMTPSA id t20sm9568942ioc.68.2019.08.20.00.18.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Aug 2019 00:18:58 -0700 (PDT) Date: Tue, 20 Aug 2019 03:18:56 -0400 From: Denton Liu To: Git Mailing List Cc: =?iso-8859-1?q?=C6var_Arnfj=F6r=F0?= Bjarmason , Junio C Hamano , Eric Sunshine Subject: [PATCH v3 05/13] t4014: remove spaces after redirect operators Message-ID: <6f1371275e3ce9ea5b1da1b183a4ccb71b103c5b.1566285151.git.liu.denton@gmail.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.1 (2019-06-15) Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org For shell scripts, the usual convention is for there to be no space after redirection operators, (e.g. `>file`, not `> file`). Remove these spaces wherever they appear. Signed-off-by: Denton Liu --- t/t4014-format-patch.sh | 62 ++++++++++++++++++++--------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh index a7b440b003..075affb1e5 100755 --- a/t/t4014-format-patch.sh +++ b/t/t4014-format-patch.sh @@ -126,8 +126,8 @@ test_expect_success 'extra headers' ' " && git config --add format.headers "Cc: S E Cipient " && - git format-patch --stdout master..side > patch2 && - sed -e "/^\$/q" patch2 > hdrs2 && + git format-patch --stdout master..side >patch2 && + sed -e "/^\$/q" patch2 >hdrs2 && grep "^To: R E Cipient \$" hdrs2 && grep "^Cc: S E Cipient \$" hdrs2 ' @@ -136,7 +136,7 @@ test_expect_success 'extra headers without newlines' ' git config --replace-all format.headers "To: R E Cipient " && git config --add format.headers "Cc: S E Cipient " && git format-patch --stdout master..side >patch3 && - sed -e "/^\$/q" patch3 > hdrs3 && + sed -e "/^\$/q" patch3 >hdrs3 && grep "^To: R E Cipient \$" hdrs3 && grep "^Cc: S E Cipient \$" hdrs3 ' @@ -144,8 +144,8 @@ test_expect_success 'extra headers without newlines' ' test_expect_success 'extra headers with multiple To:s' ' git config --replace-all format.headers "To: R E Cipient " && git config --add format.headers "To: S E Cipient " && - git format-patch --stdout master..side > patch4 && - sed -e "/^\$/q" patch4 > hdrs4 && + git format-patch --stdout master..side >patch4 && + sed -e "/^\$/q" patch4 >hdrs4 && grep "^To: R E Cipient ,\$" hdrs4 && grep "^ *S E Cipient \$" hdrs4 ' @@ -318,7 +318,7 @@ test_expect_success 'reroll count (-v)' ' check_threading () { expect="$1" && shift && - (git format-patch --stdout "$@"; echo $? > status.out) | + (git format-patch --stdout "$@"; echo $? >status.out) | # Prints everything between the Message-ID and In-Reply-To, # and replaces all Message-ID-lookalikes by a sequence number perl -ne ' @@ -333,12 +333,12 @@ check_threading () { print; } print "---\n" if /^From /i; - ' > actual && + ' >actual && test 0 = "$(cat status.out)" && test_cmp "$expect" actual } -cat >> expect.no-threading <>expect.no-threading < expect.thread <expect.thread < --- @@ -366,7 +366,7 @@ test_expect_success 'thread' ' check_threading expect.thread --thread master ' -cat > expect.in-reply-to <expect.in-reply-to < In-Reply-To: <1> @@ -386,7 +386,7 @@ test_expect_success 'thread in-reply-to' ' --thread master ' -cat > expect.cover-letter <expect.cover-letter < --- @@ -407,7 +407,7 @@ test_expect_success 'thread cover-letter' ' check_threading expect.cover-letter --cover-letter --thread master ' -cat > expect.cl-irt <expect.cl-irt < In-Reply-To: <1> @@ -439,7 +439,7 @@ test_expect_success 'thread explicit shallow' ' --in-reply-to="" --thread=shallow master ' -cat > expect.deep <expect.deep < --- @@ -457,7 +457,7 @@ test_expect_success 'thread deep' ' check_threading expect.deep --thread=deep master ' -cat > expect.deep-irt <expect.deep-irt < In-Reply-To: <1> @@ -480,7 +480,7 @@ test_expect_success 'thread deep in-reply-to' ' --in-reply-to="" master ' -cat > expect.deep-cl <expect.deep-cl < --- @@ -504,7 +504,7 @@ test_expect_success 'thread deep cover-letter' ' check_threading expect.deep-cl --cover-letter --thread=deep master ' -cat > expect.deep-cl-irt <expect.deep-cl-irt < In-Reply-To: <1> @@ -584,7 +584,7 @@ test_expect_success 'cover-letter inherits diff options' ' grep "file => foo .* 0 *\$" 0000-cover-letter.patch ' -cat > expect << EOF +cat >expect < output && + sed -e "1,/A U Thor/d" -e "/^\$/q" <0000-cover-letter.patch >output && test_cmp expect output ' -cat > expect << EOF +cat >expect < expect << EOF +cat >expect < output && + sed -e "1,/^\$/d" -e "/^+5/q" <0001-This-is-an-excessively-long-subject-line-for-a-messa.patch >output && test_cmp expect output ' @@ -689,7 +689,7 @@ test_expect_success 'format-patch from a subdirectory (3)' ' ' test_expect_success 'format-patch --in-reply-to' ' - git format-patch -1 --stdout --in-reply-to "baz@foo.bar" > patch8 && + git format-patch -1 --stdout --in-reply-to "baz@foo.bar" >patch8 && grep "^In-Reply-To: " patch8 && grep "^References: " patch8 ' @@ -780,21 +780,21 @@ test_expect_success 'format-patch with multiple notes refs' ' ! grep "this is note 2" out ' -echo "fatal: --name-only does not make sense" > expect.name-only -echo "fatal: --name-status does not make sense" > expect.name-status -echo "fatal: --check does not make sense" > expect.check +echo "fatal: --name-only does not make sense" >expect.name-only +echo "fatal: --name-status does not make sense" >expect.name-status +echo "fatal: --check does not make sense" >expect.check test_expect_success 'options no longer allowed for format-patch' ' - test_must_fail git format-patch --name-only 2> output && + test_must_fail git format-patch --name-only 2>output && test_i18ncmp expect.name-only output && - test_must_fail git format-patch --name-status 2> output && + test_must_fail git format-patch --name-status 2>output && test_i18ncmp expect.name-status output && - test_must_fail git format-patch --check 2> output && + test_must_fail git format-patch --check 2>output && test_i18ncmp expect.check output ' test_expect_success 'format-patch --numstat should produce a patch' ' - git format-patch --numstat --stdout master..side > output && + git format-patch --numstat --stdout master..side >output && test 5 = $(grep "^diff --git a/" output | wc -l) ' @@ -1610,14 +1610,14 @@ test_expect_success 'format-patch --base' ' echo "base-commit: $(git rev-parse HEAD~3)" >>expect && echo "prerequisite-patch-id: $(git show --patch HEAD~2 | git patch-id --stable | awk "{print \$1}")" >>expect && echo "prerequisite-patch-id: $(git show --patch HEAD~1 | git patch-id --stable | awk "{print \$1}")" >>expect && - signature >> expect && + signature >>expect && test_cmp expect actual1 && test_cmp expect actual2 && echo >fail && echo "base-commit: $(git rev-parse HEAD~3)" >>fail && echo "prerequisite-patch-id: $(git show --patch HEAD~2 | git patch-id --unstable | awk "{print \$1}")" >>fail && echo "prerequisite-patch-id: $(git show --patch HEAD~1 | git patch-id --unstable | awk "{print \$1}")" >>fail && - signature >> fail && + signature >>fail && ! test_cmp fail actual1 && ! test_cmp fail actual2 ' From patchwork Tue Aug 20 07:18:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denton Liu X-Patchwork-Id: 11103049 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id ED5B9112C for ; Tue, 20 Aug 2019 07:19:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C064B214DA for ; Tue, 20 Aug 2019 07:19:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="tnnXhkss" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729380AbfHTHTC (ORCPT ); Tue, 20 Aug 2019 03:19:02 -0400 Received: from mail-io1-f66.google.com ([209.85.166.66]:42653 "EHLO mail-io1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729047AbfHTHTC (ORCPT ); Tue, 20 Aug 2019 03:19:02 -0400 Received: by mail-io1-f66.google.com with SMTP id e20so10067699iob.9 for ; Tue, 20 Aug 2019 00:19:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=/pQmeh6he9iEyqMs6LHy0NzLVmE3L+BX4bVCvFJpJrE=; b=tnnXhkssOT0GoQmk6wtMiYibXewMXR0J345la+wTlZuKdNQCbymFv3mwTuJZhwYoSO Ny0SWKeY1JYCkG7O+z6Jqp4xptNVxxUUjHkpSZ7QgT/WygAPyRWRmoKWyAD9+JNClsNG s2ilZElLrSjFhiUYXq8gUOXBU+UWFfiPobVN1rCfQRZ7Z+E43usmKB6iKpnlzWukYv2d zt8XtGfSa/UfxYKbYoCBwMhtfLJ/w4AqLGRvorTUb3bsGo/a1Apw+I8UcTHPdag0JmjK 8dnOXMowrIZl0X7h6Bk0d63TsipGUzeBUDTK5n6j9UCTS3TbK6L0NcWqMcqxCaNwOiJa DHKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=/pQmeh6he9iEyqMs6LHy0NzLVmE3L+BX4bVCvFJpJrE=; b=Fxn2bFI5AbE6mKaGvjJyqswAXIrK9SPGjSQu8xgoWvQFPN/nX6mq2MxKd8iNVuqMyp AMmvUdouFROMdO2gaVefJfwRTtQu+FzgG3wBrzrGfmMAZaJYMyerZ+2z8jC4GWEjfgnA VPer2g+UDMB9BuITI9+welY31BOKNV03bv3yXqsFFxFQfJ5KStGYaxDSnBySy7jQoaeH 9Q0pF9lzlNCDuqX5h1bghzH00Ojd9LDZn2AALkkYjTKK+LgHjkHI47Ke//YMzyyyP1We yneEkeTV7S6NK23NbbGytcaa37LyR+2pPBeb2ykzg/CsAb7XIuSzorTW0516mf+kJi7C hhfg== X-Gm-Message-State: APjAAAWImiUcEdOp/5GDJwo/Jo5+aHjwAvQCMKa1wdcC4OuYrjEiD748 +1TaiJGV6w0NZbzSxHZ/RShqBb4f X-Google-Smtp-Source: APXvYqxdJ4IFeEzRC8wRUIxO+0Eusx9E3k5qQ3FEsdh4dFaoz7LrIfkAsheZcLJrBzijuwdm665Y3w== X-Received: by 2002:a05:6638:517:: with SMTP id i23mr2112983jar.71.1566285540885; Tue, 20 Aug 2019 00:19:00 -0700 (PDT) Received: from archbookpro.localdomain (CPE18593399858a-CM185933998587.cpe.net.cable.rogers.com. [174.112.89.95]) by smtp.gmail.com with ESMTPSA id q3sm10954854ios.70.2019.08.20.00.19.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Aug 2019 00:19:00 -0700 (PDT) Date: Tue, 20 Aug 2019 03:18:58 -0400 From: Denton Liu To: Git Mailing List Cc: =?iso-8859-1?q?=C6var_Arnfj=F6r=F0?= Bjarmason , Junio C Hamano , Eric Sunshine Subject: [PATCH v3 06/13] t4014: use indentable here-docs Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.1 (2019-06-15) Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org The convention is to use indentable here-docs within test cases so that the here-docs line up with the rest of the code within the test case. Change here-docs from `<<\EOF` to `<<-\EOF` so that they can be indented along with the rest of the test case. Signed-off-by: Denton Liu --- t/t4014-format-patch.sh | 368 ++++++++++++++++++++-------------------- 1 file changed, 184 insertions(+), 184 deletions(-) diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh index 075affb1e5..c07d868491 100755 --- a/t/t4014-format-patch.sh +++ b/t/t4014-format-patch.sh @@ -1211,282 +1211,282 @@ append_signoff() test_expect_success 'signoff: commit with no body' ' append_signoff actual && - cat <<\EOF | sed "s/EOL$//" >expect && -4:Subject: [PATCH] EOL -8: -9:Signed-off-by: C O Mitter -EOF + cat <<-\EOF | sed "s/EOL$//" >expect && + 4:Subject: [PATCH] EOL + 8: + 9:Signed-off-by: C O Mitter + EOF test_cmp expect actual ' test_expect_success 'signoff: commit with only subject' ' echo subject | append_signoff >actual && - cat >expect <<\EOF && -4:Subject: [PATCH] subject -8: -9:Signed-off-by: C O Mitter -EOF + cat >expect <<-\EOF && + 4:Subject: [PATCH] subject + 8: + 9:Signed-off-by: C O Mitter + EOF test_cmp expect actual ' test_expect_success 'signoff: commit with only subject that does not end with NL' ' printf subject | append_signoff >actual && - cat >expect <<\EOF && -4:Subject: [PATCH] subject -8: -9:Signed-off-by: C O Mitter -EOF + cat >expect <<-\EOF && + 4:Subject: [PATCH] subject + 8: + 9:Signed-off-by: C O Mitter + EOF test_cmp expect actual ' test_expect_success 'signoff: no existing signoffs' ' - append_signoff <<\EOF >actual && -subject + append_signoff <<-\EOF >actual && + subject -body -EOF - cat >expect <<\EOF && -4:Subject: [PATCH] subject -8: -10: -11:Signed-off-by: C O Mitter -EOF + body + EOF + cat >expect <<-\EOF && + 4:Subject: [PATCH] subject + 8: + 10: + 11:Signed-off-by: C O Mitter + EOF test_cmp expect actual ' test_expect_success 'signoff: no existing signoffs and no trailing NL' ' printf "subject\n\nbody" | append_signoff >actual && - cat >expect <<\EOF && -4:Subject: [PATCH] subject -8: -10: -11:Signed-off-by: C O Mitter -EOF + cat >expect <<-\EOF && + 4:Subject: [PATCH] subject + 8: + 10: + 11:Signed-off-by: C O Mitter + EOF test_cmp expect actual ' test_expect_success 'signoff: some random signoff' ' - append_signoff <<\EOF >actual && -subject + append_signoff <<-\EOF >actual && + subject -body + body -Signed-off-by: my@house -EOF - cat >expect <<\EOF && -4:Subject: [PATCH] subject -8: -10: -11:Signed-off-by: my@house -12:Signed-off-by: C O Mitter -EOF + Signed-off-by: my@house + EOF + cat >expect <<-\EOF && + 4:Subject: [PATCH] subject + 8: + 10: + 11:Signed-off-by: my@house + 12:Signed-off-by: C O Mitter + EOF test_cmp expect actual ' test_expect_success 'signoff: misc conforming footer elements' ' - append_signoff <<\EOF >actual && -subject + append_signoff <<-\EOF >actual && + subject -body + body -Signed-off-by: my@house -(cherry picked from commit da39a3ee5e6b4b0d3255bfef95601890afd80709) -Tested-by: Some One -Bug: 1234 -EOF - cat >expect <<\EOF && -4:Subject: [PATCH] subject -8: -10: -11:Signed-off-by: my@house -15:Signed-off-by: C O Mitter -EOF + Signed-off-by: my@house + (cherry picked from commit da39a3ee5e6b4b0d3255bfef95601890afd80709) + Tested-by: Some One + Bug: 1234 + EOF + cat >expect <<-\EOF && + 4:Subject: [PATCH] subject + 8: + 10: + 11:Signed-off-by: my@house + 15:Signed-off-by: C O Mitter + EOF test_cmp expect actual ' test_expect_success 'signoff: some random signoff-alike' ' - append_signoff <<\EOF >actual && -subject + append_signoff <<-\EOF >actual && + subject -body -Fooled-by-me: my@house -EOF - cat >expect <<\EOF && -4:Subject: [PATCH] subject -8: -11: -12:Signed-off-by: C O Mitter -EOF + body + Fooled-by-me: my@house + EOF + cat >expect <<-\EOF && + 4:Subject: [PATCH] subject + 8: + 11: + 12:Signed-off-by: C O Mitter + EOF test_cmp expect actual ' test_expect_success 'signoff: not really a signoff' ' - append_signoff <<\EOF >actual && -subject + append_signoff <<-\EOF >actual && + subject -I want to mention about Signed-off-by: here. -EOF - cat >expect <<\EOF && -4:Subject: [PATCH] subject -8: -9:I want to mention about Signed-off-by: here. -10: -11:Signed-off-by: C O Mitter -EOF + I want to mention about Signed-off-by: here. + EOF + cat >expect <<-\EOF && + 4:Subject: [PATCH] subject + 8: + 9:I want to mention about Signed-off-by: here. + 10: + 11:Signed-off-by: C O Mitter + EOF test_cmp expect actual ' test_expect_success 'signoff: not really a signoff (2)' ' - append_signoff <<\EOF >actual && -subject + append_signoff <<-\EOF >actual && + subject -My unfortunate -Signed-off-by: example happens to be wrapped here. -EOF - cat >expect <<\EOF && -4:Subject: [PATCH] subject -8: -10:Signed-off-by: example happens to be wrapped here. -11:Signed-off-by: C O Mitter -EOF + My unfortunate + Signed-off-by: example happens to be wrapped here. + EOF + cat >expect <<-\EOF && + 4:Subject: [PATCH] subject + 8: + 10:Signed-off-by: example happens to be wrapped here. + 11:Signed-off-by: C O Mitter + EOF test_cmp expect actual ' test_expect_success 'signoff: valid S-o-b paragraph in the middle' ' - append_signoff <<\EOF >actual && -subject + append_signoff <<-\EOF >actual && + subject -Signed-off-by: my@house -Signed-off-by: your@house + Signed-off-by: my@house + Signed-off-by: your@house -A lot of houses. -EOF - cat >expect <<\EOF && -4:Subject: [PATCH] subject -8: -9:Signed-off-by: my@house -10:Signed-off-by: your@house -11: -13: -14:Signed-off-by: C O Mitter -EOF + A lot of houses. + EOF + cat >expect <<-\EOF && + 4:Subject: [PATCH] subject + 8: + 9:Signed-off-by: my@house + 10:Signed-off-by: your@house + 11: + 13: + 14:Signed-off-by: C O Mitter + EOF test_cmp expect actual ' test_expect_success 'signoff: the same signoff at the end' ' - append_signoff <<\EOF >actual && -subject + append_signoff <<-\EOF >actual && + subject -body + body -Signed-off-by: C O Mitter -EOF - cat >expect <<\EOF && -4:Subject: [PATCH] subject -8: -10: -11:Signed-off-by: C O Mitter -EOF + Signed-off-by: C O Mitter + EOF + cat >expect <<-\EOF && + 4:Subject: [PATCH] subject + 8: + 10: + 11:Signed-off-by: C O Mitter + EOF test_cmp expect actual ' test_expect_success 'signoff: the same signoff at the end, no trailing NL' ' printf "subject\n\nSigned-off-by: C O Mitter " | append_signoff >actual && - cat >expect <<\EOF && -4:Subject: [PATCH] subject -8: -9:Signed-off-by: C O Mitter -EOF + cat >expect <<-\EOF && + 4:Subject: [PATCH] subject + 8: + 9:Signed-off-by: C O Mitter + EOF test_cmp expect actual ' test_expect_success 'signoff: the same signoff NOT at the end' ' - append_signoff <<\EOF >actual && -subject + append_signoff <<-\EOF >actual && + subject -body + body -Signed-off-by: C O Mitter -Signed-off-by: my@house -EOF - cat >expect <<\EOF && -4:Subject: [PATCH] subject -8: -10: -11:Signed-off-by: C O Mitter -12:Signed-off-by: my@house -EOF + Signed-off-by: C O Mitter + Signed-off-by: my@house + EOF + cat >expect <<-\EOF && + 4:Subject: [PATCH] subject + 8: + 10: + 11:Signed-off-by: C O Mitter + 12:Signed-off-by: my@house + EOF test_cmp expect actual ' test_expect_success 'signoff: tolerate garbage in conforming footer' ' - append_signoff <<\EOF >actual && -subject + append_signoff <<-\EOF >actual && + subject -body + body -Tested-by: my@house -Some Trash -Signed-off-by: C O Mitter -EOF - cat >expect <<\EOF && -4:Subject: [PATCH] subject -8: -10: -13:Signed-off-by: C O Mitter -EOF + Tested-by: my@house + Some Trash + Signed-off-by: C O Mitter + EOF + cat >expect <<-\EOF && + 4:Subject: [PATCH] subject + 8: + 10: + 13:Signed-off-by: C O Mitter + EOF test_cmp expect actual ' test_expect_success 'signoff: respect trailer config' ' - append_signoff <<\EOF >actual && -subject + append_signoff <<-\EOF >actual && + subject -Myfooter: x -Some Trash -EOF - cat >expect <<\EOF && -4:Subject: [PATCH] subject -8: -11: -12:Signed-off-by: C O Mitter -EOF + Myfooter: x + Some Trash + EOF + cat >expect <<-\EOF && + 4:Subject: [PATCH] subject + 8: + 11: + 12:Signed-off-by: C O Mitter + EOF test_cmp expect actual && test_config trailer.Myfooter.ifexists add && - append_signoff <<\EOF >actual && -subject + append_signoff <<-\EOF >actual && + subject -Myfooter: x -Some Trash -EOF - cat >expect <<\EOF && -4:Subject: [PATCH] subject -8: -11:Signed-off-by: C O Mitter -EOF + Myfooter: x + Some Trash + EOF + cat >expect <<-\EOF && + 4:Subject: [PATCH] subject + 8: + 11:Signed-off-by: C O Mitter + EOF test_cmp expect actual ' test_expect_success 'signoff: footer begins with non-signoff without @ sign' ' - append_signoff <<\EOF >actual && -subject + append_signoff <<-\EOF >actual && + subject -body + body -Reviewed-id: Noone -Tested-by: my@house -Change-id: Ideadbeef -Signed-off-by: C O Mitter -Bug: 1234 -EOF - cat >expect <<\EOF && -4:Subject: [PATCH] subject -8: -10: -14:Signed-off-by: C O Mitter -EOF + Reviewed-id: Noone + Tested-by: my@house + Change-id: Ideadbeef + Signed-off-by: C O Mitter + Bug: 1234 + EOF + cat >expect <<-\EOF && + 4:Subject: [PATCH] subject + 8: + 10: + 14:Signed-off-by: C O Mitter + EOF test_cmp expect actual ' From patchwork Tue Aug 20 07:19:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denton Liu X-Patchwork-Id: 11103053 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D43A21399 for ; Tue, 20 Aug 2019 07:19:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B3264214DA for ; Tue, 20 Aug 2019 07:19:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="dqYFa4Oi" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729394AbfHTHTE (ORCPT ); Tue, 20 Aug 2019 03:19:04 -0400 Received: from mail-io1-f68.google.com ([209.85.166.68]:41691 "EHLO mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729047AbfHTHTE (ORCPT ); Tue, 20 Aug 2019 03:19:04 -0400 Received: by mail-io1-f68.google.com with SMTP id j5so10066219ioj.8 for ; Tue, 20 Aug 2019 00:19:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=C7cvA63Mls7f/glzSnNwJN2P5f8JSKcVpFamqhfO42o=; b=dqYFa4OiP8RkBAkcyeu/aMIOpE7ET8ZanqesNz0RUJobHiXh/JnWy8e6lFq+2IluDP zy8tQji7aCn6DDg28veaaLb2W/qi+cZmARWkeJpmYXQBngjtzZkXaEXezDCqBw8PomEL 8STxQPVAoiynxHGj7Uet4MrHDhb/8B+91KShdO/Apv+zy5QW2ZJp1gBegO0NQzYr56nu 6hO8ZAk0eOVR2ZG4af1CmBal1EPgRmmH8fPgAYyx0zx92C/AQDVxZhKZyXp5mt/8CeYf IsVCXoAEgefRcKIaSD4bKqVOwgNPp4RXNkWvuWEngBiVEskdBdsshjubhpMG1MhOOGK9 odxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=C7cvA63Mls7f/glzSnNwJN2P5f8JSKcVpFamqhfO42o=; b=L2JGAHWBbOucY2hPT/9jllbEMCDxRTcNCeNV7do2V/rehEMOJitpXGos+AzNZtMUny w0XKETyFrUrt17W+ea4QmQWhEXsMe8qAhAHAvECQCFiCZrGwEDFfXVFCfRsE2EkKfnLX /V5ip2vzYOurb3yBpPBciAdAxIL2aEuvHxaBXc9QzKkvPmkTiC1ek5yRSzQLmGOJsOls rEdeng3jF7nVQQ4oS64FKfLjHLuGAEgqMKT8/ANtUJlYwHQNoOCfFWZhpRNwRgRGks3n 7wtV359Q3ycqtvpaPJfL4g6cLQuJXTjsxzjKV7iCtlR9iWq8zFucY30/dk4pr4ldEhRt 9oUw== X-Gm-Message-State: APjAAAXW0re04FBcHLQUHOnMmtefoKrBQ0LhYfFXryQ0cdBQXxom3QiF Tes0cOBCWBaMQYK2YKMfgz9vIOdF X-Google-Smtp-Source: APXvYqzJrMy5Ge9xWRqeUEZxIupoeHVaEnOHQ8BAEZOuKEIkqprhYGm1QO3ZuHWWss8frvT+EwuhQA== X-Received: by 2002:a05:6638:310:: with SMTP id w16mr2200135jap.136.1566285543450; Tue, 20 Aug 2019 00:19:03 -0700 (PDT) Received: from archbookpro.localdomain (CPE18593399858a-CM185933998587.cpe.net.cable.rogers.com. [174.112.89.95]) by smtp.gmail.com with ESMTPSA id y5sm17395164ioc.86.2019.08.20.00.19.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Aug 2019 00:19:03 -0700 (PDT) Date: Tue, 20 Aug 2019 03:19:01 -0400 From: Denton Liu To: Git Mailing List Cc: =?iso-8859-1?q?=C6var_Arnfj=F6r=F0?= Bjarmason , Junio C Hamano , Eric Sunshine Subject: [PATCH v3 07/13] t4014: drop redirections to /dev/null Message-ID: <34315412c85e36271bcfe773001a7aa541c6faf0.1566285151.git.liu.denton@gmail.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.1 (2019-06-15) Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Since output is silenced when running without `-v` and debugging output is useful with `-v`, remove redirections to /dev/null as it is not useful. Signed-off-by: Denton Liu --- t/t4014-format-patch.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh index c07d868491..2048fb2008 100755 --- a/t/t4014-format-patch.sh +++ b/t/t4014-format-patch.sh @@ -1502,42 +1502,42 @@ test_expect_success 'cover letter using branch description (1)' ' git checkout rebuild-1 && test_config branch.rebuild-1.description hello && git format-patch --stdout --cover-letter master >actual && - grep hello actual >/dev/null + grep hello actual ' test_expect_success 'cover letter using branch description (2)' ' git checkout rebuild-1 && test_config branch.rebuild-1.description hello && git format-patch --stdout --cover-letter rebuild-1~2..rebuild-1 >actual && - grep hello actual >/dev/null + grep hello actual ' test_expect_success 'cover letter using branch description (3)' ' git checkout rebuild-1 && test_config branch.rebuild-1.description hello && git format-patch --stdout --cover-letter ^master rebuild-1 >actual && - grep hello actual >/dev/null + grep hello actual ' test_expect_success 'cover letter using branch description (4)' ' git checkout rebuild-1 && test_config branch.rebuild-1.description hello && git format-patch --stdout --cover-letter master.. >actual && - grep hello actual >/dev/null + grep hello actual ' test_expect_success 'cover letter using branch description (5)' ' git checkout rebuild-1 && test_config branch.rebuild-1.description hello && git format-patch --stdout --cover-letter -2 HEAD >actual && - grep hello actual >/dev/null + grep hello actual ' test_expect_success 'cover letter using branch description (6)' ' git checkout rebuild-1 && test_config branch.rebuild-1.description hello && git format-patch --stdout --cover-letter -2 >actual && - grep hello actual >/dev/null + grep hello actual ' test_expect_success 'cover letter with nothing' ' From patchwork Tue Aug 20 07:19:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denton Liu X-Patchwork-Id: 11103055 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E50861399 for ; Tue, 20 Aug 2019 07:19:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C3CB522CF4 for ; Tue, 20 Aug 2019 07:19:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="BdAUjpzw" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729397AbfHTHTH (ORCPT ); Tue, 20 Aug 2019 03:19:07 -0400 Received: from mail-io1-f67.google.com ([209.85.166.67]:38185 "EHLO mail-io1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729047AbfHTHTH (ORCPT ); Tue, 20 Aug 2019 03:19:07 -0400 Received: by mail-io1-f67.google.com with SMTP id p12so7641860iog.5 for ; Tue, 20 Aug 2019 00:19:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=H5/xKaS0Q7q+s1z6WTgX/echzNq9gpIJV3Kh1OwBZ6Q=; b=BdAUjpzw94caXEXxxPreGfnMMsmsgqeB8CS9fOdCfNt3h0eJf5DikGyuhe0EEK3OiT WtNIN2kTKjuhIyXrMKp2gL5H3s3c1YSplAKaoAOJ6A/63myO6iotzXbEUg/mW9h+8vaX 8siAlIRmDvGneLNYMCJyWsVINcLafvGg/9k0BrzZw4Pt1W/eLuYXwTOiIfyk4C6o90iS Lr/NgMvcU2QYEtckudoSullIMDSSihiIoHWum5rnXpSRroaw6sP8Y56VhyXeLSsTPRzc pPktNO9qzaW/Uv+CUis/LtAgxan/9gKmkyAx8J4Cj6x5Iv3pEmJIFNrJ9VXOep9ldytP WyFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=H5/xKaS0Q7q+s1z6WTgX/echzNq9gpIJV3Kh1OwBZ6Q=; b=fwYxKXCnW+dfu7HDq1m6PYeYvbBMQ4hN14aDZiym/UHjy4gCCV6gc0rCuBHiaHZPaB 99z/TjpiDAGt8iQw0lDWDWxZwhPqzGMg026pUe/8ZmJOHWk+oOc3m+rf+8EVS4Aon+2Z JdsrPvq+HB+eOxU+21PmDg321kDKAPTsIX9vzjr7PpcoRG6aff2GfZicgSV0bpiKl0tt EXaWq9QDeCjBta6NNuO7+AGrzSX+I+h0W48lTTp7l6pw86m6Mf1boHQ/SApDgRJp1fdr Gbil9Flb+FUKlB++Na0nQ55isX/tRp9H/RFEf792mju7o7DFK9GAftu+eTZ+ZycFGSN0 R/SA== X-Gm-Message-State: APjAAAUx4pWM//Uy/jvspJRz2rkU0YF8hw5UfyD5ohboVQSp5eO4uaBl oFezTjxvWTNzRjgd+4Uv1Kv8d/pG X-Google-Smtp-Source: APXvYqwKhTcCLHTMF90HCv7wldZzWiflqx5mq9KBYpTzs+LcXhdVxvar5+CWZdrt6ycHsDokzqRQhA== X-Received: by 2002:a6b:cf17:: with SMTP id o23mr6250986ioa.176.1566285546020; Tue, 20 Aug 2019 00:19:06 -0700 (PDT) Received: from archbookpro.localdomain (CPE18593399858a-CM185933998587.cpe.net.cable.rogers.com. [174.112.89.95]) by smtp.gmail.com with ESMTPSA id p9sm17951756ios.1.2019.08.20.00.19.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Aug 2019 00:19:05 -0700 (PDT) Date: Tue, 20 Aug 2019 03:19:03 -0400 From: Denton Liu To: Git Mailing List Cc: =?iso-8859-1?q?=C6var_Arnfj=F6r=F0?= Bjarmason , Junio C Hamano , Eric Sunshine Subject: [PATCH v3 08/13] t4014: use test_line_count() where possible Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.1 (2019-06-15) Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Convert all instances of `cnt=$(... | wc -l) && test $cnt = N` into uses of `test_line_count()`. While we're at it, convert one instance of a Git command upstream of a pipe into two commands. This prevents a failure of a Git command from being masked since only the return code of the last member of the pipe is shown. Signed-off-by: Denton Liu --- t/t4014-format-patch.sh | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh index 2048fb2008..176af4b902 100755 --- a/t/t4014-format-patch.sh +++ b/t/t4014-format-patch.sh @@ -60,23 +60,23 @@ test_expect_success setup ' test_expect_success 'format-patch --ignore-if-in-upstream' ' git format-patch --stdout master..side >patch0 && - cnt=$(grep "^From " patch0 | wc -l) && - test $cnt = 3 + grep "^From " patch0 >from0 && + test_line_count = 3 from0 ' test_expect_success 'format-patch --ignore-if-in-upstream' ' git format-patch --stdout \ --ignore-if-in-upstream master..side >patch1 && - cnt=$(grep "^From " patch1 | wc -l) && - test $cnt = 2 + grep "^From " patch1 >from1 && + test_line_count = 2 from1 ' test_expect_success 'format-patch --ignore-if-in-upstream handles tags' ' git tag -a v1 -m tag side && git tag -a v2 -m tag master && git format-patch --stdout --ignore-if-in-upstream v2..v1 >patch1 && - cnt=$(grep "^From " patch1 | wc -l) && - test $cnt = 2 + grep "^From " patch1 >from1 && + test_line_count = 2 from1 ' test_expect_success "format-patch doesn't consider merge commits" ' @@ -90,22 +90,23 @@ test_expect_success "format-patch doesn't consider merge commits" ' git checkout -b merger master && test_tick && git merge --no-ff slave && - cnt=$(git format-patch -3 --stdout | grep "^From " | wc -l) && - test $cnt = 3 + git format-patch -3 --stdout >patch && + grep "^From " patch >from && + test_line_count = 3 from ' test_expect_success 'format-patch result applies' ' git checkout -b rebuild-0 master && git am -3 patch0 && - cnt=$(git rev-list master.. | wc -l) && - test $cnt = 2 + git rev-list master.. >list && + test_line_count = 2 list ' test_expect_success 'format-patch --ignore-if-in-upstream result applies' ' git checkout -b rebuild-1 master && git am -3 patch1 && - cnt=$(git rev-list master.. | wc -l) && - test $cnt = 2 + git rev-list master.. >list && + test_line_count = 2 list ' test_expect_success 'commit did not screw up the log message' ' @@ -795,7 +796,8 @@ test_expect_success 'options no longer allowed for format-patch' ' test_expect_success 'format-patch --numstat should produce a patch' ' git format-patch --numstat --stdout master..side >output && - test 5 = $(grep "^diff --git a/" output | wc -l) + grep "^diff --git a/" output >diff && + test_line_count = 5 diff ' test_expect_success 'format-patch -- ' ' @@ -852,8 +854,8 @@ test_expect_success 'format-patch --signature --cover-letter' ' git config --unset-all format.signature && git format-patch --stdout --signature="my sig" --cover-letter \ -1 >output && - grep "my sig" output && - test 2 = $(grep "my sig" output | wc -l) + grep "my sig" output >sig && + test_line_count = 2 sig ' test_expect_success 'format.signature="" suppresses signatures' ' @@ -1591,7 +1593,8 @@ test_expect_success 'format-patch format.outputDirectory option' ' test_config format.outputDirectory patches && rm -fr patches && git format-patch master..side && - test $(git rev-list master..side | wc -l) -eq $(ls patches | wc -l) + git rev-list master..side >list && + test_line_count = $(ls patches | wc -l) list ' test_expect_success 'format-patch -o overrides format.outputDirectory' ' From patchwork Tue Aug 20 07:19:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denton Liu X-Patchwork-Id: 11103057 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1D14C1399 for ; Tue, 20 Aug 2019 07:19:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EECF9214DA for ; Tue, 20 Aug 2019 07:19:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ke74waLS" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729400AbfHTHTK (ORCPT ); Tue, 20 Aug 2019 03:19:10 -0400 Received: from mail-io1-f68.google.com ([209.85.166.68]:46884 "EHLO mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729047AbfHTHTJ (ORCPT ); Tue, 20 Aug 2019 03:19:09 -0400 Received: by mail-io1-f68.google.com with SMTP id x4so10042756iog.13 for ; Tue, 20 Aug 2019 00:19:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=4h4w05uUwEB+bxojpeOS/miaWfaQstd4GM5/QPxaGfc=; b=ke74waLS5PrjyNo319pocdJudZG/LyHSUKHA+nW4dWFfixdMcYXgaWyzZImY7dBFNL 2keyzYLeRhROKKYOFUqt+P0wAubsFsArASpHJy6w866boh237fFZAAw17gNH/kBc4CTu e+wEEFXYvymosIy/l06BD2p1avZj6k3L8iUUkIAW658YWhjMlaD36xL5DuKgL+OL7CNs LMxQDxcgdVoLQto4EZ+U0Avnu3Mtj3D3I64xcRsvVh9t2IEUmD0UU/QbSA3CCxaOt185 i4FdB1LZZi+y7TxCqfGVrVllCffHOFLLmeh3hWQxwN722kxW+SGTOXDtmOyxG8K0DAg1 +JyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=4h4w05uUwEB+bxojpeOS/miaWfaQstd4GM5/QPxaGfc=; b=p6/H32USGNkiBoMtnFR4HV5G3XVv/lWhwlOJeIREoUVwtf83VM46Pb6CPuHJxGpCYY vvPhyaIkE3gsjuUo772UCYKzK2CG8o3Wy6zVm9byHuEu3Z2kUA7LXXRH2VSg7lHNrRgV kPnn+pU2QUSVIdfZyaa97MTqbGAmhMac62CIh8VxWF3dKl+Ip3CWnm+eOgEDrnQJTskT jUemjy19mt6fKxUIGZHyphCOXJx48etz+CNBKql7lYsEMMFndKNjINWE/kaWXDKYGsLl dfTymSO0O0rFKkast7xm/J+5+ESS+g0oqeuRF+9d/EfVhA6dJijStfID5L3TBLvtOjVG lcoA== X-Gm-Message-State: APjAAAW7ln4ZTkw2lUHDe3T1QSMJrpZ6iQ8UuwLVrFCTSSrp3HyU6RjB o/qDFEvg++6AlpBltFfarjOvhv5i X-Google-Smtp-Source: APXvYqzndLarWnyOwMzeBPz3weKkJPyKJi/Te7PKv6HMv5bjvFc8Cha+GAhWoMrVMUPJOP/TmE5Fkg== X-Received: by 2002:a5e:d717:: with SMTP id v23mr30485832iom.52.1566285548477; Tue, 20 Aug 2019 00:19:08 -0700 (PDT) Received: from archbookpro.localdomain (CPE18593399858a-CM185933998587.cpe.net.cable.rogers.com. [174.112.89.95]) by smtp.gmail.com with ESMTPSA id m20sm15016045ioh.4.2019.08.20.00.19.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Aug 2019 00:19:08 -0700 (PDT) Date: Tue, 20 Aug 2019 03:19:06 -0400 From: Denton Liu To: Git Mailing List Cc: =?iso-8859-1?q?=C6var_Arnfj=F6r=F0?= Bjarmason , Junio C Hamano , Eric Sunshine Subject: [PATCH v3 09/13] t4014: remove confusing pipe in check_threading() Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.1 (2019-06-15) Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org In check_threading(), there was a Git command in the upstream of a pipe. In order to not lose its status code, it was saved into a file. However, this may be confusing so rewrite to redirect IO to file. This allows us to directly use the conventional &&-chain. Signed-off-by: Denton Liu --- t/t4014-format-patch.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh index 176af4b902..7f74948e2c 100755 --- a/t/t4014-format-patch.sh +++ b/t/t4014-format-patch.sh @@ -319,7 +319,7 @@ test_expect_success 'reroll count (-v)' ' check_threading () { expect="$1" && shift && - (git format-patch --stdout "$@"; echo $? >status.out) | + git format-patch --stdout "$@" >patch && # Prints everything between the Message-ID and In-Reply-To, # and replaces all Message-ID-lookalikes by a sequence number perl -ne ' @@ -334,8 +334,7 @@ check_threading () { print; } print "---\n" if /^From /i; - ' >actual && - test 0 = "$(cat status.out)" && + ' actual && test_cmp "$expect" actual } From patchwork Tue Aug 20 07:19:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Denton Liu X-Patchwork-Id: 11103059 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BDC41112C for ; Tue, 20 Aug 2019 07:19:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 897EF22CF4 for ; Tue, 20 Aug 2019 07:19:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="qRXrSLAt" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729402AbfHTHTM (ORCPT ); Tue, 20 Aug 2019 03:19:12 -0400 Received: from mail-io1-f65.google.com ([209.85.166.65]:46893 "EHLO mail-io1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729322AbfHTHTM (ORCPT ); Tue, 20 Aug 2019 03:19:12 -0400 Received: by mail-io1-f65.google.com with SMTP id x4so10042969iog.13 for ; Tue, 20 Aug 2019 00:19:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=/kIEcxjmhY3IjjwmtAMUrNpzBMrxSar9Hmrct25p2GQ=; b=qRXrSLAtZKl3rKEzd7y5MM96Sqk1FGuoKKUha3TgHpiVpBqsV7yZ+7EKwR2a6PKAhD OGxRqCY88Efuyyh/Yw2yiHqH2BAh8T7CMkl8px+jBaWWC5Le52XWPonFVaHKvSXnAS0V J0leGXhrrb6sYg+MZIsK9rvsVq9tyA+0MV3xJ124GU2VWte4E83M7Nqc24d3GIjrQS35 +Ehruh2FO4DLITLUIp20/hnguHabL1v8X8/AS+W7JVWetbb3zQ2SCQpsa57gILx7G1hZ yVzX1Gtr5/cfCxwlKm1rEaXV2ZgiRGSuF1EuC4TcKXgFwFHbrp/FOMQx2YAyg6TqGjCN TEaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=/kIEcxjmhY3IjjwmtAMUrNpzBMrxSar9Hmrct25p2GQ=; b=jG7BqH2MiB87pbGpH7GMS+E3Np7BxEM0ySKqUC1ARqBF0RdO8ngaN/WBM5TE1dFn+V kBfhr5j3JWUf+WJTYrZw3p4A5aOMmWBXK/u8hP9+kxvXmu8/UPGaXPkBcRjaRw4uydKe Vy6woteYrE0mfj2nZH/bks3IalHCCeoygg8+OfmzIedKR5v9Mrw0EiuyV1PnedY6Vv8N lrJRPo+EolSwwyRFls2JXl1VZea9eFnAV2m0D+udAJDPbMgMXNAmUnUixvCihyfShxDS 9XJlothAbI3Fft0RTjqfhDjkQuEJjtW9b9HAEQ/k1HKGHwnGwAA1f+8NF3AO0zengY3N o+hw== X-Gm-Message-State: APjAAAU+L/oMqB//UzZWMxv8qyshHJtIvWMh4bzRouh/4nDNj8TCCHxt vVaEfmShSNcvoUW7dmawdn6cDIun X-Google-Smtp-Source: APXvYqwVfXMqELZ0sa2YtNyWqRucNVYM7L4nvPRoJqrcUw/7CbIHhJ151kyTeETGOndfxo0//M/cEQ== X-Received: by 2002:a02:6a56:: with SMTP id m22mr2107159jaf.114.1566285550880; Tue, 20 Aug 2019 00:19:10 -0700 (PDT) Received: from archbookpro.localdomain (CPE18593399858a-CM185933998587.cpe.net.cable.rogers.com. [174.112.89.95]) by smtp.gmail.com with ESMTPSA id k9sm17273756ioa.10.2019.08.20.00.19.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Aug 2019 00:19:10 -0700 (PDT) Date: Tue, 20 Aug 2019 03:19:08 -0400 From: Denton Liu To: Git Mailing List Cc: =?iso-8859-1?q?=C6var_Arnfj=F6r=F0?= Bjarmason , Junio C Hamano , Eric Sunshine Subject: [PATCH v3 10/13] t4014: stop losing return codes of git commands Message-ID: <64069c0c540b109b46b2cc6c90e3b5c912aa18c5.1566285151.git.liu.denton@gmail.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.1 (2019-06-15) Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Currently, there are two ways where the return codes of Git commands are lost. The first way is when a command is in the upstream of a pipe. In a pipe, only the return code of the last command is used. Thus, all other commands will have their return codes masked. Rewrite pipes so that there are no Git commands upstream. The other way is when a command is in a non-assignment subshell. The return code will be lost in favour of the surrounding command's. Rewrite instances of this such that Git commands output to a file and surrounding commands only call subshells with non-Git commands. Signed-off-by: Denton Liu --- t/t4014-format-patch.sh | 196 ++++++++++++++++++++++++---------------- 1 file changed, 119 insertions(+), 77 deletions(-) diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh index 7f74948e2c..7b8c8fe136 100755 --- a/t/t4014-format-patch.sh +++ b/t/t4014-format-patch.sh @@ -33,7 +33,8 @@ test_expect_success setup ' git commit -m "Side changes #3 with \\n backslash-n in it." && git checkout master && - git diff-tree -p C2 | git apply --index && + git diff-tree -p C2 >patch && + git apply --index actual && + grep "^Side .* with .* backslash-n" actual ' test_expect_success 'format-patch did not screw up the log message' ' @@ -119,7 +121,8 @@ test_expect_success 'format-patch did not screw up the log message' ' ' test_expect_success 'replay did not screw up the log message' ' - git cat-file commit rebuild-1 | grep "^Side .* with .* backslash-n" + git cat-file commit rebuild-1 >actual && + grep "^Side .* with .* backslash-n" actual ' test_expect_success 'extra headers' ' @@ -153,63 +156,73 @@ test_expect_success 'extra headers with multiple To:s' ' test_expect_success 'additional command line cc (ascii)' ' git config --replace-all format.headers "Cc: R E Cipient " && - git format-patch --cc="S E Cipient " --stdout master..side | sed -e "/^\$/q" >patch5 && - grep "^Cc: R E Cipient ,\$" patch5 && - grep "^ *S E Cipient \$" patch5 + git format-patch --cc="S E Cipient " --stdout master..side >patch5 && + sed -e "/^\$/q" patch5 >hdrs5 && + grep "^Cc: R E Cipient ,\$" hdrs5 && + grep "^ *S E Cipient \$" hdrs5 ' test_expect_failure 'additional command line cc (rfc822)' ' git config --replace-all format.headers "Cc: R E Cipient " && - git format-patch --cc="S. E. Cipient " --stdout master..side | sed -e "/^\$/q" >patch5 && - grep "^Cc: R E Cipient ,\$" patch5 && - grep "^ *\"S. E. Cipient\" \$" patch5 + git format-patch --cc="S. E. Cipient " --stdout master..side >patch5 && + sed -e "/^\$/q" patch5 >hdrs5 && + grep "^Cc: R E Cipient ,\$" hdrs5 && + grep "^ *\"S. E. Cipient\" \$" hdrs5 ' test_expect_success 'command line headers' ' git config --unset-all format.headers && - git format-patch --add-header="Cc: R E Cipient " --stdout master..side | sed -e "/^\$/q" >patch6 && - grep "^Cc: R E Cipient \$" patch6 + git format-patch --add-header="Cc: R E Cipient " --stdout master..side >patch6 && + sed -e "/^\$/q" patch6 >hdrs6 && + grep "^Cc: R E Cipient \$" hdrs6 ' test_expect_success 'configuration headers and command line headers' ' git config --replace-all format.headers "Cc: R E Cipient " && - git format-patch --add-header="Cc: S E Cipient " --stdout master..side | sed -e "/^\$/q" >patch7 && - grep "^Cc: R E Cipient ,\$" patch7 && - grep "^ *S E Cipient \$" patch7 + git format-patch --add-header="Cc: S E Cipient " --stdout master..side >patch7 && + sed -e "/^\$/q" patch7 >hdrs7 && + grep "^Cc: R E Cipient ,\$" hdrs7 && + grep "^ *S E Cipient \$" hdrs7 ' test_expect_success 'command line To: header (ascii)' ' git config --unset-all format.headers && - git format-patch --to="R E Cipient " --stdout master..side | sed -e "/^\$/q" >patch8 && - grep "^To: R E Cipient \$" patch8 + git format-patch --to="R E Cipient " --stdout master..side >patch8 && + sed -e "/^\$/q" patch8 >hdrs8 && + grep "^To: R E Cipient \$" hdrs8 ' test_expect_failure 'command line To: header (rfc822)' ' - git format-patch --to="R. E. Cipient " --stdout master..side | sed -e "/^\$/q" >patch8 && - grep "^To: \"R. E. Cipient\" \$" patch8 + git format-patch --to="R. E. Cipient " --stdout master..side >patch8 && + sed -e "/^\$/q" patch8 >hdrs8 && + grep "^To: \"R. E. Cipient\" \$" hdrs8 ' test_expect_failure 'command line To: header (rfc2047)' ' - git format-patch --to="R Ä Cipient " --stdout master..side | sed -e "/^\$/q" >patch8 && - grep "^To: =?UTF-8?q?R=20=C3=84=20Cipient?= \$" patch8 + git format-patch --to="R Ä Cipient " --stdout master..side >patch8 && + sed -e "/^\$/q" patch8 >hdrs8 && + grep "^To: =?UTF-8?q?R=20=C3=84=20Cipient?= \$" hdrs8 ' test_expect_success 'configuration To: header (ascii)' ' git config format.to "R E Cipient " && - git format-patch --stdout master..side | sed -e "/^\$/q" >patch9 && - grep "^To: R E Cipient \$" patch9 + git format-patch --stdout master..side >patch9 && + sed -e "/^\$/q" patch9 >hdrs9 && + grep "^To: R E Cipient \$" hdrs9 ' test_expect_failure 'configuration To: header (rfc822)' ' git config format.to "R. E. Cipient " && - git format-patch --stdout master..side | sed -e "/^\$/q" >patch9 && - grep "^To: \"R. E. Cipient\" \$" patch9 + git format-patch --stdout master..side >patch9 && + sed -e "/^\$/q" patch9 >hdrs9 && + grep "^To: \"R. E. Cipient\" \$" hdrs9 ' test_expect_failure 'configuration To: header (rfc2047)' ' git config format.to "R Ä Cipient " && - git format-patch --stdout master..side | sed -e "/^\$/q" >patch9 && - grep "^To: =?UTF-8?q?R=20=C3=84=20Cipient?= \$" patch9 + git format-patch --stdout master..side >patch9 && + sed -e "/^\$/q" patch9 >hdrs9 && + grep "^To: =?UTF-8?q?R=20=C3=84=20Cipient?= \$" hdrs9 ' # check_patch : Verify that looks like a half-sane @@ -221,76 +234,76 @@ check_patch () { } test_expect_success 'format.from=false' ' - git -c format.from=false format-patch --stdout master..side | - sed -e "/^\$/q" >patch && + git -c format.from=false format-patch --stdout master..side >patch && + sed -e "/^\$/q" patch >hdrs && check_patch patch && - ! grep "^From: C O Mitter \$" patch + ! grep "^From: C O Mitter \$" hdrs ' test_expect_success 'format.from=true' ' - git -c format.from=true format-patch --stdout master..side | - sed -e "/^\$/q" >patch && - check_patch patch && - grep "^From: C O Mitter \$" patch + git -c format.from=true format-patch --stdout master..side >patch && + sed -e "/^\$/q" patch >hdrs && + check_patch hdrs && + grep "^From: C O Mitter \$" hdrs ' test_expect_success 'format.from with address' ' - git -c format.from="F R Om " format-patch --stdout master..side | - sed -e "/^\$/q" >patch && - check_patch patch && - grep "^From: F R Om \$" patch + git -c format.from="F R Om " format-patch --stdout master..side >patch && + sed -e "/^\$/q" patch >hdrs && + check_patch hdrs && + grep "^From: F R Om \$" hdrs ' test_expect_success '--no-from overrides format.from' ' - git -c format.from="F R Om " format-patch --no-from --stdout master..side | - sed -e "/^\$/q" >patch && - check_patch patch && - ! grep "^From: F R Om \$" patch + git -c format.from="F R Om " format-patch --no-from --stdout master..side >patch && + sed -e "/^\$/q" patch >hdrs && + check_patch hdrs && + ! grep "^From: F R Om \$" hdrs ' test_expect_success '--from overrides format.from' ' - git -c format.from="F R Om " format-patch --from --stdout master..side | - sed -e "/^\$/q" >patch && - check_patch patch && - ! grep "^From: F R Om \$" patch + git -c format.from="F R Om " format-patch --from --stdout master..side >patch && + sed -e "/^\$/q" patch >hdrs && + check_patch hdrs && + ! grep "^From: F R Om \$" hdrs ' test_expect_success '--no-to overrides config.to' ' git config --replace-all format.to \ "R E Cipient " && - git format-patch --no-to --stdout master..side | - sed -e "/^\$/q" >patch10 && - check_patch patch10 && - ! grep "^To: R E Cipient \$" patch10 + git format-patch --no-to --stdout master..side >patch10 && + sed -e "/^\$/q" patch10 >hdrs10 && + check_patch hdrs10 && + ! grep "^To: R E Cipient \$" hdrs10 ' test_expect_success '--no-to and --to replaces config.to' ' git config --replace-all format.to \ "Someone " && git format-patch --no-to --to="Someone Else " \ - --stdout master..side | - sed -e "/^\$/q" >patch11 && - check_patch patch11 && - ! grep "^To: Someone \$" patch11 && - grep "^To: Someone Else \$" patch11 + --stdout master..side >patch11 && + sed -e "/^\$/q" patch11 >hdrs11 && + check_patch hdrs11 && + ! grep "^To: Someone \$" hdrs11 && + grep "^To: Someone Else \$" hdrs11 ' test_expect_success '--no-cc overrides config.cc' ' git config --replace-all format.cc \ "C E Cipient " && - git format-patch --no-cc --stdout master..side | - sed -e "/^\$/q" >patch12 && - check_patch patch12 && - ! grep "^Cc: C E Cipient \$" patch12 + git format-patch --no-cc --stdout master..side >patch12 && + sed -e "/^\$/q" patch12 >hdrs12 && + check_patch hdrs12 && + ! grep "^Cc: C E Cipient \$" hdrs12 ' test_expect_success '--no-add-header overrides config.headers' ' git config --replace-all format.headers \ "Header1: B E Cipient " && - git format-patch --no-add-header --stdout master..side | - sed -e "/^\$/q" >patch13 && - check_patch patch13 && - ! grep "^Header1: B E Cipient \$" patch13 + git format-patch --no-add-header --stdout master..side >patch13 && + sed -e "/^\$/q" patch13 >hdrs13 && + check_patch hdrs13 && + ! grep "^Header1: B E Cipient \$" hdrs13 ' test_expect_success 'multiple files' ' @@ -808,20 +821,24 @@ test_expect_success 'format-patch --ignore-if-in-upstream HEAD' ' git format-patch --ignore-if-in-upstream HEAD ' -git_version="$(git --version | sed "s/.* //")" +test_expect_success 'get git version' ' + git_version="$(git --version | sed "s/.* //")" +' signature() { printf "%s\n%s\n\n" "-- " "${1:-$git_version}" } test_expect_success 'format-patch default signature' ' - git format-patch --stdout -1 | tail -n 3 >output && + git format-patch --stdout -1 >patch && + tail -n 3 patch >output && signature >expect && test_cmp expect output ' test_expect_success 'format-patch --signature' ' - git format-patch --stdout --signature="my sig" -1 | tail -n 3 >output && + git format-patch --stdout --signature="my sig" -1 >patch && + tail -n 3 patch >output && signature "my sig" >expect && test_cmp expect output ' @@ -1606,19 +1623,40 @@ test_expect_success 'format-patch -o overrides format.outputDirectory' ' test_expect_success 'format-patch --base' ' git checkout patchid && - git format-patch --stdout --base=HEAD~3 -1 | tail -n 7 >actual1 && - git format-patch --stdout --base=HEAD~3 HEAD~.. | tail -n 7 >actual2 && + + git format-patch --stdout --base=HEAD~3 -1 >patch && + tail -n 7 patch >actual1 && + + git format-patch --stdout --base=HEAD~3 HEAD~.. >patch && + tail -n 7 patch >actual2 && + echo >expect && - echo "base-commit: $(git rev-parse HEAD~3)" >>expect && - echo "prerequisite-patch-id: $(git show --patch HEAD~2 | git patch-id --stable | awk "{print \$1}")" >>expect && - echo "prerequisite-patch-id: $(git show --patch HEAD~1 | git patch-id --stable | awk "{print \$1}")" >>expect && + git rev-parse HEAD~3 >commit-id-base && + echo "base-commit: $(cat commit-id-base)" >>expect && + + git show --patch HEAD~2 >patch && + git patch-id --stable patch.id.raw && + awk "{print \"prerequisite-patch-id:\", \$1}" >expect && + + git show --patch HEAD~1 >patch && + git patch-id --stable patch.id.raw && + awk "{print \"prerequisite-patch-id:\", \$1}" >expect && + signature >>expect && test_cmp expect actual1 && test_cmp expect actual2 && + echo >fail && - echo "base-commit: $(git rev-parse HEAD~3)" >>fail && - echo "prerequisite-patch-id: $(git show --patch HEAD~2 | git patch-id --unstable | awk "{print \$1}")" >>fail && - echo "prerequisite-patch-id: $(git show --patch HEAD~1 | git patch-id --unstable | awk "{print \$1}")" >>fail && + echo "base-commit: $(cat commit-id-base)" >>fail && + + git show --patch HEAD~2 >patch && + git patch-id --unstable patch.id.raw && + awk "{print \"prerequisite-patch-id:\", \$1}" >fail && + + git show --patch HEAD~1 >patch && + git patch-id --unstable patch.id.raw && + awk "{print \"prerequisite-patch-id:\", \$1}" >fail && + signature >>fail && ! test_cmp fail actual1 && ! test_cmp fail actual2 @@ -1629,7 +1667,8 @@ test_expect_success 'format-patch --base errors out when base commit is in revis test_must_fail git format-patch --base=HEAD~1 -2 && git format-patch --stdout --base=HEAD~2 -2 >patch && grep "^base-commit:" patch >actual && - echo "base-commit: $(git rev-parse HEAD~2)" >expect && + git rev-parse HEAD~2 >commit-id-base && + echo "base-commit: $(cat commit-id-base)" >expect && test_cmp expect actual ' @@ -1668,7 +1707,8 @@ test_expect_success 'format-patch --base=auto' ' test_commit N2 && git format-patch --stdout --base=auto -2 >patch && grep "^base-commit:" patch >actual && - echo "base-commit: $(git rev-parse upstream)" >expect && + git rev-parse upstream >commit-id-base && + echo "base-commit: $(cat commit-id-base)" >expect && test_cmp expect actual ' @@ -1705,7 +1745,8 @@ test_expect_success 'format-patch format.useAutoBaseoption' ' git config format.useAutoBase true && git format-patch --stdout -1 >patch && grep "^base-commit:" patch >actual && - echo "base-commit: $(git rev-parse upstream)" >expect && + git rev-parse upstream >commit-id-base && + echo "base-commit: $(cat commit-id-base)" >expect && test_cmp expect actual ' @@ -1714,7 +1755,8 @@ test_expect_success 'format-patch --base overrides format.useAutoBase' ' git config format.useAutoBase true && git format-patch --stdout --base=HEAD~1 -1 >patch && grep "^base-commit:" patch >actual && - echo "base-commit: $(git rev-parse HEAD~1)" >expect && + git rev-parse HEAD~1 >commit-id-base && + echo "base-commit: $(cat commit-id-base)" >expect && test_cmp expect actual ' From patchwork Tue Aug 20 07:19:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denton Liu X-Patchwork-Id: 11103061 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 17B491399 for ; Tue, 20 Aug 2019 07:19:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EB2A122CF4 for ; Tue, 20 Aug 2019 07:19:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="lmysCh76" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729405AbfHTHTP (ORCPT ); Tue, 20 Aug 2019 03:19:15 -0400 Received: from mail-io1-f66.google.com ([209.85.166.66]:43754 "EHLO mail-io1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729322AbfHTHTO (ORCPT ); Tue, 20 Aug 2019 03:19:14 -0400 Received: by mail-io1-f66.google.com with SMTP id 18so10042879ioe.10 for ; Tue, 20 Aug 2019 00:19:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=t4FscKSUAFYJROFmnFKe37tWakj/S+S0ILgO/AMRiXs=; b=lmysCh76a6KMlR2DqpTFOIP9zMdwRCu/Q3OXO3+cB47FBQqGIhiGOFOCjwcAekMipo K+xfxQt180XqvvyEtCDme+lQHaKh1ADGhxbEq6KqBiuzRzCRk5BHXKpzXhp/z7LmV5QC sOW4Sa/Vw3KvmekTC8BT6AHniotV61UPKPlymQNfsju9//c8f+wVW2kYP6nmJDKO3Wsz tVgBlNqaGNzIp8tvZcFGxYcEEVsyG7tMztYQ5eO0QCWn0fEH40IxyPuM41CIRYHlxzfB MXjjnGguU/N+GTFoRrlnpeu4ldadQrDY7frylrzDxBKoT3UKwAadMPIJqNRyXBXFncQx ekLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=t4FscKSUAFYJROFmnFKe37tWakj/S+S0ILgO/AMRiXs=; b=kHYwf4Zzof/hkWaKIuC0PU3nchXgiPEdoESiY/t0BhEn9zw0JD2zzbwxf2dQefpC54 ZDqcJSjda9EEaYN885lBEnavsJr+RWI+U5hYrVjIZdCvfEpPSMq6yYJLTSN3Zhg9962N /rrSUFxIwDcqJJClax0pdThJaMnMn2yl7tNbIZHfomiEt2LBQ+jF0fPipJ9qTVMKCtYD tV0uVOQtB2CiWN5AQvkyo3X7BxkWkZe0qbZwqowxVFzxvN+hOqdHoZUjI9niwSiuLQjB 2SXAe5ckd81TJNOA1JqmhTcC6RN1WzQPx9pheanTLTaob7pTcAgsSjMVCJUiwmeoCWiC SpCw== X-Gm-Message-State: APjAAAVdLB5MQMIVB/t0CttRkMVb6Bb4bKau6CcLGvFTT02GeHf6r4UE VftE6NDR3DBwEbNpT2mwkPWbHrQA X-Google-Smtp-Source: APXvYqwcAsxXgmOZrZUDk8fU9ovYEV36eYOFb6oJAmMKZf/UI4eGv088xflIqZIg3NSdUX85Wz+mMw== X-Received: by 2002:a6b:b3c3:: with SMTP id c186mr30705213iof.76.1566285553416; Tue, 20 Aug 2019 00:19:13 -0700 (PDT) Received: from archbookpro.localdomain (CPE18593399858a-CM185933998587.cpe.net.cable.rogers.com. [174.112.89.95]) by smtp.gmail.com with ESMTPSA id k9sm17273885ioa.10.2019.08.20.00.19.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Aug 2019 00:19:13 -0700 (PDT) Date: Tue, 20 Aug 2019 03:19:11 -0400 From: Denton Liu To: Git Mailing List Cc: =?iso-8859-1?q?=C6var_Arnfj=F6r=F0?= Bjarmason , Junio C Hamano , Eric Sunshine Subject: [PATCH v3 11/13] Doc: add more detail for git-format-patch Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.1 (2019-06-15) Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org In git-format-patch.txt, we were missing some key user information. First of all, document the special value of `--base=auto`. Next, while we're at it, surround option arguments with <>. Finally, document the `format.outputDirectory` config and change `format.coverletter` to use camel case. Signed-off-by: Denton Liu --- Documentation/git-format-patch.txt | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/Documentation/git-format-patch.txt b/Documentation/git-format-patch.txt index b9b97e63ae..95bc4d53ca 100644 --- a/Documentation/git-format-patch.txt +++ b/Documentation/git-format-patch.txt @@ -17,9 +17,9 @@ SYNOPSIS [--signature-file=] [-n | --numbered | -N | --no-numbered] [--start-number ] [--numbered-files] - [--in-reply-to=Message-Id] [--suffix=.] + [--in-reply-to=] [--suffix=.] [--ignore-if-in-upstream] - [--rfc] [--subject-prefix=Subject-Prefix] + [--rfc] [--subject-prefix=] [(--reroll-count|-v) ] [--to=] [--cc=] [--[no-]cover-letter] [--quiet] @@ -159,7 +159,7 @@ Beware that the default for 'git send-email' is to thread emails itself. If you want `git format-patch` to take care of threading, you will want to ensure that threading is disabled for `git send-email`. ---in-reply-to=Message-Id:: +--in-reply-to=:: Make the first mail (or all the mails with `--no-thread`) appear as a reply to the given Message-Id, which avoids breaking threads to provide a new patch series. @@ -314,7 +314,8 @@ you can use `--suffix=-patch` to get `0001-description-of-my-change-patch`. --base=:: Record the base tree information to identify the state the patch series applies to. See the BASE TREE INFORMATION section - below for details. + below for details. If is "auto", a base commit is + automatically chosen. --root:: Treat the revision argument as a , even if it @@ -330,8 +331,9 @@ CONFIGURATION ------------- You can specify extra mail header lines to be added to each message, defaults for the subject prefix and file suffix, number patches when -outputting more than one patch, add "To" or "Cc:" headers, configure -attachments, and sign off patches with configuration variables. +outputting more than one patch, add "To:" or "Cc:" headers, configure +attachments, change the patch output directory, and sign off patches +with configuration variables. ------------ [format] @@ -343,7 +345,8 @@ attachments, and sign off patches with configuration variables. cc = attach [ = mime-boundary-string ] signOff = true - coverletter = auto + outputDirectory = + coverLetter = auto ------------ From patchwork Tue Aug 20 07:19:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denton Liu X-Patchwork-Id: 11103063 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 35A411399 for ; Tue, 20 Aug 2019 07:19:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 15C8822CF4 for ; Tue, 20 Aug 2019 07:19:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="oRygOs+k" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729406AbfHTHTR (ORCPT ); Tue, 20 Aug 2019 03:19:17 -0400 Received: from mail-io1-f66.google.com ([209.85.166.66]:43765 "EHLO mail-io1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729322AbfHTHTR (ORCPT ); Tue, 20 Aug 2019 03:19:17 -0400 Received: by mail-io1-f66.google.com with SMTP id 18so10043096ioe.10 for ; Tue, 20 Aug 2019 00:19:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=RLA+auV5w3B4S445lrANQbbCFiyXgx8XVCPcuC5rVkY=; b=oRygOs+k2gdzlBaSXFP/zLWCjgt+r7Mo+eOYowqdGdlmuz97xKL4WOk3SWwuFXYZam exmokrnYC11p4UzQx3aSZ0aR7LIlLoI0GTlTtaEzeX8Y7ItLvTyzoKPy0kWMtA1oMMHh 45gDFX9krOKtc0eRwdbVH6Ny2aw9pNfuIDn/96GQ444dLHDIYgK5Xv76edLPiYTAXsTF tmFgOdNHJ3kHKnGb+Z0H4e+bwM3/+dE4bbhMVd0MOYoDjdSHRzMs5SlzEiXSuFLCnnO8 yoUbIK5K3hC4ii28SJ6hxgca6DrVs0iwCp5b7he/V129rpzIkG0bcTANXgEXkljayUvc Kerw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=RLA+auV5w3B4S445lrANQbbCFiyXgx8XVCPcuC5rVkY=; b=lUbWZ5Y160ejBgKjJygQ7je7P/mgM+bZAqHQxE+c41GE1BdvOSH83OUGhVIfJ92tik mvUKL5mXBOjAb/5rqs7Wq2e7Y1yg4V4djxct76zmEIf/XMam8V1B7YLm7xHhfZhN7hof 9ZpYD3P0EuWHf04Ilfp0HPW0tyiQvc8sHqXtcNEei6Uitlnes8O9UYKLX8fIMX2BLJ8N 0Pfw+MUjhdw8XK+J5qD6PSKnLjmWbRp+w8ZzhaVGJVaCofAwEPe1YLcPfLk1RVp69Ov4 NH3+fqeO0tixT++paTTd6i2/9tgjNkiXAkRUBEoA0zf3Efln6zq9pTnYYFXyTsHZ+ck+ qHJA== X-Gm-Message-State: APjAAAUjgfhaVB+ZoIggasVcWYKr6l2GYDKWzb5rya2J/J6RtNmTy0wg ex/HZvTPyzhFg0UVmnwTEhvQu7fu X-Google-Smtp-Source: APXvYqzz30Cl+Dbo0UO55a9I7wd/dqDlpt4LMcPpfoal2FVOtsohvzjhVMlxDRosc+f+K/ATOviEYA== X-Received: by 2002:a02:cd82:: with SMTP id l2mr2118981jap.97.1566285555845; Tue, 20 Aug 2019 00:19:15 -0700 (PDT) Received: from archbookpro.localdomain (CPE18593399858a-CM185933998587.cpe.net.cable.rogers.com. [174.112.89.95]) by smtp.gmail.com with ESMTPSA id o2sm17632637iob.64.2019.08.20.00.19.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Aug 2019 00:19:15 -0700 (PDT) Date: Tue, 20 Aug 2019 03:19:13 -0400 From: Denton Liu To: Git Mailing List Cc: =?iso-8859-1?q?=C6var_Arnfj=F6r=F0?= Bjarmason , Junio C Hamano , Eric Sunshine Subject: [PATCH v3 12/13] config/format.txt: specify default value of format.coverLetter Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.1 (2019-06-15) Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Signed-off-by: Denton Liu --- Documentation/config/format.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/config/format.txt b/Documentation/config/format.txt index 414a5a8a9d..cb629fa769 100644 --- a/Documentation/config/format.txt +++ b/Documentation/config/format.txt @@ -77,6 +77,7 @@ format.coverLetter:: A boolean that controls whether to generate a cover-letter when format-patch is invoked, but in addition can be set to "auto", to generate a cover-letter only when there's more than one patch. + Default is false. format.outputDirectory:: Set a custom directory to store the resulting files instead of the From patchwork Tue Aug 20 07:19:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denton Liu X-Patchwork-Id: 11103065 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 916CD112C for ; Tue, 20 Aug 2019 07:19:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6642C214DA for ; Tue, 20 Aug 2019 07:19:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="EXqXauH7" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729410AbfHTHTU (ORCPT ); Tue, 20 Aug 2019 03:19:20 -0400 Received: from mail-io1-f67.google.com ([209.85.166.67]:44634 "EHLO mail-io1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729322AbfHTHTU (ORCPT ); Tue, 20 Aug 2019 03:19:20 -0400 Received: by mail-io1-f67.google.com with SMTP id j4so10035992iop.11 for ; Tue, 20 Aug 2019 00:19:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=5HwAeLALKorIq6zNnyvMDBVWHRNx/lHaAcG/qH0MPuE=; b=EXqXauH7lzK+w3Fn2DI7zv4qqb9RonjQlJAkPwiIHIE8OQqiMPuZRqjJONsrp7TcJw gUx7lQr8aXyI6EfMBdU2icdg1r5BbKa17ovFtE4aNCozTz6znQhPm0WD5VeJbX2skVI0 miBSXsAzd92eJdQkjmEtEFFVAhsO+p1swFlzZmyWRVLgsNjl38jlfLS/t/llhPxC19oh SeouOqgtFENY9xzqKvEZaGpJmeOj99P26o/TCE7qPCgxuns3CVKDaSkSIXBzEjoCzkK1 s9bTrlMDPS2w2GsVM7xmmbCWp2c9GZz0ofkOK2Yvi4WuQnXxv3pMpPaNXIGejv6YvYV3 uzmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=5HwAeLALKorIq6zNnyvMDBVWHRNx/lHaAcG/qH0MPuE=; b=rKb8jhSRo4r9QixzFjdC2Crp8hqPmCjDRoqK6W/j0rm3QfbJHUGeokzDqh9qQetCwl PW3M6qzdnB9SBdvaEewTxRig06Vbp0RulxTByzyyTqPW56c8rQnzS1+0d/VJYn2bU4VZ MDd6obXjAkQfkPI4//xwTDR3sP0eCVsGNiRtbZ98lwWAhiy/y2xARaucXJDxHBsS4YQK NBuG8mwDi2FhgP+qok/vwHgwDKHNvhRCsQbph6T51IgNBPzdoZUSXckUvQUCkFRle6hz 0cBQvHY6i6WEFVVR4/0jkFpTieNRzIcYtH+THyTwejz1jNrDeKR20SBc4ckRNUlDbHVy u6vQ== X-Gm-Message-State: APjAAAUqBTQTOz9Yf+vSPALRptyW63thhanc4gHojGj66ybvcsEQUsT6 LbPAuJL2+uDk2ywCban/td0Bk/+X X-Google-Smtp-Source: APXvYqy9PUeHT1ImZIJ3eXQIdivj8b+H8eEGtn9TaxQ0c9TZ6nztrAxDO6yh3lhcxYuazdM9r5DrKw== X-Received: by 2002:a05:6638:a09:: with SMTP id 9mr2194367jan.95.1566285558385; Tue, 20 Aug 2019 00:19:18 -0700 (PDT) Received: from archbookpro.localdomain (CPE18593399858a-CM185933998587.cpe.net.cable.rogers.com. [174.112.89.95]) by smtp.gmail.com with ESMTPSA id o3sm16230673ioo.74.2019.08.20.00.19.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Aug 2019 00:19:17 -0700 (PDT) Date: Tue, 20 Aug 2019 03:19:16 -0400 From: Denton Liu To: Git Mailing List Cc: =?iso-8859-1?q?=C6var_Arnfj=F6r=F0?= Bjarmason , Junio C Hamano , Eric Sunshine Subject: [PATCH v3 13/13] format-patch: learn --infer-cover-subject option Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.1 (2019-06-15) Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Teach format-patch to use the first line of the branch description as the Subject: of the generated cover letter, rather than "*** SUBJECT HERE ***" if `--infer-cover-subject` is specified or the corresponding `format.inferCoverSubject` option is enabled. This complements the existing inclusion of the branch description in the cover letter body. The reason why this behaviour is not made default is because this change is not backwards compatible and may break existing tooling that may rely on the default template subject. Signed-off-by: Denton Liu --- Documentation/config/format.txt | 6 ++++ Documentation/git-format-patch.txt | 7 ++++ builtin/log.c | 56 +++++++++++++++++++----------- t/t4014-format-patch.sh | 35 ++++++++++++++++++- 4 files changed, 82 insertions(+), 22 deletions(-) diff --git a/Documentation/config/format.txt b/Documentation/config/format.txt index cb629fa769..2723566289 100644 --- a/Documentation/config/format.txt +++ b/Documentation/config/format.txt @@ -36,6 +36,12 @@ format.subjectPrefix:: The default for format-patch is to output files with the '[PATCH]' subject prefix. Use this variable to change that prefix. +format.inferCoverSubject:: + A boolean that controls whether or not to take the first line of + the branch description as the subject for the cover letter. See the + `--infer-cover-subject` option in linkgit:git-format-patch[1]. + Default is false. + format.signature:: The default for format-patch is to output a signature containing the Git version number. Use this variable to change that default. diff --git a/Documentation/git-format-patch.txt b/Documentation/git-format-patch.txt index 95bc4d53ca..c5bc0bf5c6 100644 --- a/Documentation/git-format-patch.txt +++ b/Documentation/git-format-patch.txt @@ -19,6 +19,7 @@ SYNOPSIS [--start-number ] [--numbered-files] [--in-reply-to=] [--suffix=.] [--ignore-if-in-upstream] + [--[no-]infer-cover-subject] [--rfc] [--subject-prefix=] [(--reroll-count|-v) ] [--to=] [--cc=] @@ -171,6 +172,11 @@ will want to ensure that threading is disabled for `git send-email`. patches being generated, and any patch that matches is ignored. +--[no-]infer-cover-subject:: + Use the beginning of the branch description (up to the first + blank line) as the cover letter subject instead of the default + "*** SUBJECT HERE ***". + --subject-prefix=:: Instead of the standard '[PATCH]' prefix in the subject line, instead use '[]'. This @@ -347,6 +353,7 @@ with configuration variables. signOff = true outputDirectory = coverLetter = auto + inferCoverSubject = true ------------ diff --git a/builtin/log.c b/builtin/log.c index 44b10b3415..a19b746495 100644 --- a/builtin/log.c +++ b/builtin/log.c @@ -774,6 +774,7 @@ static const char *signature = git_version_string; static const char *signature_file; static int config_cover_letter; static const char *config_output_directory; +static int infer_cover_subject; enum { COVER_UNSET, @@ -887,6 +888,10 @@ static int git_format_config(const char *var, const char *value, void *cb) } return 0; } + if (!strcmp(var, "format.infercoversubject")) { + infer_cover_subject = git_config_bool(var, value); + return 0; + } return git_log_config(var, value, cb); } @@ -993,20 +998,6 @@ static void print_signature(FILE *file) putc('\n', file); } -static void add_branch_description(struct strbuf *buf, const char *branch_name) -{ - struct strbuf desc = STRBUF_INIT; - if (!branch_name || !*branch_name) - return; - read_branch_desc(&desc, branch_name); - if (desc.len) { - strbuf_addch(buf, '\n'); - strbuf_addbuf(buf, &desc); - strbuf_addch(buf, '\n'); - } - strbuf_release(&desc); -} - static char *find_branch_name(struct rev_info *rev) { int i, positive = -1; @@ -1057,13 +1048,17 @@ static void make_cover_letter(struct rev_info *rev, int use_stdout, struct commit *origin, int nr, struct commit **list, const char *branch_name, + int infer_subject, int quiet) { const char *committer; - const char *body = "*** SUBJECT HERE ***\n\n*** BLURB HERE ***\n"; - const char *msg; + const char *subject = "*** SUBJECT HERE ***"; + const char *body = "*** BLURB HERE ***"; + const char *description = NULL; struct shortlog log; struct strbuf sb = STRBUF_INIT; + struct strbuf description_sb = STRBUF_INIT; + struct strbuf subject_sb = STRBUF_INIT; int i; const char *encoding = "UTF-8"; int need_8bit_cte = 0; @@ -1091,17 +1086,34 @@ static void make_cover_letter(struct rev_info *rev, int use_stdout, if (!branch_name) branch_name = find_branch_name(rev); - msg = body; + if (branch_name && *branch_name) + read_branch_desc(&description_sb, branch_name); + + if (description_sb.len) { + if (infer_subject) { + description = format_subject(&subject_sb, description_sb.buf, " "); + subject = subject_sb.buf; + } else { + description = description_sb.buf; + } + } + pp.fmt = CMIT_FMT_EMAIL; pp.date_mode.type = DATE_RFC2822; pp.rev = rev; pp.print_email_subject = 1; pp_user_info(&pp, NULL, &sb, committer, encoding); - pp_title_line(&pp, &msg, &sb, encoding, need_8bit_cte); - pp_remainder(&pp, &msg, &sb, 0); - add_branch_description(&sb, branch_name); + pp_title_line(&pp, &subject, &sb, encoding, need_8bit_cte); + pp_remainder(&pp, &body, &sb, 0); + if (description) { + strbuf_addch(&sb, '\n'); + strbuf_addstr(&sb, description); + strbuf_addch(&sb, '\n'); + } fprintf(rev->diffopt.file, "%s\n", sb.buf); + strbuf_release(&description_sb); + strbuf_release(&subject_sb); strbuf_release(&sb); shortlog_init(&log); @@ -1577,6 +1589,8 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix) { OPTION_CALLBACK, 0, "rfc", &rev, NULL, N_("Use [RFC PATCH] instead of [PATCH]"), PARSE_OPT_NOARG | PARSE_OPT_NONEG, rfc_callback }, + OPT_BOOL(0, "infer-cover-subject", &infer_cover_subject, + N_("infer a cover letter subject from branch description")), { OPTION_CALLBACK, 0, "subject-prefix", &rev, N_("prefix"), N_("Use [] instead of [PATCH]"), PARSE_OPT_NONEG, subject_prefix_callback }, @@ -1916,7 +1930,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix) if (thread) gen_message_id(&rev, "cover"); make_cover_letter(&rev, use_stdout, - origin, nr, list, branch_name, quiet); + origin, nr, list, branch_name, infer_cover_subject, quiet); print_bases(&bases, rev.diffopt.file); print_signature(rev.diffopt.file); total++; diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh index 7b8c8fe136..94a3191aca 100755 --- a/t/t4014-format-patch.sh +++ b/t/t4014-format-patch.sh @@ -822,7 +822,7 @@ test_expect_success 'format-patch --ignore-if-in-upstream HEAD' ' ' test_expect_success 'get git version' ' - git_version="$(git --version | sed "s/.* //")" + git_version="$(git --version >version && sed "s/.* //" actual && + grep "^Subject: \[PATCH 0/2\] config subject$" actual && + grep "^body" actual +' + +test_expect_success 'cover letter with command-line subject' ' + test_config branch.rebuild-1.description "command-line subject + +body" && + git checkout rebuild-1 && + git format-patch --stdout --cover-letter --infer-cover-subject master >actual && + grep "^Subject: \[PATCH 0/2\] command-line subject$" actual && + grep "^body" actual +' + +test_expect_success 'cover letter with command-line --no-infer-cover-subject overrides config' ' + test_config branch.rebuild-1.description "config subject + +body" && + test_config format.inferCoverSubject true && + git checkout rebuild-1 && + git format-patch --stdout --cover-letter --no-infer-cover-subject master >actual && + grep "^Subject: \[PATCH 0/2\] \*\*\* SUBJECT HERE \*\*\*$" actual && + grep "^config subject" actual && + grep "^body" actual +' + test_expect_success 'cover letter using branch description (1)' ' git checkout rebuild-1 && test_config branch.rebuild-1.description hello &&