git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] t5500-fetch-pack: ignore output from git init
@ 2009-05-23 19:34 Stephen Boyd
  2009-05-24 16:43 ` Jeff King
  0 siblings, 1 reply; 4+ messages in thread
From: Stephen Boyd @ 2009-05-23 19:34 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
---
 t/t5500-fetch-pack.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh
index c450f33..ce74508 100755
--- a/t/t5500-fetch-pack.sh
+++ b/t/t5500-fetch-pack.sh
@@ -97,7 +97,7 @@ pull_to_client () {
 (
 	mkdir client &&
 	cd client &&
-	git init 2>> log2.txt &&
+	git init 2>> log2.txt > /dev/null &&
 	git config transfer.unpacklimit 0
 )
 
-- 
1.6.3.1.145.gb74d77

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] t5500-fetch-pack: ignore output from git init
  2009-05-23 19:34 [PATCH] t5500-fetch-pack: ignore output from git init Stephen Boyd
@ 2009-05-24 16:43 ` Jeff King
  2009-05-24 16:48   ` Jeff King
  0 siblings, 1 reply; 4+ messages in thread
From: Jeff King @ 2009-05-24 16:43 UTC (permalink / raw)
  To: Stephen Boyd; +Cc: Junio C Hamano, git

On Sat, May 23, 2009 at 12:34:42PM -0700, Stephen Boyd wrote:

> Signed-off-by: Stephen Boyd <bebarino@gmail.com>

There is no rationale given in the commit message, but I assume it is
"this spews useless crap to the terminal that interferes with the usual
test output".

However, this seems like the wrong direction. We already have a nice
test infrastructure that redirects test output away from the user and
respects "--verbose" to turn it back on. t5500 does quite a bit of work
outside the test harness, and it makes more sense to me to move it
inside. That would take care of your useless spew, _and_ it would help
detect failures in a more robust way.

In other words:

> diff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh
> index c450f33..ce74508 100755
> --- a/t/t5500-fetch-pack.sh
> +++ b/t/t5500-fetch-pack.sh
> @@ -97,7 +97,7 @@ pull_to_client () {
>  (
>  	mkdir client &&
>  	cd client &&
> -	git init 2>> log2.txt &&
> +	git init 2>> log2.txt > /dev/null &&
>  	git config transfer.unpacklimit 0
>  )

Why not:

  test_expect_success 'setup client repo' '
    mkdir client &&
    (cd client &&
     git init 2>>log2.txt &&
     git config transfer.unpacklimit 0
    )
  '

?

-Peff

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] t5500-fetch-pack: ignore output from git init
  2009-05-24 16:43 ` Jeff King
@ 2009-05-24 16:48   ` Jeff King
  2009-05-24 17:43     ` Stephen Boyd
  0 siblings, 1 reply; 4+ messages in thread
From: Jeff King @ 2009-05-24 16:48 UTC (permalink / raw)
  To: Stephen Boyd; +Cc: Junio C Hamano, git

On Sun, May 24, 2009 at 12:43:30PM -0400, Jeff King wrote:

> > +++ b/t/t5500-fetch-pack.sh
> > @@ -97,7 +97,7 @@ pull_to_client () {
> >  (
> >  	mkdir client &&
> >  	cd client &&
> > -	git init 2>> log2.txt &&
> > +	git init 2>> log2.txt > /dev/null &&
> >  	git config transfer.unpacklimit 0
> >  )
> 
> Why not:
> 
>   test_expect_success 'setup client repo' '
>     mkdir client &&
>     (cd client &&
>      git init 2>>log2.txt &&
>      git config transfer.unpacklimit 0
>     )
>   '

Actually, taking a closer look at the script, I think you could probably
ditch the '2>>log2.txt' bit entirely. The log file is never read and
appears to be completely for debugging. Putting the code into the test
harness means that output will respect --verbose properly, which means a
separate log is unnecessary.

-Peff

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] t5500-fetch-pack: ignore output from git init
  2009-05-24 16:48   ` Jeff King
@ 2009-05-24 17:43     ` Stephen Boyd
  0 siblings, 0 replies; 4+ messages in thread
From: Stephen Boyd @ 2009-05-24 17:43 UTC (permalink / raw)
  To: Jeff King; +Cc: Junio C Hamano, git

Jeff King wrote:
> Actually, taking a closer look at the script, I think you could probably
> ditch the '2>>log2.txt' bit entirely. The log file is never read and
> appears to be completely for debugging. Putting the code into the test
> harness means that output will respect --verbose properly, which means a
> separate log is unnecessary.
>
> -Peff

Yeah I sent this off real quick because of the reason you state
(terminal crap). In the end, the test really needs to be modernized. If
someone else doesn't get around to it, I'll start seeing what I can do
to make it better.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-05-24 17:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-23 19:34 [PATCH] t5500-fetch-pack: ignore output from git init Stephen Boyd
2009-05-24 16:43 ` Jeff King
2009-05-24 16:48   ` Jeff King
2009-05-24 17:43     ` Stephen Boyd

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).