From patchwork Tue Aug 27 04:04:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Denton Liu X-Patchwork-Id: 11116001 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 C52EF13B1 for ; Tue, 27 Aug 2019 04:04:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8FEAD206E0 for ; Tue, 27 Aug 2019 04:04:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="YrTQOXMO" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725904AbfH0EEy (ORCPT ); Tue, 27 Aug 2019 00:04:54 -0400 Received: from mail-io1-f54.google.com ([209.85.166.54]:37101 "EHLO mail-io1-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725766AbfH0EEy (ORCPT ); Tue, 27 Aug 2019 00:04:54 -0400 Received: by mail-io1-f54.google.com with SMTP id q22so43029769iog.4 for ; Mon, 26 Aug 2019 21:04:53 -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=YrTQOXMOGfE6cgRCJ+WB4+Ba7Mu75OZRUHy7SZAsPsNVqWACJ3xaz2aDncQM0pSnQO 3Gzx8azT/g6ITnnJlRUffpU5KcjpfR9RNPjLUMCTgx5vZcy3kK6H3UZmtiLlXnzmajSO XIQ3mS0ZSbM+ddHOhlrMO05EqlVb+0lnLEMC/H2UzK/aWO0lJi+PDdCxq1ZNcSS6ihs9 IluxgkGmGj98TR4wZMMT5+cXVBJbLnpvP14XLalWEKd5A4vvZMqsbifPwRTOaPgKR+ti PQII71yy9f1c5QZlv3IZGHzO4o2qstm62QY341RcXWLw9Tou4/oQQgv4L8LTPJ4wwbDK aFtA== 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=aV5m50wMDbXEqE+lU+Yee5WnVmvo27Da3LqdzbP6d+zpZs2ANmJUQJiHf7LPekuoPe 22q+AYbXXyaPChOUJBaxELplx5HE9lWjw6fQokO3Hj4G6EgblOMEuCxdVgUJmifMkTVz g7xFiTpgeCdC3uRAmR144FYCabbf/rf0IWFHZOhXtpfyfgFUhCQY7v675xdOPqbVZDH8 i2ofGyji/wcyGoVj/7vRXCjThjffYuZuS4m/C6Ix1EI/QteS/Dy6dQ/RE9tVMEaSQlKR 4Fg6+3GbDYlVd8uPFW7NQUTSDnLNg908PrKgUQwLlnDcEXLFNWf7z4Liub/IVrClkHiQ gjQQ== X-Gm-Message-State: APjAAAUK2fBthY+2PGPgQernvSnJ6rI4+uD697EzZeJwa/JAMW02V26U upaD385gVYhP8pAqC71lKekaT4iW X-Google-Smtp-Source: APXvYqxsB2jAHHUKkrgCNhHqe24Xzf9S1CfboUJb9tZ100vNP+g37QXepiZUu+b6sjlvx0ymXVdUzg== X-Received: by 2002:a02:a703:: with SMTP id k3mr20343594jam.12.1566878692665; Mon, 26 Aug 2019 21:04:52 -0700 (PDT) Received: from archbookpro.localdomain (CPE18593399858a-CM185933998587.cpe.net.cable.rogers.com. [174.112.89.95]) by smtp.gmail.com with ESMTPSA id s11sm12307314ioo.45.2019.08.26.21.04.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Aug 2019 21:04:52 -0700 (PDT) Date: Tue, 27 Aug 2019 00:04:50 -0400 From: Denton Liu To: Git Mailing List Cc: =?iso-8859-1?q?=C6var_Arnfj=F6r=F0?= Bjarmason , Junio C Hamano , Eric Sunshine , Johannes Sixt , Philip Oakley Subject: [PATCH v2 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 27 04:04:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denton Liu X-Patchwork-Id: 11116003 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 5540614D5 for ; Tue, 27 Aug 2019 04:04:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2982C2173E for ; Tue, 27 Aug 2019 04:04:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="vIlIVCjK" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726037AbfH0EE5 (ORCPT ); Tue, 27 Aug 2019 00:04:57 -0400 Received: from mail-io1-f68.google.com ([209.85.166.68]:45946 "EHLO mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725766AbfH0EE4 (ORCPT ); Tue, 27 Aug 2019 00:04:56 -0400 Received: by mail-io1-f68.google.com with SMTP id t3so42916166ioj.12 for ; Mon, 26 Aug 2019 21:04: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=9jrIbzWvoCYQgcJJyNCDCfNj2pQFwhu4pOWaG2kaKbQ=; b=vIlIVCjKlVZcUceNwCQuc29LIwrbQuyk5NsOiN3MF/n8+10VK5SXpEkT8iA4tNbmtm iHbVVo9lGcVkGTdAFhT7e1m6yqoGn3DXQLdzdyn+tG4aE5wgurkdkBMiXQLYxfvh9S8O qilV+O/FKyv/RKFkcIm0ZCE8KY0bTJKa6yaqXuOd8GgmdSUBlyk6GQi63xd3RCnqpwqj a/wydm5A7QKgPJeGnYCLUtRbTxRX+oP8yKnMQmEN+2mXuacYsIJ40FBV0LyeQqF/CWdg 3M5tWyL/2KDBlE5te4pqk5Z2mC0tT/jNwi5KNDMEUUmdE/w1wWVLorZLWVj/r0QRPeDP Bdkg== 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=9jrIbzWvoCYQgcJJyNCDCfNj2pQFwhu4pOWaG2kaKbQ=; b=nsQNFN3NjD+fWM1gDLMkT29MFpHiNVtXGnHN858JckMuqVbTiPJnmPZkeZnE9gNkO/ luhXyzI50rPn4MhxjChueihxNST6ul+BwIayQxrKDPzB79SPl4dJpKV0E9+TTT4xQeoT LQuT3nEy12XT5zH+GK/HZU37VzFWqUCFoewKxdpFSXBegtnpF5eTxpQhtH6vkJ9HkDdZ x8ii1sh8XUv+wGj9g/MPgodIJ4YVF2vrqCKR7MmmJG8vE8srSaAwzphu9ovrBt3xTlxL FI/FPvqAwNDpFFyc89Zi2iBcXZ1CH36If27GBiUui11lxzU4qerEDtikuxqd2jd3AV2c yCTg== X-Gm-Message-State: APjAAAUFKLZDwrGsDELo1KlPhr2VbX1kCRhyFvIcwqrbWh1B24JvEncp 5wuK9GHR1MetLl9ZvVvcx1hrHJLl X-Google-Smtp-Source: APXvYqzQbealvL+NJIKsKSXZcCPwFmrKCJ+hxFNTe1g3Uxb5wtFd+B69/n9qQdbOAcXeD6EZb68lgw== X-Received: by 2002:a5d:9403:: with SMTP id v3mr14940956ion.281.1566878695629; Mon, 26 Aug 2019 21:04:55 -0700 (PDT) Received: from archbookpro.localdomain (CPE18593399858a-CM185933998587.cpe.net.cable.rogers.com. [174.112.89.95]) by smtp.gmail.com with ESMTPSA id h18sm10917450iob.80.2019.08.26.21.04.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Aug 2019 21:04:55 -0700 (PDT) Date: Tue, 27 Aug 2019 00:04:52 -0400 From: Denton Liu To: Git Mailing List Cc: =?iso-8859-1?q?=C6var_Arnfj=F6r=F0?= Bjarmason , Junio C Hamano , Eric Sunshine , Johannes Sixt , Philip Oakley Subject: [PATCH v2 02/13] t4014: s/expected/expect/ Message-ID: <0a5ce9b95f837fb7c6b526201fa619da15fb2625.1566878373.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 of "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 27 04:04:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denton Liu X-Patchwork-Id: 11116005 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 D935614D5 for ; Tue, 27 Aug 2019 04:05:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B6CEF2173E for ; Tue, 27 Aug 2019 04:05:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="D8B6rM7J" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726071AbfH0EE7 (ORCPT ); Tue, 27 Aug 2019 00:04:59 -0400 Received: from mail-io1-f67.google.com ([209.85.166.67]:34189 "EHLO mail-io1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725766AbfH0EE7 (ORCPT ); Tue, 27 Aug 2019 00:04:59 -0400 Received: by mail-io1-f67.google.com with SMTP id s21so43089929ioa.1 for ; Mon, 26 Aug 2019 21:04: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=IUxUkhQu8IKRPJnJfvXqpZRjIm/zAINbPLEtvMCz0aY=; b=D8B6rM7JeD6uBzEZt4cFSdJ20K+noeloMoq+yDUIYgYbov5YgNp/hxOBcoRQrpGTQX hAGBQCOTQPGLFmMnyXwKTfHyQt85/LF7v7LL2GNd8FH6bHGrylVMvTebKEZw/psQg/oQ ug1dk53h/QftfYL7wdhVYUrBokb6XIJC6L3+sT/9Bc55XfWfoRo0tFr+s/x8vzlZbK/K ObLLhOr1zAviPcf7/LyIOywaZ6vgbUbUs+iM2lozmBW14oOJnuCIbv5aXSdsFjMUJPsc eRAiGMCFaxu8nw40h4xpm4nuyl6xTpFoGhA8ioLKb+d3+2LqdVvCgVPrkSMmdBNddtq5 34qg== 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=hF9/wR/dEVk15duSAwltu2eVJygl0mKzKHdxNfy2VAAY8bv725uhFwJZwidvZL8xal D/UVhWzNyxzCHphTI738w496XRuW+tPbJnbwa1PX3pavKIYHlW1p/r+Pg1orEm5nLk+v eQHOVPsF082sREbRqiXY91WKaCsTM5AOkBphaa1FGjVGOAMjaladl//zCzK8nqG2fjA/ exz+lj1IYm+CY97HLdwVE/KP13maJi634Wd1x+kONOBXoweciWp+/JwTNv+ZmGCr6PiA c+KSyW843vidol8AlW066LF+sT9nMRWwsD1U7b+RDh2e5Kh+QTJiKWUD09D6Blebpe4l bXxQ== X-Gm-Message-State: APjAAAUtARB3Byye0hCvVOK7oIeLKlL0Nt+G5vPjwcD6EEooqOFllr/d RG/GtUjWzf+FDdRAf1Qj5kbk546e X-Google-Smtp-Source: APXvYqynhM0rjy8heFiavTnlO/SB2SSNtJluS5a6qJJHM54hd4Hq6GZhO4zEQ90Y62uWqw5qVgko6Q== X-Received: by 2002:a02:cc8f:: with SMTP id s15mr21339898jap.53.1566878698152; Mon, 26 Aug 2019 21:04: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 s4sm17307384iop.25.2019.08.26.21.04.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Aug 2019 21:04:57 -0700 (PDT) Date: Tue, 27 Aug 2019 00:04:55 -0400 From: Denton Liu To: Git Mailing List Cc: =?iso-8859-1?q?=C6var_Arnfj=F6r=F0?= Bjarmason , Junio C Hamano , Eric Sunshine , Johannes Sixt , Philip Oakley Subject: [PATCH v2 03/13] t4014: move closing sq onto its own line Message-ID: <5c49703aa4fd3741d1685d25b647d775003f9962.1566878373.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 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 27 04:04: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: 11116007 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 2ED2A13B1 for ; Tue, 27 Aug 2019 04:05:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0DFB32173E for ; Tue, 27 Aug 2019 04:05:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bibesXJJ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726125AbfH0EFB (ORCPT ); Tue, 27 Aug 2019 00:05:01 -0400 Received: from mail-io1-f65.google.com ([209.85.166.65]:42005 "EHLO mail-io1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725766AbfH0EFB (ORCPT ); Tue, 27 Aug 2019 00:05:01 -0400 Received: by mail-io1-f65.google.com with SMTP id e20so42905623iob.9 for ; Mon, 26 Aug 2019 21:05: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=Il9LwpJVzdzduiFquLf1KD7uEGxhXQfU8tLcnW9qImI=; b=bibesXJJBpowUKBZ89urZ/qJm62aS/12IHyGCqDmcCMGME2pfxiAHNoHx9kIxnp2vs aPiT5OLGfPEGm7lZQ9U1FIWVDai/Yfw8bHuSU/r6FaAAWRSnlmDlvLFS3IKkj3Li0bZR ZyuETVd5aglJ72If3ITQTIOimJ0eVRjRJ9EasuGv+vhfc9rcCEvbp8WK32PIH2COj3Iy 9LWkP0dKikAS8eLsYvfjDxn9E5itsWIVdig5MKZNcoY5po/KU4P52+1jH7Rem8HD2kiD W3fVV6NoB4uA8A2snD+Jtr1+mqM55Kd5jBtZUrwoVMEZu4gqDRlqb8gss5COv1fzvkcB d1Ww== 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=grvHMhj6lcti4V+Iyvj7or4hQk1aO30DxreLhTCMHdq3QxSj+i+5SqtsSWNvP0+GPc hkz0ftBphjf3WJdMM0+B2dAk4hmH722/11vWszgiaPt1q7BFCorsINBDT6+0TaTOj69z Sk6IG4c+IXr20ZrDG7o0MvRHWxlDIwEF5MAAXC7GskR7rFMzmEp3P6X4W5myEwgZLD8Q l9lRIuBrkT7j6eDSta1yr02fhZNfOJUyzBdvqgydvhzNK657nRA6PkLo7ob5/52/RPYj t7B6VCDq/Xb1PcmwekhLpIKyd/yNEL2ujrIHF/Tubw5hTXalspVNsmU8fSdc02O6rH3x HBFw== X-Gm-Message-State: APjAAAUQJL9oxDGwluIcAXoxoKETWbsOLlv/GZA0HVHxWSGaM8B6b+0i 7IGt2bp3yXY1k0sXaK97WLN4xm7f X-Google-Smtp-Source: APXvYqx8MUsLvMoX0HFvDN62+VkMZHrRt5N8A43F+5nR6dFVoNDqT/2OyTXtbm7oXt63Iin8Vu6xEg== X-Received: by 2002:a6b:730f:: with SMTP id e15mr422395ioh.74.1566878700602; Mon, 26 Aug 2019 21:05: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 p3sm11095240iom.7.2019.08.26.21.04.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Aug 2019 21:05:00 -0700 (PDT) Date: Tue, 27 Aug 2019 00:04:58 -0400 From: Denton Liu To: Git Mailing List Cc: =?iso-8859-1?q?=C6var_Arnfj=F6r=F0?= Bjarmason , Junio C Hamano , Eric Sunshine , Johannes Sixt , Philip Oakley Subject: [PATCH v2 04/13] t4014: use sq for test case names Message-ID: <02a11147fd016be4f0933cc30a759cb688506f4f.1566878373.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 27 04:05:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denton Liu X-Patchwork-Id: 11116009 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 A4F1F13B1 for ; Tue, 27 Aug 2019 04:05:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 77E4F2173E for ; Tue, 27 Aug 2019 04:05:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="LpVmIMSh" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726140AbfH0EFE (ORCPT ); Tue, 27 Aug 2019 00:05:04 -0400 Received: from mail-io1-f65.google.com ([209.85.166.65]:37736 "EHLO mail-io1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725766AbfH0EFE (ORCPT ); Tue, 27 Aug 2019 00:05:04 -0400 Received: by mail-io1-f65.google.com with SMTP id q22so43030467iog.4 for ; Mon, 26 Aug 2019 21:05:03 -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=LpVmIMShc8Cu6RckQS9BtVxLiyNQ9y1J5Rj4UEMzBc91AgPyU820ILC0BRDkkcpDUa 0dGcuHNqq6mGY8R3to4u5nUN5TBotfFxK848GS+iAf1yaEzFJAOi28OxKLgD8KchqUpc BFjRLdpHYex0FtFGXGPImMfWEL4lFhGQzdJSxuDgfNa+HHGwYFoOPKkWCCrjyS7Lijp9 q3GkTw1yL7FHioSivFHx0afWRZvJelcxuTwQyOH9ccS19z/BLO8FTE7UtPdfpZIl8KZB DVFBje9rTvbnhv/6L7O1Xl/jYtvLTMFZFPSmRggnTKivpUtRikSp7lQA8qmCg5T3V8kT 6Dfg== 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=psneryNiMRE0TN9qwT0qLtfVXgBh4MZmbUVklAbUGVMNsiVGcoecLNk0HSKiEj5I1X kMvyET+ANkN7xub6PuGR33cYtk3VCeqTcb4LfPcgQxS6dCt7Wz+8ihxlErrV1voLW4C3 obuPtD8pP4Mp6p20aekub9Q8f9dWywGZGw+uz3um29Z3SJZL/+MfiAz4o9JB7bgvoOaT tIuM6j/46OReVUf1MFtKRqE2Kr25sJEJNs7CUKlqTQg19IBeQNxAh7Mx0l51NIyQEoII EzBLw0+DXb/LBAjn2icQ0NTygXlB5HjJAG5eG1PllLjW2BcyTrKX16PQ3KzabXD2jUml +geg== X-Gm-Message-State: APjAAAXBMgK0jLVpQ1peTJB3fKqOWn33WkRBAdoGTQgJSLR1jSiAY3zn 7UbPCPfJPn9VxQ3CyQJScIJYe5lh X-Google-Smtp-Source: APXvYqyNc1Fjq1UkYx4PG3iZow3eEMUKVJFkiL4a53FwCY805pkivw2HBEkSoEG17L3lN2C5wUoS1g== X-Received: by 2002:a5e:9412:: with SMTP id q18mr6858602ioj.112.1566878703067; Mon, 26 Aug 2019 21:05: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 j11sm477845ioa.55.2019.08.26.21.05.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Aug 2019 21:05:02 -0700 (PDT) Date: Tue, 27 Aug 2019 00:05:00 -0400 From: Denton Liu To: Git Mailing List Cc: =?iso-8859-1?q?=C6var_Arnfj=F6r=F0?= Bjarmason , Junio C Hamano , Eric Sunshine , Johannes Sixt , Philip Oakley Subject: [PATCH v2 05/13] t4014: remove spaces after redirect operators Message-ID: <8d9791c0611897f3bd3cbeaf5df65db8925a3e65.1566878373.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 27 04:05: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: 11116011 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 BA7C114D5 for ; Tue, 27 Aug 2019 04:05:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8CBCC206E0 for ; Tue, 27 Aug 2019 04:05:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="E5wSS6wq" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726232AbfH0EFH (ORCPT ); Tue, 27 Aug 2019 00:05:07 -0400 Received: from mail-io1-f68.google.com ([209.85.166.68]:39671 "EHLO mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725766AbfH0EFH (ORCPT ); Tue, 27 Aug 2019 00:05:07 -0400 Received: by mail-io1-f68.google.com with SMTP id l7so43063676ioj.6 for ; Mon, 26 Aug 2019 21:05: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=/pQmeh6he9iEyqMs6LHy0NzLVmE3L+BX4bVCvFJpJrE=; b=E5wSS6wqRGdvHbEMVGxLogoRpZDI/lpx/Q6NRG4vut0ReFYoOCn9aHgyyZjMk52xZ9 sa/BNBcAfmvrQmrZe8Jbvts9giUtTy1tQVx0FYtqIKsYX3HgHOCbQiYRSliOVAlGAwcW AcZbLODYAI3DeSBVWksqPNLsLkadQQGrcLmF5wIWsc7ek4fM5n+lUv35xbZNlgcknG9P 1QnAYB05FzZ7WyAZZwzypshtB4AnAQFl3E5m4KD+aD8ccG4o/Rd1f7A05ZHTnzjOLkUV 1HEkk1WZ6tUnjF0bauw6uiPvwj+76GA5mQEH0NUxBTnw8XGEO9C9HDaLaifwAaxxw3gU 7coQ== 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=OgqoOgKfxEVkIfy5jHj/96dsVetStg38Ty0i2eSq+/sZgA8g6qVSvB35Bf6Fi8plG3 9tbn5E6F73nwHFr+QDqhO8PaMLkJdj+FdPaVMxvccDawL2OsDfFhLd38bExSAlx2/vVU H/vROb7W3tXJpZsCXjjG572jtlod0Jqm4gjIsE6XMK5tw5gK38jRLpSEorJ0uj2j8cjT /zKH1B24IfidQVtAYjwur6wqwn6CFmy8TqfW/0Pqodg02xFWPcFkVPGgALkvSd0WWd6D CQqk6AeDqdeFOQBg0jCQ28XdBdzeKUtReyaYBi+w0NHa+Occ9CSAagFkL6HMujSjdUPU C4kA== X-Gm-Message-State: APjAAAVUjvf8yr1RV2y7/YT42MynM2XPSSRt9uINMs/u17gc6CjLw9hr rL7AP17T83xEFw7iO5Kqw0Hyqqmx X-Google-Smtp-Source: APXvYqyARnQc1gtY0azz2+Y9wiQCbnQWNpaYbAvmIduDIfbxfPGHEI31iHmknLYrjJJcaRN+x8nMlw== X-Received: by 2002:a6b:b549:: with SMTP id e70mr23070162iof.95.1566878705454; Mon, 26 Aug 2019 21:05:05 -0700 (PDT) Received: from archbookpro.localdomain (CPE18593399858a-CM185933998587.cpe.net.cable.rogers.com. [174.112.89.95]) by smtp.gmail.com with ESMTPSA id l26sm12454980ioj.24.2019.08.26.21.05.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Aug 2019 21:05:05 -0700 (PDT) Date: Tue, 27 Aug 2019 00:05:03 -0400 From: Denton Liu To: Git Mailing List Cc: =?iso-8859-1?q?=C6var_Arnfj=F6r=F0?= Bjarmason , Junio C Hamano , Eric Sunshine , Johannes Sixt , Philip Oakley Subject: [PATCH v2 06/13] t4014: use indentable here-docs Message-ID: <90ad0fcf703e8b932789194b0a86ce061ffd48e0.1566878373.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 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 27 04:05:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denton Liu X-Patchwork-Id: 11116013 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 22DA214D5 for ; Tue, 27 Aug 2019 04:05:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F3EC4206E0 for ; Tue, 27 Aug 2019 04:05:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ZfmWyP9O" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726328AbfH0EFK (ORCPT ); Tue, 27 Aug 2019 00:05:10 -0400 Received: from mail-io1-f68.google.com ([209.85.166.68]:41553 "EHLO mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725766AbfH0EFJ (ORCPT ); Tue, 27 Aug 2019 00:05:09 -0400 Received: by mail-io1-f68.google.com with SMTP id j5so42989345ioj.8 for ; Mon, 26 Aug 2019 21:05:08 -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=ZfmWyP9OklezlXFwLz6fRwBDL/IQHa2ArWnRwcLmU3erIojVvlxdQHtnseLKjJMloc NKTq0wd9l6O9F4u4hBEg6mTaq0IVsjOK4SE6pEtpV0MCMNOh6RRd1X6l5If2ZWOlVMj9 fHoygyEW5tl1TlfokoYQtV9QN3T3cE6MPknuW/tMXPJ5zac9yaFGS6u8VbI3CIHeqGp3 RzjyXfpxfXVcWr7JPCsIYlmh1cyjLafdeUSdnSvhVsJ9xF5iMKt10++iPIKQ7ctLNl0b mbsg0Wb4mSEGK4ew2XdUkMPzhRFzuEM7zTG3ObBJGWoLOTKlWAFHIBGOFQ9lm/7amYv4 Qvrw== 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=AxgsDxkNC8YGznAPskNmXgy0CiPMl2An1eoHDPdeWRwGFA1zxxaEfnV7L0H0LC+OZF foEyLfXYSg2OODb6cyK9cv/4haFGFlWqEVzvTavmss1AWuNNXzY5IPzg9jJYxwnKE3JR PWoXQ04Hp/SvWG4+Hd+wTtumbAGR9AHgoKaC05IZvWQKqniYQZhNePzdL4zDLvhqVbK7 eMOW+WcOPw5pzG1GhFW0M/WTJnmMuo1iWMAOraCbPw9KIltMmFr9GVYBwEyGYZwKcF8/ PS6cdpU/OPqGAAFUoFXWE0f+GP76QB00iZmFqhx5Gl99/AKJr0GnCEPlMV/X3LOaQT89 IE5A== X-Gm-Message-State: APjAAAUQuX+xMdPdYEvn+WIhKHl1Ny433hkVMwEfBsHc86IMiVvE/XUp rCK9485rxX/IuXcLZCZMfEP3KwsP X-Google-Smtp-Source: APXvYqwE3Z+m/WKRNtbG57OYLryNvV8QqKQDcquVs4ICwJeDgAugHE30y9GUS12EPjDZxNv+MOKVvw== X-Received: by 2002:a6b:bcc4:: with SMTP id m187mr1834069iof.16.1566878707731; Mon, 26 Aug 2019 21:05:07 -0700 (PDT) Received: from archbookpro.localdomain (CPE18593399858a-CM185933998587.cpe.net.cable.rogers.com. [174.112.89.95]) by smtp.gmail.com with ESMTPSA id e19sm11576569ioe.78.2019.08.26.21.05.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Aug 2019 21:05:07 -0700 (PDT) Date: Tue, 27 Aug 2019 00:05:05 -0400 From: Denton Liu To: Git Mailing List Cc: =?iso-8859-1?q?=C6var_Arnfj=F6r=F0?= Bjarmason , Junio C Hamano , Eric Sunshine , Johannes Sixt , Philip Oakley Subject: [PATCH v2 07/13] t4014: drop redirections to /dev/null Message-ID: <804b3163f866cce0b8a928256b5009fc42dbc709.1566878373.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 27 04:05:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Denton Liu X-Patchwork-Id: 11116015 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 3103613B1 for ; Tue, 27 Aug 2019 04:05:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0FA8F217F5 for ; Tue, 27 Aug 2019 04:05:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="o+X6oV5O" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726421AbfH0EFM (ORCPT ); Tue, 27 Aug 2019 00:05:12 -0400 Received: from mail-io1-f68.google.com ([209.85.166.68]:33600 "EHLO mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725766AbfH0EFL (ORCPT ); Tue, 27 Aug 2019 00:05:11 -0400 Received: by mail-io1-f68.google.com with SMTP id z3so43084417iog.0 for ; Mon, 26 Aug 2019 21:05:10 -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=5CZtzHBRy270Vzz6Wj11mXIU6zXYVoRh3DdTKzfWSdQ=; b=o+X6oV5OJWb3TfPULav7aj+c5sxN7d44LGfITm3izMPqwbDkBd8+cZ86r5mcFHUU3+ CGL9dJMjimT0+qoMB7ymEbh7BM1CLpiNT/4N4l9ZFMSUvqQxUtxAdJvj1O/2X545BOhG O+hzvIpMKRaj5DcZ66mDcqocOjQUh97lbG+l5+OMgg0ZhS/LIs4lKKmIuswRDdCiH4SX 1iFznLx+tBh5KsWRmM4JjO3TnDy432bpvRvMFv2V25dU+zta4/T/XqjmsTySaYSrC3It SClW1JGjgHgIOh4PlFYpTDVGxlmpsVLZBKkfr+UsoNLHKeSsf2ZKW/1+grPVsQZzzQIl 3v9g== 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=5CZtzHBRy270Vzz6Wj11mXIU6zXYVoRh3DdTKzfWSdQ=; b=o/vd8/G+AuojjlAipb40xvaSXUAy4QpEkx77I/9XhTpeHViWMfEiFxweuQRT1dUz08 /ONdp80PQcK/EFEXdQLlMC2wDX37SHVRhIrsdcknsObLSI8BdwwioaZbhQo1r9wHs4zh b2yLeNB3CwC4ybNo8tytJ6+O+Vp+hZSaP10pYqiDaER47f1qLqfnOYdKNLlPVKKA6uS5 lc/2Wr3JuEg2wjS1BjL/ZACvc45imoe+wVmug57K2adKkpBoAFNAY9000wsrPQ5rz1ja fE0JtNtmpmHcoGS7Aoybdl0zUAgMcAc7g+mEbni2V11zaNZgeEFAJ28L/AiZZTL9KpxY xP1A== X-Gm-Message-State: APjAAAWItd7DfR5XPF3ZJUoI30ghnNqS4ZTueM1INTL8ECD2cpxboHLU vMktvLTJe42EqhaZ5pGqp1nJN47m X-Google-Smtp-Source: APXvYqwzXqQyMwcXTrgWUMF3z2KS6v5oNiOaHP1zrrIFuJgg7rSEvpf9Nm17MqACfXBwQwOCv2e2qw== X-Received: by 2002:a5d:8457:: with SMTP id w23mr1818245ior.189.1566878710042; Mon, 26 Aug 2019 21:05: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 q8sm11443768ion.82.2019.08.26.21.05.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Aug 2019 21:05:09 -0700 (PDT) Date: Tue, 27 Aug 2019 00:05:07 -0400 From: Denton Liu To: Git Mailing List Cc: =?iso-8859-1?q?=C6var_Arnfj=F6r=F0?= Bjarmason , Junio C Hamano , Eric Sunshine , Johannes Sixt , Philip Oakley Subject: [PATCH v2 08/13] t4014: let sed open its own files Message-ID: <967e624bb4ade3ec1ddaa4e30566e2d938a6cfed.1566878374.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 In some cases, we were using a redirection operator to feed input into sed. However, since sed is capable of opening its own files, make sed open its own files instead of redirecting input into it. Signed-off-by: Denton Liu --- t/t4014-format-patch.sh | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh index 2048fb2008..35cf798847 100755 --- a/t/t4014-format-patch.sh +++ b/t/t4014-format-patch.sh @@ -596,7 +596,7 @@ 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 && + sed -e "1,/A U Thor/d" -e "/^\$/q" 0000-cover-letter.patch >output && test_cmp expect output ' @@ -635,7 +635,7 @@ 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 && + sed -e "1,/^\$/d" -e "/^+5/q" 0001-This-is-an-excessively-long-subject-line-for-a-messa.patch >output && test_cmp expect output ' @@ -890,7 +890,7 @@ test_expect_success 'prepare mail-signature input' ' test_expect_success '--signature-file=file works' ' git format-patch --stdout --signature-file=mail-signature -1 >output && check_patch output && - sed -e "1,/^-- \$/d" actual && + sed -e "1,/^-- \$/d" output >actual && { cat mail-signature && echo } >expect && @@ -901,7 +901,7 @@ test_expect_success 'format.signaturefile works' ' test_config format.signaturefile mail-signature && git format-patch --stdout -1 >output && check_patch output && - sed -e "1,/^-- \$/d" actual && + sed -e "1,/^-- \$/d" output >actual && { cat mail-signature && echo } >expect && @@ -923,7 +923,7 @@ test_expect_success '--signature-file overrides format.signaturefile' ' git format-patch --stdout \ --signature-file=other-mail-signature -1 >output && check_patch output && - sed -e "1,/^-- \$/d" actual && + sed -e "1,/^-- \$/d" output >actual && { cat other-mail-signature && echo } >expect && @@ -992,7 +992,7 @@ test_expect_success 'format-patch wraps extremely long subject (ascii)' ' git add file && git commit -m "$M512" && git format-patch --stdout -1 >patch && - sed -n "/^Subject/p; /^ /p; /^$/q" subject && + sed -n "/^Subject/p; /^ /p; /^$/q" patch >subject && test_cmp expect subject ' @@ -1031,7 +1031,7 @@ test_expect_success 'format-patch wraps extremely long subject (rfc2047)' ' git add file && git commit -m "$M512" && git format-patch --stdout -1 >patch && - sed -n "/^Subject/p; /^ /p; /^$/q" subject && + sed -n "/^Subject/p; /^ /p; /^$/q" patch >subject && test_cmp expect subject ' @@ -1040,7 +1040,7 @@ check_author() { git add file && GIT_AUTHOR_NAME=$1 git commit -m author-check && git format-patch --stdout -1 >patch && - sed -n "/^From: /p; /^ /p; /^$/q" actual && + sed -n "/^From: /p; /^ /p; /^$/q" patch >actual && test_cmp expect actual } @@ -1160,7 +1160,7 @@ test_expect_success '--from=ident replaces author' ' From: A U Thor EOF - sed -ne "/^From:/p; /^$/p; /^---$/q" patch.head && + sed -ne "/^From:/p; /^$/p; /^---$/q" patch >patch.head && test_cmp expect patch.head ' @@ -1172,7 +1172,7 @@ test_expect_success '--from uses committer ident' ' From: A U Thor EOF - sed -ne "/^From:/p; /^$/p; /^---$/q" patch.head && + sed -ne "/^From:/p; /^$/p; /^---$/q" patch >patch.head && test_cmp expect patch.head ' @@ -1182,7 +1182,7 @@ test_expect_success '--from omits redundant in-body header' ' From: A U Thor EOF - sed -ne "/^From:/p; /^$/p; /^---$/q" patch.head && + sed -ne "/^From:/p; /^$/p; /^---$/q" patch >patch.head && test_cmp expect patch.head ' @@ -1197,7 +1197,7 @@ test_expect_success 'in-body headers trigger content encoding' ' From: éxötìc EOF - sed -ne "/^From:/p; /^$/p; /^Content-Type/p; /^---$/q" patch.head && + sed -ne "/^From:/p; /^$/p; /^Content-Type/p; /^---$/q" patch >patch.head && test_cmp expect patch.head ' @@ -1788,7 +1788,7 @@ test_expect_success 'interdiff: cover-letter' ' git format-patch --cover-letter --interdiff=boop~2 -1 boop && test_i18ngrep "^Interdiff:$" 0000-cover-letter.patch && test_i18ngrep ! "^Interdiff:$" 0001-fleep.patch && - sed "1,/^@@ /d; /^-- $/q" <0000-cover-letter.patch >actual && + sed "1,/^@@ /d; /^-- $/q" 0000-cover-letter.patch >actual && test_cmp expect actual ' @@ -1804,7 +1804,7 @@ test_expect_success 'interdiff: solo-patch' ' EOF git format-patch --interdiff=boop~2 -1 boop && test_i18ngrep "^Interdiff:$" 0001-fleep.patch && - sed "1,/^ @@ /d; /^$/q" <0001-fleep.patch >actual && + sed "1,/^ @@ /d; /^$/q" 0001-fleep.patch >actual && test_cmp expect actual ' From patchwork Tue Aug 27 04:05:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denton Liu X-Patchwork-Id: 11116017 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 B9F9E14D5 for ; Tue, 27 Aug 2019 04:05:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 98C132173E for ; Tue, 27 Aug 2019 04:05:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="DRok/ps7" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727718AbfH0EFO (ORCPT ); Tue, 27 Aug 2019 00:05:14 -0400 Received: from mail-io1-f65.google.com ([209.85.166.65]:44637 "EHLO mail-io1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725766AbfH0EFO (ORCPT ); Tue, 27 Aug 2019 00:05:14 -0400 Received: by mail-io1-f65.google.com with SMTP id j4so34656047iog.11 for ; Mon, 26 Aug 2019 21:05:13 -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=PdNpr+xjrLYU2MoWEBNF3xcNAmtPLys44nVVsueTa5k=; b=DRok/ps7ro+HCrjFsaikfulZm1IpxuHS7BLoatFgX7qGLXyCpTJVRfsJQDxz3zOe7z zHS2m7yjiub85IaPjP16FpF27El8sUrZ9D+jV03xHQqZduR2AHt3Ti6beaDJdAVmlHsQ f8+uxqJoaIz8sStugzwW8+fQviz7yjb8BscR/MNkYc3GvlfzaivpvOCWyaHW1zQy4Yjh hD+t9NI7I7WHu21QgNkpGhev1BrJFvrkMHlazkTOe3RcXAPjNZC30YU0LE1TCCC3f03c RNsOMrpyOF/r+f7giMEVPmYhUPA1Cxrzz5loJ0lFcJObmDSPeZP7FTTHlM3DP+EXV25A Z1QQ== 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=PdNpr+xjrLYU2MoWEBNF3xcNAmtPLys44nVVsueTa5k=; b=g+nGF5qgz0KjM6mkm64pSEUBPhSsjwesP0scQvoH7g53ivL2+LkvRM3I5LGjwWwOSm pX1aCvNAUUFN0PIOkkvqDzYD9rckN4Ba8pLkrXXC4gcxyBj9M24gEEGIT1lwSbAo/zME OywhQxCi2mTS4oOHC3XKa3V9HnRZIN11UVsttUYg+Wdxt9bP3yDJrCzPzIipP1ryZ7hn F3gR3+UQbSqIx/0VYQ5uertoL6tx9AYAsZ5ufaKzGDgh+x+/1QgToopzkaji/u7j2bo4 3UL+R7Wlg9DALpq6jnp8Jk6MEPtk14Zgx9jD0ViKyBZUrJxCWiAr43bWOqdwMlV2YnOk YA+Q== X-Gm-Message-State: APjAAAWNDFyLzM0tj9W23h5Thv3I8W5okFT9XugfAqC9xh9XoTednwv+ jaA93CpSx4nMiHPfTy4qYhWpp1OT X-Google-Smtp-Source: APXvYqywDVKv+J0KrulSmZUOuZYtcLuFuNyvkgjV3mAtSxUxROSG+BTIupmrdo7HnsnEuudY22R7Bg== X-Received: by 2002:a5e:8344:: with SMTP id y4mr4729459iom.213.1566878712522; Mon, 26 Aug 2019 21:05:12 -0700 (PDT) Received: from archbookpro.localdomain (CPE18593399858a-CM185933998587.cpe.net.cable.rogers.com. [174.112.89.95]) by smtp.gmail.com with ESMTPSA id v10sm13759244iob.43.2019.08.26.21.05.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Aug 2019 21:05:12 -0700 (PDT) Date: Tue, 27 Aug 2019 00:05:10 -0400 From: Denton Liu To: Git Mailing List Cc: =?iso-8859-1?q?=C6var_Arnfj=F6r=F0?= Bjarmason , Junio C Hamano , Eric Sunshine , Johannes Sixt , Philip Oakley Subject: [PATCH v2 09/13] t4014: use test_line_count() where possible Message-ID: <9a42ec2b7e5f9bea3676655e3a066acac3bee1f6.1566878374.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 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 35cf798847..18142ee5fa 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 27 04:05:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denton Liu X-Patchwork-Id: 11116019 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 CC41314D5 for ; Tue, 27 Aug 2019 04:05:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AAECC2173E for ; Tue, 27 Aug 2019 04:05:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="PMj9kDQk" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728823AbfH0EFQ (ORCPT ); Tue, 27 Aug 2019 00:05:16 -0400 Received: from mail-io1-f67.google.com ([209.85.166.67]:37781 "EHLO mail-io1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725766AbfH0EFQ (ORCPT ); Tue, 27 Aug 2019 00:05:16 -0400 Received: by mail-io1-f67.google.com with SMTP id q22so43031634iog.4 for ; Mon, 26 Aug 2019 21:05:15 -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=XVN3uoweg9olm4lkkysRDVARDiy1wDmhHAGBz6iSCUo=; b=PMj9kDQkxDCR2MTxaNl0kmAbLUIk8eR1E0o9dlzO+x/PGfZiR0BeuKy4xRYlpkRWDM cjKSZ6e4wKFtSKCtfO+Ijbd0EjJvMvm4SZalQZj2pBUvRJV2cHiBi/YsWK29pVMkEAcu VjgGurrnN8ufBPbPi4HgVkl6LGEKjalFLR5pDTdef7DqDV5iXbjP5EVdYKZ5IPQa/0SL LaDqNX+uCv7qJIvM2VXU4QuhCrWVDRiHkZt3PhQbFmP4lfnJJB5wjQDenHrJt8CAm+ad bTqBP/5ZAPXFhL/GhIyc2rEKO/kqq+0BesOc4S0YvSOO+yqchQCgSc9udR7CgZYA5P8e h8Hg== 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=XVN3uoweg9olm4lkkysRDVARDiy1wDmhHAGBz6iSCUo=; b=cMRteLeCiO1Axf/qinlYuvLb+shaNDpdIcupRNPfZVrjQUAwFu20De8F2ImG4Gv+e+ w0OYWK0bu1CfiufKQuhOKcnHbXf/IC9/a6Sfuy6IpcbulcXrjBKgu4HcKifE6sw58dIt 05rbeoDDuvw2Ah75KTXuMx+H1Wtxy6GCSwYssBpXvoLGYSNPQpzo6lLTrOfnV4HcUyS7 kbU42eDP/LY4SGIYeqjAkHyImVDZ8TI9nHsRAsJxPMXHamExFpUDy6vPYgwcsuvX+5YD 4x3OIiBu2NNnc66NSs+3U0m423SjoXkAPQYu9uI2w6SsihzX73yMrrfDXWfARv9GjoJw IzkA== X-Gm-Message-State: APjAAAWDFW8Eg/PS8teY63ZYg0PTLg9NE0aHs2CVgeurBLhut/atgNpX bXhbMG7Kn+wgZ4/zJZwxRmh84X79 X-Google-Smtp-Source: APXvYqwQPPvrkf/z0tqW+03jpNfh4SSvTyK+SMfAXVHx4neVxdP8z7D0gjfcIzd/bK9Z8u2rjC63tQ== X-Received: by 2002:a5e:8b03:: with SMTP id g3mr3785329iok.170.1566878715046; Mon, 26 Aug 2019 21:05: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 p1sm9192865iol.11.2019.08.26.21.05.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Aug 2019 21:05:14 -0700 (PDT) Date: Tue, 27 Aug 2019 00:05:12 -0400 From: Denton Liu To: Git Mailing List Cc: =?iso-8859-1?q?=C6var_Arnfj=F6r=F0?= Bjarmason , Junio C Hamano , Eric Sunshine , Johannes Sixt , Philip Oakley Subject: [PATCH v2 10/13] t4014: remove confusing pipe in check_threading() Message-ID: <8acc90f74d89301646f8120ebb79eb9170f64743.1566878374.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 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 18142ee5fa..67f4c62ed6 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 27 04:05:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Denton Liu X-Patchwork-Id: 11116021 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 8056013B1 for ; Tue, 27 Aug 2019 04:05:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4AC4D2173E for ; Tue, 27 Aug 2019 04:05:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="tjTBDDfg" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729010AbfH0EFT (ORCPT ); Tue, 27 Aug 2019 00:05:19 -0400 Received: from mail-io1-f66.google.com ([209.85.166.66]:43745 "EHLO mail-io1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725766AbfH0EFT (ORCPT ); Tue, 27 Aug 2019 00:05:19 -0400 Received: by mail-io1-f66.google.com with SMTP id 18so42948740ioe.10 for ; Mon, 26 Aug 2019 21:05:18 -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=Z5KZm5ZG2tXk0hXUpg0lCKsRPTIfsSyVLHua7cQOfxg=; b=tjTBDDfgAaptq0CAs8HGarwj7ft9CRhuYdlfxquwFNhwM7uprnm7LnZiKj7CHn7+kB oTkoB/kVSH3m5RgCHIjC+0Can88qLY4aVoe+0AUPBJBiDxYfOqlIP8HZM8mE1chk75ZO 7mE7rI5Q5ViVPxgPZuBVj1n9LoHDkF1iKilE9LUGzBsaO+IFJwIGpTro/Lwei8dcWq7O zo9wQZwj+3zgepKQMiITtksRoNnC+eOfUaVfJr9u+sdyw6qlJVy7xVpzN7pMcfQahzfJ SaYgfKVPka/x1srlQuJXxgKNclw7Q2VM/A1/Pvfxj48n/KOImO0JigOB2qF/O4o/pKOv gg6A== 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=Z5KZm5ZG2tXk0hXUpg0lCKsRPTIfsSyVLHua7cQOfxg=; b=eCdIlXvWHFDKtinj5IInDBeRBRTQ2jR9M1p4Me1HQCG0vh7W91mM1qD7quhUG3SAnw ziBqdZ/BletdbEOQOAD2fqXW18eKiQrhWYjV4oo/ia0egnZyz0J/sRRgWGLHsBayTEcr yDygdam+9ujWiLKdkCroLIRVlezqIc0+v+l1U0YKxaZE9PwNpdsuhdHBtuW8QeaRaxjA zq+q25UxOcio0trFD2YgqJt+kwIvqD8UfCQ2bZjdzTNqp8BKTK6sGusKU4jplLnX2+XP gAPR2xChElYfZ1yPaLyAZeKeVsSEgL7wtJAURwDTKUbWa0ktHxbMQ2cWW0gmqgFcDqWA H+jA== X-Gm-Message-State: APjAAAVabK5ixyc1d42ubkGvEgo4uSUwmtiR7j+lfFzvspK9Yd8cF7tX bMInJKnCkyIvH+prB9Rqj3XYXRDD X-Google-Smtp-Source: APXvYqwcOFOTvA3LdCeCK5NPkyxljKvETI7j1SiPF5KhatD00pzb4OV/LC8FwsOtWKMmvOjCDyhr7w== X-Received: by 2002:a02:9f17:: with SMTP id z23mr20208754jal.19.1566878717591; Mon, 26 Aug 2019 21:05:17 -0700 (PDT) Received: from archbookpro.localdomain (CPE18593399858a-CM185933998587.cpe.net.cable.rogers.com. [174.112.89.95]) by smtp.gmail.com with ESMTPSA id y5sm18299295ioc.86.2019.08.26.21.05.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Aug 2019 21:05:17 -0700 (PDT) Date: Tue, 27 Aug 2019 00:05:15 -0400 From: Denton Liu To: Git Mailing List Cc: =?iso-8859-1?q?=C6var_Arnfj=F6r=F0?= Bjarmason , Junio C Hamano , Eric Sunshine , Johannes Sixt , Philip Oakley Subject: [PATCH v2 11/13] t4014: stop losing return codes of git commands 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 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 | 197 ++++++++++++++++++++++++---------------- 1 file changed, 120 insertions(+), 77 deletions(-) diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh index 67f4c62ed6..83f52614d3 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,25 @@ 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) && + git_version=${git_version##* } +' 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 +1624,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 +1668,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 +1708,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 +1746,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 +1756,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 27 04:05:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denton Liu X-Patchwork-Id: 11116023 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 DD01E13B1 for ; Tue, 27 Aug 2019 04:05:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BB6EE206E0 for ; Tue, 27 Aug 2019 04:05:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="us902jgd" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729076AbfH0EFV (ORCPT ); Tue, 27 Aug 2019 00:05:21 -0400 Received: from mail-io1-f68.google.com ([209.85.166.68]:46026 "EHLO mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725766AbfH0EFV (ORCPT ); Tue, 27 Aug 2019 00:05:21 -0400 Received: by mail-io1-f68.google.com with SMTP id t3so42918206ioj.12 for ; Mon, 26 Aug 2019 21:05:20 -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=STrhgLV+GP1f/OkDRDYo2571zVPeQnjc85O1EKDAM+k=; b=us902jgduWEd1oV4ZOMDX4jZNiIdXMkmbOKnuj/VpM21V5OCbtnG0ZZpi5gLeWpRzx xKixut2Z8EJZhvS/g40QhNFkupgC4DGITVIeVmUTxOloqL8eGDpU/MoVETPn5F7SPok5 6ULs0aKGwL2GPXSJWq/Gvl9T1KJPkl4fljS2bdatBF5duZjhK35lhlY0+XVsYSWl2CQj gRXaLEtEV5CUuXlZjFZEN6FOTje7l5KZ1HJkez1N8k9ro3/XJlNC9wgUxfnD7hqKxl5d /eFM/vug3zwTt2duoSo3IAOFAEJL0uu+vfSe4Ai1sorvR2bgoR9AL+/RxFnUS8T2uIK4 TtDQ== 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=STrhgLV+GP1f/OkDRDYo2571zVPeQnjc85O1EKDAM+k=; b=VlxuMZbS2VJhxqJDbDMmYbQYEJqXu2uyXUl/QtX+CV0Y/tCanw+TjI7c1NeHlhtczg 0+so19JiUZ8bn44nb4Nm59sGOcrRT7bo/uSkogvQlKy3zFdzxGzS2uVNLpv0aZa72jVg FaMe1t/OTnsGTPV6Zp3gE0Nlmrr6VHrVwLxBVMm2roFUQPQah4MSZLLgB7KHNTQpYQOj YNMs8TrbyC9p+/V29KnXUfYQdnGUDl/3DrxDECDhkddxWSmSRZx7wUNB/MHbbKpjB696 fJSWW/w9nmIIgvEfMyyttjAjCGb1jJJazomotgEzmOucHeHiV7lUkqvXpPowHUimqUfx n3VA== X-Gm-Message-State: APjAAAWLLOlW49nhf3PPo4vLw/7Ke/QiGRyubIUatLdlTbuj+sTAFkED Wf7ukzW2uAHplG/SVY24g2UUUR+V X-Google-Smtp-Source: APXvYqyhnnFlM5ErwvA5U0nWn8sIPImuPjQ4FLDdMSQFFAhXxmSvPtpyz+7P4Rzw2GOdwiCmGh7BhA== X-Received: by 2002:a6b:e511:: with SMTP id y17mr4834407ioc.228.1566878720076; Mon, 26 Aug 2019 21:05:20 -0700 (PDT) Received: from archbookpro.localdomain (CPE18593399858a-CM185933998587.cpe.net.cable.rogers.com. [174.112.89.95]) by smtp.gmail.com with ESMTPSA id w6sm11701206iob.29.2019.08.26.21.05.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Aug 2019 21:05:19 -0700 (PDT) Date: Tue, 27 Aug 2019 00:05:17 -0400 From: Denton Liu To: Git Mailing List Cc: =?iso-8859-1?q?=C6var_Arnfj=F6r=F0?= Bjarmason , Junio C Hamano , Eric Sunshine , Johannes Sixt , Philip Oakley Subject: [PATCH v2 12/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 <> and change existing names such as "Message-Id" to "message id", which conforms with how existing documentation is written. Finally, document the `format.outputDirectory` config and change `format.coverletter` to use camel case. Signed-off-by: Denton Liu --- Documentation/git-format-patch.txt | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/Documentation/git-format-patch.txt b/Documentation/git-format-patch.txt index b9b97e63ae..0ac56f4b70 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,9 +159,9 @@ 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 + reply to the given , which avoids breaking threads to provide a new patch series. --ignore-if-in-upstream:: @@ -171,9 +171,9 @@ will want to ensure that threading is disabled for `git send-email`. patches being generated, and any patch that matches is ignored. ---subject-prefix=:: +--subject-prefix=:: Instead of the standard '[PATCH]' prefix in the subject - line, instead use '[]'. This + line, instead use '[]'. This allows for useful naming of a patch series, and can be combined with the `--numbered` option. @@ -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 27 04:05:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denton Liu X-Patchwork-Id: 11116025 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 53F8814D5 for ; Tue, 27 Aug 2019 04:05:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3251F206E0 for ; Tue, 27 Aug 2019 04:05:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="QwMRFytN" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729083AbfH0EFY (ORCPT ); Tue, 27 Aug 2019 00:05:24 -0400 Received: from mail-io1-f66.google.com ([209.85.166.66]:39730 "EHLO mail-io1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725766AbfH0EFY (ORCPT ); Tue, 27 Aug 2019 00:05:24 -0400 Received: by mail-io1-f66.google.com with SMTP id l7so43065062ioj.6 for ; Mon, 26 Aug 2019 21:05:23 -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=QwMRFytNukuCdacFkFy8E+n0Aj4xM8JQsCyrylAmY72PbZzznlvBOhpsl8NfKVX7yB 6jsI8kCW9UOS0QOjrJv6/EgfLVF+yFGM1z7feaIwR5ASdRlwFL2lwY0Re7F+RyJqyfZw ST7jC5Ar8R9KACVOKLgP/SLzBErrx5vJdtA/yIjTaFka/qeD7d6poDTvmjqJRki2mxMF 1+FJDxdH3R56+kv+oPyY9uUutjzzrcY+ThFgdxkOaPI/bfUNVKAgsZ+Rk6w2cRTe3rfg Z3Y4tgyvG38nXTmKavVB6XSsIHBWkY2Mr0VB+pL6UiLlpk9k2NygmGRfpQxxupfK7YJz rK5A== 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=amEmZX1WUKFmcr6kPYrCgn1eOzYOcWGkcWYBrfeEdQTpbq1+IME9mS2U7kAxGvvDYe G9ero7rWUtY6zIjhbQFTtFeWkoAV03Y0N5JX64Zu8s2xjFZKSmMkNLNHeAGWT2yYZeFo I9Or7E118wjNWRrhDVdssYnlrH4JE30onggtjytH6BkFVOdsUb7wdUwp6pOthMpG595A kN3oVWav9bNExWrOF8ryT729uoYwlE/1RLfJ+U6xnsL1WCtQk8LFrsqdHvrDPtxk3oGB G7cxOYUWA31UeAAVgZeIJ3iOVaCdn41LA/cf+9X8zCeyNBQrKV70HNlzPbjKhcoBbdVN uBJg== X-Gm-Message-State: APjAAAUUtMNzJbI5F8OSKEtVmIaTARNV95JydPrKbuu0aJqPEvEP6I2r o9MlQjmEY8LGda0rhSkgXU2o49Gs X-Google-Smtp-Source: APXvYqzIKEMVdD6H71hExzeUIRX1iv1pBhiBulWLvae4swAwSUtZi43Lr4d+XL4oOvitJHpVmsLD3g== X-Received: by 2002:a5d:8444:: with SMTP id w4mr3449764ior.51.1566878723132; Mon, 26 Aug 2019 21:05:23 -0700 (PDT) Received: from archbookpro.localdomain (CPE18593399858a-CM185933998587.cpe.net.cable.rogers.com. [174.112.89.95]) by smtp.gmail.com with ESMTPSA id j18sm5935944ioo.14.2019.08.26.21.05.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Aug 2019 21:05:22 -0700 (PDT) Date: Tue, 27 Aug 2019 00:05:20 -0400 From: Denton Liu To: Git Mailing List Cc: =?iso-8859-1?q?=C6var_Arnfj=F6r=F0?= Bjarmason , Junio C Hamano , Eric Sunshine , Johannes Sixt , Philip Oakley Subject: [PATCH v2 13/13] config/format.txt: specify default value of format.coverLetter Message-ID: <4e429e1989173e07bcb9b622b732e46bf3dab828.1566878374.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 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