From patchwork Sat Mar 30 14:27:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: jonathan chang X-Patchwork-Id: 10878513 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EF52B17E1 for ; Sat, 30 Mar 2019 14:28:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DB3C6286D5 for ; Sat, 30 Mar 2019 14:28:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CF45028711; Sat, 30 Mar 2019 14:28:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,FROM_LOCAL_NOVOWEL,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7E084286D5 for ; Sat, 30 Mar 2019 14:28:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730881AbfC3O2N (ORCPT ); Sat, 30 Mar 2019 10:28:13 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:38965 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730840AbfC3O2N (ORCPT ); Sat, 30 Mar 2019 10:28:13 -0400 Received: by mail-pl1-f196.google.com with SMTP id b65so2355384plb.6 for ; Sat, 30 Mar 2019 07:28:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NivD/tZZ5tt6KvOTJM1WjCiXRgiIyw9yS3YXw6UaOeo=; b=ouTgQeyNu0nHpysnkM9j8J8ipRCC8P9/+MDdisvNQqTzd6HZmi/TKCzFfBUUB8hfYn vW2XEG34IV9HzWX2YNF/zpXx5muOIE+kcSZzLL2B5kLCmV303VglJvBz/S3SNeF0J5vD UPNDPGFyo5lJcpc26J7l8AGeQsW9HHjg2q3naP4xDDCxMAkNsQZjArNFojEI4l1ZSllW 6/bPYH7IVpkLRyREjwWLdZdBie6U501xIpsIDx8+Iee+DPEbBr8KUOx/TAWEv/QAEXid BJYsZzg79jWyWR3nHS8QOvKV4BciF67bMCcExHq7LRrZRhksM4dfKn7XlzZctxPC68rz 3LMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=NivD/tZZ5tt6KvOTJM1WjCiXRgiIyw9yS3YXw6UaOeo=; b=bqgVg24jndG70+eDoFPHNulrWilXD0K+2/VG8O9A/MRphSAbtTsbIxg7z6b8+IkpBL 5raAhD96vVPCBLYGAPsfD0HXaTnlmRy1MR5C0VEi3BtPNKW9s+8fkcdk5FdqHTpmC6LT hIcjCXCF1zx44buwYC+SRqWOxHdW4iP2/WoLVGqdZ742+MuNv1s7qUVsO+ey62lD2/M9 YHXO55zNqTMGRWFVsRmYSalAS7Q1LXwgqQzFDSKhHTh8+4/F/PcERhnR2PT2dR3hR9ar 2rjeD59dMNdhm4za9Rr3n4TdxsyEFQdHoNaojGswrUYp92Eedp9KY4x3nJbkY8H5RPX8 gIsw== X-Gm-Message-State: APjAAAVh04on+LFy28Ra80YKXU7PVRkMyg80OHx/vU9Q8LtYXWhqKpV7 Ey7uNwo6respyHmCmWoLMqvTYuMG5U8= X-Google-Smtp-Source: APXvYqxiXJgpgljokk3ShU2VAQkPUrX5//ZGzXtcj3I16wPvkGCXvoo3Iiw3WZD8z71HBm4BLYCgRw== X-Received: by 2002:a17:902:a513:: with SMTP id s19mr2909167plq.97.1553956092563; Sat, 30 Mar 2019 07:28:12 -0700 (PDT) Received: from localhost.localdomain (cloudream.m3.ntu.edu.tw. [140.112.244.5]) by smtp.gmail.com with ESMTPSA id v12sm6621737pfe.148.2019.03.30.07.28.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 30 Mar 2019 07:28:12 -0700 (PDT) From: Jonathan Chang To: Git Mailing List Cc: Jonathan Chang , Christian Couder , Eric Sunshine , Thomas Gummerer , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBC?= =?utf-8?b?amFybWFzb24=?= Subject: [GSoC][PATCH v4 1/5] t0000: fix indentation Date: Sat, 30 Mar 2019 22:27:54 +0800 Message-Id: <86146182b7b1d4194168f509d0ee421713723700.1553954776.git.ttjtftx@gmail.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: References: MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fix indentation of a line containing a pipeline to reduce the noise when refactoring the pipeline in a subsequent commit. This has been wrong since the refactoring done in 1b5b2b641a ("t0000: modernise style", 2012-03-02), but carries no meaning. Signed-off-by: Jonathan Chang --- t/t0000-basic.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/t0000-basic.sh b/t/t0000-basic.sh index b6566003dd..53821f5817 100755 --- a/t/t0000-basic.sh +++ b/t/t0000-basic.sh @@ -1132,7 +1132,7 @@ test_expect_success 'git commit-tree records the correct parent in a commit' ' test_expect_success 'git commit-tree omits duplicated parent in a commit' ' commit2=$(echo NO | git commit-tree $P -p $commit0 -p $commit0) && - parent=$(git show --pretty=raw $commit2 | + parent=$(git show --pretty=raw $commit2 | sed -n -e "s/^parent //p" -e "/^author /q" | sort -u) && test "z$commit0" = "z$parent" && From patchwork Sat Mar 30 14:27:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: jonathan chang X-Patchwork-Id: 10878515 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 063B917E1 for ; Sat, 30 Mar 2019 14:28:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E5B7C286D5 for ; Sat, 30 Mar 2019 14:28:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DA18A28711; Sat, 30 Mar 2019 14:28:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,FROM_LOCAL_NOVOWEL,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7C5B1286D5 for ; Sat, 30 Mar 2019 14:28:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730893AbfC3O2Q (ORCPT ); Sat, 30 Mar 2019 10:28:16 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:38359 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730840AbfC3O2Q (ORCPT ); Sat, 30 Mar 2019 10:28:16 -0400 Received: by mail-pg1-f195.google.com with SMTP id j26so2569530pgl.5 for ; Sat, 30 Mar 2019 07:28:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Ua7GU9e+lcPXFSlkukWUOKdfxnwfISLn4oQsyLldfa8=; b=lUxKlzzkU9yg363tEJKyr0vGmo3VcmCKZRHbK4OtrLAFTlr0lE/4NmUgGAF35v4i25 Wg2iYdLYuyz8T0vTb0IBQU1esA0QX/pq3ByMdjY+DmNVVNn3jFyhqh4vDciwFsKYGKdR osw4Q+y58RivTeA7AQWCgk5mwc9ZgdRas6lLN2FEKS4Bs185Mnc93EjEjrt+xh6dOh05 +alGSy+t8LalUF1YEoBrw+8w9IGJmmZwZoT9/ZtxG2em2fKcpQ9vnOUlvwq2e/skxVM9 BSsSvUbZzUGworfcu0orN46JVRY2tlXCBUMoc/w1YwJd0VgCi8Sy/jf5Pg5u/t6k8vN5 jevg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Ua7GU9e+lcPXFSlkukWUOKdfxnwfISLn4oQsyLldfa8=; b=HLnZWkmMDBYcbDd+HgiG0G/UlvPGpRkC7vYVRZjSfZ56Qi03KdsXsnq0CtTY0uMbFo m0o0ZHDufUgDoTHNSq/0qF1a4uxX4vXqu3Mw27L4u0MVufYaoY5kh+wOrM2HHBPRFegG d0RcNhCOmuoI8qHbipUC5Va411M74cDt4DgvJUXQEUPxayiv86O8KqIok7krrnRK9UWy G6HhvFAfWf5GLU4FMa9e1kdHOsGyhRN3D7ZNOA6uvdM0KqvdekDOPjIcIF1Nm22/CIqh 4ie/kglQUl+Gw349voIPK+sqXU3HtrAynoUDV317TPoHCEm9aj2O4s+eK43cqLV1vpb4 3GUg== X-Gm-Message-State: APjAAAUXf9ZREt7OvRcqZlEywkzJlDm+KFRX0Y07ycReHVlXUTPExb3c Lm+1US4I2UYRQP6zSSKU1VbiD+fBX+k= X-Google-Smtp-Source: APXvYqwA01E4e68EpKkwylZXX8ajnpL3xZy/EYMcJRg+iQMKHDs5/f9MelfQ9hXLLptjOh8K8uzRrQ== X-Received: by 2002:aa7:83ca:: with SMTP id j10mr52541433pfn.50.1553956095278; Sat, 30 Mar 2019 07:28:15 -0700 (PDT) Received: from localhost.localdomain (cloudream.m3.ntu.edu.tw. [140.112.244.5]) by smtp.gmail.com with ESMTPSA id v12sm6621737pfe.148.2019.03.30.07.28.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 30 Mar 2019 07:28:14 -0700 (PDT) From: Jonathan Chang To: Git Mailing List Cc: Jonathan Chang , Christian Couder , Eric Sunshine , Thomas Gummerer , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBC?= =?utf-8?b?amFybWFzb24=?= Subject: [GSoC][PATCH v4 2/5] t0000: avoid using pipes Date: Sat, 30 Mar 2019 22:27:55 +0800 Message-Id: <1ca1168f91daaef5936c97179715ca8e8d4fb6ef.1553954776.git.ttjtftx@gmail.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: References: MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The exit code of the upstream in a pipe is ignored thus we should avoid using it. By writing out the output of the git command to a file, we can test the exit codes of both the commands. This commit doesn't make any additional simplifications, such as using the test_line_count function for counting the lines in the output. These simplifications will be made in subsequent commits. Signed-off-by: Jonathan Chang --- t/t0000-basic.sh | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/t/t0000-basic.sh b/t/t0000-basic.sh index 53821f5817..47666b013e 100755 --- a/t/t0000-basic.sh +++ b/t/t0000-basic.sh @@ -1118,27 +1118,25 @@ P=$(test_oid root) test_expect_success 'git commit-tree records the correct tree in a commit' ' commit0=$(echo NO | git commit-tree $P) && - tree=$(git show --pretty=raw $commit0 | - sed -n -e "s/^tree //p" -e "/^author /q") && + git show --pretty=raw $commit0 >actual && + tree=$(sed -n -e "s/^tree //p" -e "/^author /q" actual) && test "z$tree" = "z$P" ' test_expect_success 'git commit-tree records the correct parent in a commit' ' commit1=$(echo NO | git commit-tree $P -p $commit0) && - parent=$(git show --pretty=raw $commit1 | - sed -n -e "s/^parent //p" -e "/^author /q") && + git show --pretty=raw $commit1 >actual && + parent=$(sed -n -e "s/^parent //p" -e "/^author /q" actual) && test "z$commit0" = "z$parent" ' test_expect_success 'git commit-tree omits duplicated parent in a commit' ' commit2=$(echo NO | git commit-tree $P -p $commit0 -p $commit0) && - parent=$(git show --pretty=raw $commit2 | - sed -n -e "s/^parent //p" -e "/^author /q" | - sort -u) && + git show --pretty=raw $commit2 >actual && + parent=$(sed -n -e "s/^parent //p" -e "/^author /q" actual | sort -u) && test "z$commit0" = "z$parent" && - numparent=$(git show --pretty=raw $commit2 | - sed -n -e "s/^parent //p" -e "/^author /q" | - wc -l) && + git show --pretty=raw $commit2 >actual && + numparent=$(sed -n -e "s/^parent //p" -e "/^author /q" actual | wc -l) && test $numparent = 1 ' @@ -1147,7 +1145,8 @@ test_expect_success 'update-index D/F conflict' ' mv path2 path0 && mv tmp path2 && git update-index --add --replace path2 path0/file2 && - numpath0=$(git ls-files path0 | wc -l) && + git ls-files path0 >actual && + numpath0=$(wc -l path4 && git update-index --add path4 && ( - git ls-files -s path4 | - sed -e "s/ .*/ /" | + git ls-files -s path4 >actual && + sed -e "s/ .*/ /" actual | tr -d "\012" && echo "$a" ) | git update-index --index-info && - len=$(git ls-files "a*" | wc -c) && + git ls-files "a*" >actual && + len=$(wc -c X-Patchwork-Id: 10878517 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 00DA414DE for ; Sat, 30 Mar 2019 14:28:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E058D286D5 for ; Sat, 30 Mar 2019 14:28:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D479628711; Sat, 30 Mar 2019 14:28:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,FROM_LOCAL_NOVOWEL,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5A001286D5 for ; Sat, 30 Mar 2019 14:28:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730901AbfC3O2T (ORCPT ); Sat, 30 Mar 2019 10:28:19 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:43221 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730840AbfC3O2S (ORCPT ); Sat, 30 Mar 2019 10:28:18 -0400 Received: by mail-pf1-f193.google.com with SMTP id c8so2381624pfd.10 for ; Sat, 30 Mar 2019 07:28:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=WftxrZJlWWX6IGEh5qYZ7/wRX4GUg2vW7IpByNgMzHI=; b=WVRsmkeYqptkQ/xrKYQbMxZMTkc0PMT0PK6I/iXsTE+RhO64k/bf8edNuJlRluEoxw BAu93yN/Y0I8oGf/xUveYS3sqRekLIZjYXewyKr+5MHJSc6C0N6JyjiCBLbOSzlHLndv muk4q/rkcXabnLHITAvCrkBhuLAsotXM2uUgl3onfCBLhULC0aYWgg9gflH+SOcya+No mLATteV8ifmOT959YXex23ef3fF8gAemerLWpQMfGyuF+66eq0X8FtbsrD2KylJIwQzi flDFdVfhZF4FUoHtSkaPrsRyhAMn2P5c+S75Ub2917FV+QU9XxXaojuenQ1b+O7GO0e3 1nSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=WftxrZJlWWX6IGEh5qYZ7/wRX4GUg2vW7IpByNgMzHI=; b=iOaKrrXD9yj3sjteA9RLcNHDJxvVmc/Nz2yNiJ7ud2f5vsYsZuObAs1zMMTHXXA01k 8IXVVy1grhIoblV0Ilkojufo5fhefNdYrxmgSM5uP09uy3gxxBk3NL5Q/e6GDDptCz87 FXNOX24GojVg0dklGu6xSbo7mG6VVQUXpR90grbuXRGgkmrgV33WNABg2iNFexN2FqPR tP5ABl5+Q/UOIaCuMvPp7oH7YQLY0I1L8Ar5WOgraASnmwGqkkz5cgBrlXQncLXIKDRf q0DtVTiQLsRmYi27QVBlyxuBmzZkpbACnKZZ1vUx2XxCcqs6uRHwpAZypdmSVIa/Wggz KcLQ== X-Gm-Message-State: APjAAAU5qAva3jdpgkPuM7iSOdYio9qgCjSvPoQJl8rl9568t/v6yuBy Tf2rMj5ZHTLFhwDKTlLaP6T/5aOHttc= X-Google-Smtp-Source: APXvYqzthWxN2PsdqPRLgfQfi6E8TECk0QjFjMtucf6kx6+9/9FATr5NYU0IWfQTDZTb0YwhrJe9BQ== X-Received: by 2002:a62:448d:: with SMTP id m13mr54413626pfi.182.1553956097516; Sat, 30 Mar 2019 07:28:17 -0700 (PDT) Received: from localhost.localdomain (cloudream.m3.ntu.edu.tw. [140.112.244.5]) by smtp.gmail.com with ESMTPSA id v12sm6621737pfe.148.2019.03.30.07.28.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 30 Mar 2019 07:28:17 -0700 (PDT) From: Jonathan Chang To: Git Mailing List Cc: Jonathan Chang , Christian Couder , Eric Sunshine , Thomas Gummerer , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBC?= =?utf-8?b?amFybWFzb24=?= Subject: [GSoC][PATCH v4 3/5] t0000: use test_line_count instead of wc -l Date: Sat, 30 Mar 2019 22:27:56 +0800 Message-Id: <28986ed00090df33791a6d53a5292b1bb296eaf5.1553954776.git.ttjtftx@gmail.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: References: MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Jonathan Chang --- t/t0000-basic.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/t/t0000-basic.sh b/t/t0000-basic.sh index 47666b013e..3de13daabe 100755 --- a/t/t0000-basic.sh +++ b/t/t0000-basic.sh @@ -1136,8 +1136,8 @@ test_expect_success 'git commit-tree omits duplicated parent in a commit' ' parent=$(sed -n -e "s/^parent //p" -e "/^author /q" actual | sort -u) && test "z$commit0" = "z$parent" && git show --pretty=raw $commit2 >actual && - numparent=$(sed -n -e "s/^parent //p" -e "/^author /q" actual | wc -l) && - test $numparent = 1 + sed -n -e "s/^parent //p" -e "/^author /q" actual >parents && + test_line_count = 1 parents ' test_expect_success 'update-index D/F conflict' ' @@ -1146,8 +1146,7 @@ test_expect_success 'update-index D/F conflict' ' mv tmp path2 && git update-index --add --replace path2 path0/file2 && git ls-files path0 >actual && - numpath0=$(wc -l X-Patchwork-Id: 10878519 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 11A9217E1 for ; Sat, 30 Mar 2019 14:28:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F0B6C286D5 for ; Sat, 30 Mar 2019 14:28:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E4A4B28711; Sat, 30 Mar 2019 14:28:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,FROM_LOCAL_NOVOWEL,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 92A08286D5 for ; Sat, 30 Mar 2019 14:28:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730906AbfC3O2V (ORCPT ); Sat, 30 Mar 2019 10:28:21 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:36540 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730840AbfC3O2U (ORCPT ); Sat, 30 Mar 2019 10:28:20 -0400 Received: by mail-pf1-f196.google.com with SMTP id z5so1369563pfn.3 for ; Sat, 30 Mar 2019 07:28:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=DC7ogn1dZXaQ13yVn0z4VykUOjFkAe+PZoyncoSnCgY=; b=UpwXbPKUg6szpmo8CaVGNVY6v0x3I22pnLDXNZykLTSHDNZI1aPljpiY05TU2xHhAr QJsjL/RS8CP/O3BeYRHbzFY94c8Sm2HsiAoI7ztvD34u0hBBxYMVV0LyfgVDyTX1TyFY cMJHka4vQKkhPIkxtbVMhrlV8icuM7RhjNRfEKe+Ua/D+L/+iqQkNlNEGnhhQ7jZ3UCj qzZ7mA0RfEtq+RJOYBFCuozrPm/dSbTZh6qntr4AeaqTYgVYD/4pnDwv/sD3BMGocLtd kXwIA/QMkd3GkkymS2pOSAlZ48h1cNLtRYOFfAEBGo2zdsZHSWMbLqYq3nKnvL3nZWNc 5vew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=DC7ogn1dZXaQ13yVn0z4VykUOjFkAe+PZoyncoSnCgY=; b=LmjqoS+vw2nowf9gLmzdNssmcHuZMcucCromkjIanWRR/Q3q8lGUIo2HxVdwAPhAK5 p12YBFBG+ua96UXVxzakZ0pNvkM9rB58mVEjXe51+dVoyt774KB/2rkzvE7DzV+IO5IQ faI2lCcjxs6yk5y+TW0XVqoWWggf1+JKB9oawU+Lm7Sn+P7CfobBv8f/FrYzO4VHyFOm nSC/QAhd16ouk+3tbvCDoKJi5lp8gZL8woBSKrdQwYp2fLzstnx3wkZVfFC58JbEkEZC V/FszlMeundNh0zVF0cYuCB3kXqFNWj4v7RqBgwlI7GGFo10XG1QCMGAr2I4VRaP17yc kyXg== X-Gm-Message-State: APjAAAVvZ+OXG/dtPmWcgHKzl+gN8jCI2MuMogSQALnD+carGCphfFVu sA3JNIWG0uv5NQz2OReKxiXtlNB7Hks= X-Google-Smtp-Source: APXvYqyzo5hB36uVXuuNxmw4kHJCo8yDfMMr6E/DSL6vPPn8ob9TwPBdS+xg8PonvB503ucJXpDQTg== X-Received: by 2002:a62:6c6:: with SMTP id 189mr52168183pfg.36.1553956099916; Sat, 30 Mar 2019 07:28:19 -0700 (PDT) Received: from localhost.localdomain (cloudream.m3.ntu.edu.tw. [140.112.244.5]) by smtp.gmail.com with ESMTPSA id v12sm6621737pfe.148.2019.03.30.07.28.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 30 Mar 2019 07:28:19 -0700 (PDT) From: Jonathan Chang To: Git Mailing List Cc: Jonathan Chang , Christian Couder , Eric Sunshine , Thomas Gummerer , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBC?= =?utf-8?b?amFybWFzb24=?= Subject: [GSoC][PATCH v4 4/5] t0000: use test_cmp instead of "test" builtin Date: Sat, 30 Mar 2019 22:27:57 +0800 Message-Id: <731463ed9892c283b6acb0ce69e097769e43de62.1553954776.git.ttjtftx@gmail.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: References: MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Jonathan Chang --- t/t0000-basic.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/t/t0000-basic.sh b/t/t0000-basic.sh index 3de13daabe..49923c5ff1 100755 --- a/t/t0000-basic.sh +++ b/t/t0000-basic.sh @@ -1118,16 +1118,18 @@ P=$(test_oid root) test_expect_success 'git commit-tree records the correct tree in a commit' ' commit0=$(echo NO | git commit-tree $P) && - git show --pretty=raw $commit0 >actual && - tree=$(sed -n -e "s/^tree //p" -e "/^author /q" actual) && - test "z$tree" = "z$P" + git show --pretty=raw $commit0 >output && + echo "$P" >expect && + sed -n -e "s/^tree //p" -e "/^author /q" output >actual && + test_cmp expect actual ' test_expect_success 'git commit-tree records the correct parent in a commit' ' commit1=$(echo NO | git commit-tree $P -p $commit0) && - git show --pretty=raw $commit1 >actual && - parent=$(sed -n -e "s/^parent //p" -e "/^author /q" actual) && - test "z$commit0" = "z$parent" + git show --pretty=raw $commit1 >output && + echo "$commit0" >expect && + sed -n -e "s/^parent //p" -e "/^author /q" output >actual && + test_cmp expect actual ' test_expect_success 'git commit-tree omits duplicated parent in a commit' ' From patchwork Sat Mar 30 14:27:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: jonathan chang X-Patchwork-Id: 10878521 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5592917E1 for ; Sat, 30 Mar 2019 14:28:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3BCCA286D5 for ; Sat, 30 Mar 2019 14:28:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3025828711; Sat, 30 Mar 2019 14:28:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,FROM_LOCAL_NOVOWEL,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CEE23286D5 for ; Sat, 30 Mar 2019 14:28:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730914AbfC3O2X (ORCPT ); Sat, 30 Mar 2019 10:28:23 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:37683 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730840AbfC3O2X (ORCPT ); Sat, 30 Mar 2019 10:28:23 -0400 Received: by mail-pf1-f194.google.com with SMTP id 8so2397612pfr.4 for ; Sat, 30 Mar 2019 07:28:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=FhAAN28qHfr9fTL5Y+JfBtxC+H9lMrCKQyb4ktkGN0Y=; b=uX8siTw4X9lPTkX8Y9fbQWrXmbRepyFWkAKwuvkxmnEgBGw2zInHJIWiBg/nb+svL7 lPfTi15wizBpwwF5bZc8/DAuCI1im4eEllj/kaKntUAefiH+SjFSs0u2IfR+sJKZld9k QFLpnr0bmg7TndiJV1rLxVNhHVDDtjwukplFhbgKij8Z5s6LpblRc7I6ItdV1ZEHfsbx JiBaHz0rO+9E3NGK5ptyn6Dqo7bgY9nwcX6E5Vrp5xJerwadIO3vHiRcNQufVEn7dhll NXVbkafr8tWNkwOyllkVnuXZ/ts7UiE4moiPzRhpZKd0eaTHIBHCxDasSUEXoR4M7lLi gz3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=FhAAN28qHfr9fTL5Y+JfBtxC+H9lMrCKQyb4ktkGN0Y=; b=nYmn3SsqE5ASsgvnDQUpQc6y0XWXHUEVKza4PG0jZgFzDiBtzPlIVEAL0WvCOGJ/Ac JAwMLfQPP+wn7fECapqMWqYNqCf1vPhgMMpTxQ6QZCrx5CudNYOEVc0yoCcjcC2h2hUe 3uqrj21hFc91u3l8zy59+/rYcOBMEvYm51JcUDzzFL5GJQ1M5tOYmS6pqujFca3SjKLT XBUTTZOAr2y1CvqtD5/IqueKXI1K70RjmyAFQYnQct95z5VgV59qeCZXHxOwmlsMKurE xy5gpI8aT4TvvxWvum+iQliisdYdnKZtbroztBWVhN1nYwSaQeH5492aBJUr+eSpuqYB vaTA== X-Gm-Message-State: APjAAAVe5GLpfE8wkMcv/N8clkaA1cY1daJ5EkNwpYah8XQC3hirEykj smgK8+g0+AcSHGLzTshXJy7boGZkmrk= X-Google-Smtp-Source: APXvYqywX/eYizBTSKeKbW6OGxc5xkHkJacX13UxUL12CEWQV/ZyW4DPvlOYCX6f//Dt7VNS+Hz7yw== X-Received: by 2002:a62:874d:: with SMTP id i74mr25725273pfe.211.1553956102265; Sat, 30 Mar 2019 07:28:22 -0700 (PDT) Received: from localhost.localdomain (cloudream.m3.ntu.edu.tw. [140.112.244.5]) by smtp.gmail.com with ESMTPSA id v12sm6621737pfe.148.2019.03.30.07.28.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 30 Mar 2019 07:28:21 -0700 (PDT) From: Jonathan Chang To: Git Mailing List Cc: Jonathan Chang , Christian Couder , Eric Sunshine , Thomas Gummerer , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBC?= =?utf-8?b?amFybWFzb24=?= Subject: [GSoC][PATCH v4 5/5] t0000: make use of the test_must_be_empty function Date: Sat, 30 Mar 2019 22:27:58 +0800 Message-Id: <53f58a4f89ff911d0f761f4e9403e0ddb4454674.1553954776.git.ttjtftx@gmail.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: References: MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Jonathan Chang --- t/t0000-basic.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/t/t0000-basic.sh b/t/t0000-basic.sh index 49923c5ff1..0cb69a89de 100755 --- a/t/t0000-basic.sh +++ b/t/t0000-basic.sh @@ -51,7 +51,7 @@ test_expect_success 'verify that the running shell supports "local"' ' test_expect_success '.git/objects should be empty after git init in an empty repo' ' find .git/objects -type f -print >should-be-empty && - test_line_count = 0 should-be-empty + test_must_be_empty should-be-empty ' # also it should have 2 subdirectories; no fan-out anymore, pack, and info. @@ -1110,7 +1110,7 @@ test_expect_success 'git update-index --refresh should succeed' ' test_expect_success 'no diff after checkout and git update-index --refresh' ' git diff-files >current && - cmp -s current /dev/null + test_must_be_empty current ' ################################################################