git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / Atom feed
From: michael@platin.gs
To: git@vger.kernel.org
Cc: Jeff King <peff@peff.net>, Stefan Beller <stefanbeller@gmail.com>,
	Jeff Smith <whydoubt@gmail.com>,
	Junio C Hamano <gitster@pobox.com>, René Scharfe <l.s.r@web.de>,
	Ævar Arnfjörð Bjarmason  <avarab@gmail.com>,
	David Kastrup <dak@gnu.org>,
	Johannes Schindelin <Johannes.Schindelin@gmx.de>,
	Barret Rhoden <brho@google.com>,
	SZEDER Gábor <szeder.dev@gmail.com>,
	Michael Platings <michael@platin.gs>
Subject: [PATCH] t8014: avoid git command in upstream pipe
Date: Sun, 16 Jun 2019 21:44:41 +0100
Message-ID: <20190616204441.5400-1-michael@platin.gs> (raw)
In-Reply-To: <20190613151756.GA31952@szeder.dev>

From: Michael Platings <michael@platin.gs>

Use an intermediate file between between git blame and sed to avoid
git blame's exit code being hidden.

Signed-off-by: Michael Platings <michael@platin.gs>
---
 t/t8014-blame-ignore-fuzzy.sh | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/t/t8014-blame-ignore-fuzzy.sh b/t/t8014-blame-ignore-fuzzy.sh
index 1ff59624e9..6f1a94caef 100755
--- a/t/t8014-blame-ignore-fuzzy.sh
+++ b/t/t8014-blame-ignore-fuzzy.sh
@@ -332,7 +332,9 @@ test_expect_success setup '
 for i in $(test_seq 2 $last_test); do
 	eval title="\$title$i"
 	test_expect_success "$title" \
-	"git blame -M9 --ignore-rev $IGNOREME $i | sed -e \"$pick_author\" >actual && test_cmp expected$i actual"
+	"git blame -M9 --ignore-rev $IGNOREME $i >output &&
+	sed -e \"$pick_author\" output >actual &&
+	test_cmp expected$i actual"
 done
 
 # This invoked a null pointer dereference when the chunk callback was called
@@ -357,7 +359,8 @@ test_expect_success 'Diff chunks with no suspects' '
 
 	test_write_lines 1 1 >expected &&
 
-	git blame --ignore-rev $REV_2 --ignore-rev $REV_3 file | sed -e "$pick_author" >actual &&
+	git blame --ignore-rev $REV_2 --ignore-rev $REV_3 file >output &&
+	sed -e "$pick_author" output >actual &&
 
 	test_cmp expected actual
 	'
@@ -387,7 +390,8 @@ test_expect_success 'position matching' '
 
 	test_write_lines 1 1 2 2 >expected &&
 
-	git blame --ignore-rev $REV_3 --ignore-rev $REV_4 file2 | sed -e "$pick_author" >actual &&
+	git blame --ignore-rev $REV_3 --ignore-rev $REV_4 file2 >output &&
+	sed -e "$pick_author" output >actual &&
 
 	test_cmp expected actual
 	'
@@ -424,7 +428,8 @@ test_expect_success 'preserve order' '
 
 	test_write_lines 1 2 3 >expected &&
 
-	git blame --ignore-rev $REV_4 --ignore-rev $REV_5 file3 | sed -e "$pick_author" >actual &&
+	git blame --ignore-rev $REV_4 --ignore-rev $REV_5 file3 >output &&
+	sed -e "$pick_author" output >actual &&
 
 	test_cmp expected actual
 	'
-- 
2.21.0


  parent reply index

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-10 15:30 [PATCH v8 0/9] blame: add the ability to ignore commits Barret Rhoden
2019-06-10 15:30 ` [PATCH v8 1/9] fsck: rename and touch up init_skiplist() Barret Rhoden
2019-06-10 15:30 ` [PATCH v8 2/9] Move oidset_parse_file() to oidset.c Barret Rhoden
2019-06-10 15:30 ` [PATCH v8 3/9] blame: use a helper function in blame_chunk() Barret Rhoden
2019-06-10 15:30 ` [PATCH v8 4/9] blame: add the ability to ignore commits and their changes Barret Rhoden
2019-06-10 15:30 ` [PATCH v8 5/9] blame: add config options for the output of ignored or unblamable lines Barret Rhoden
2019-06-10 15:30 ` [PATCH v8 6/9] blame: optionally track line fingerprints during fill_blame_origin() Barret Rhoden
2019-06-10 15:30 ` [PATCH v8 7/9] blame: add a fingerprint heuristic to match ignored lines Barret Rhoden
2019-06-13 15:17   ` SZEDER Gábor
2019-06-13 16:38     ` Junio C Hamano
2019-06-16 20:44     ` michael [this message]
2019-06-17 15:03       ` [PATCH] t8014: avoid git command in upstream pipe Barret Rhoden
2019-06-10 15:30 ` [PATCH v8 8/9] blame: use the fingerprint heuristic to match ignored lines Barret Rhoden
2019-06-10 15:30 ` [PATCH v8 9/9] blame: add a test to cover blame_coalesce() Barret Rhoden

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190616204441.5400-1-michael@platin.gs \
    --to=michael@platin.gs \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=avarab@gmail.com \
    --cc=brho@google.com \
    --cc=dak@gnu.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=l.s.r@web.de \
    --cc=peff@peff.net \
    --cc=stefanbeller@gmail.com \
    --cc=szeder.dev@gmail.com \
    --cc=whydoubt@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

git@vger.kernel.org list mirror (unofficial, one of many)

Archives are clonable:
	git clone --mirror https://public-inbox.org/git
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

Example config snippet for mirrors

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.version-control.git
	nntp://ou63pmih66umazou.onion/inbox.comp.version-control.git
	nntp://czquwvybam4bgbro.onion/inbox.comp.version-control.git
	nntp://hjrcffqmbrq6wope.onion/inbox.comp.version-control.git
	nntp://news.gmane.org/gmane.comp.version-control.git

 note: .onion URLs require Tor: https://www.torproject.org/

AGPL code for this site: git clone https://public-inbox.org/ public-inbox