git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 2/2] git p4: add support for 'p4 move' in P4Submit

From
PWPete Wyckoff <pw@padd.com>
Date
Jul 9, 2012, 10:56 UTC
Message-ID
<20120709105629.GA23746@padd.com>
In-Reply-To
<7v7guhpfmn.fsf@alter.siamese.dyndns.org>
gitster@pobox.com wrote on Thu, 05 Jul 2012 23:28 -0700:
Show 24 quoted lines
> Pete Wyckoff <pw@padd.com> writes:
> 
> > diff --git a/t/t9814-git-p4-rename.sh b/t/t9814-git-p4-rename.sh
> > index 84fffb3..8be74b6 100755
> > --- a/t/t9814-git-p4-rename.sh
> > +++ b/t/t9814-git-p4-rename.sh
> > @@ -77,16 +77,16 @@ test_expect_success 'detect renames' '
> >  		git commit -a -m "Rename file1 to file4" &&
> >  		git diff-tree -r -M HEAD &&
> >  		git p4 submit &&
> > -		p4 filelog //depot/file4 &&
> > -		p4 filelog //depot/file4 | test_must_fail grep -q "branch from" &&
> > +		p4 filelog //depot/file4 | tee filelog &&
> > +		! grep -q " from //depot" filelog &&
> 
> I am not a huge fan of using "tee" in our test scripts, especially
> as it means piping output of another command whose output (and
> presumably the behaviour) we care about, hiding its exit status.
> 
> Fixing the incorrect use of piping to "test_must_fail grep" is a
> good change, but is there anything wrong to do the above like this?
> 
> 	p4 filelog //depot/file4 >filelog &&
> 	! grep -q " from //depot" filelog &&

I'd started growing fond of "tee" as it shows all the output, and isolates the grep as a separate step. Much easier to see the bad output when a test fails.

I'll switch around to your approach, adding a "cat filelog" line for interesting cases.

		-- Pete
Previous: Junio C Hamano
Message 5 of 5 in “git p4: use "move" command for renames”
  1. 0/2 git p4: use "move" command for renamesPete Wyckoff, Jul 4, 2012
  2. 1/2 git p4: refactor diffOpts calculationPete Wyckoff, Jul 4, 2012
  3. 2/2 git p4: add support for 'p4 move' in P4SubmitPete Wyckoff, Jul 4, 2012
  4. Junio C HamanoJul 6, 2012
  5. Pete WyckoffJul 9, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.