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

Re: [PATCH] t5570: forward git-daemon messages in a different way

From
Jeff King <peff@peff.net>
Date
Apr 16, 2012, 17:42 UTC
Message-ID
<20120416174230.GA19226@sigill.intra.peff.net>
In-Reply-To
<4F8C3E0F.2040300@in.waw.pl>
On Mon, Apr 16, 2012 at 05:43:11PM +0200, Zbigniew Jędrzejewski-Szmek wrote:
Show 17 quoted lines
> % dash -x test2.sh | wc -l
> + mkfifo fd
> + pid=10738
> + read line
> + yes
> + echo y
> + sleep 1
> + kill 10738
> test2.sh: 12: kill: No such process
> 
> + wait 10738
> + rm -f fd
> ^C
> 
> It hangs at the end until killed with ^C. This seem to happen fairly reliably
> (nineteen times out of twenty or so). This is with dash 0.5.7-3 and 0.5.5.1-7.4
> from debian. With bash test2.sh seems to always run successfully.
Hmm. t5570 seems to pass reliably on dash for me with:
diff --git a/t/lib-git-daemon.sh b/t/lib-git-daemon.sh
index ef2d01f..9f52cb6 100644
--- a/t/lib-git-daemon.sh
+++ b/t/lib-git-daemon.sh
@@ -33,7 +33,7 @@ start_git_daemon() {
 	{
 		read line
 		echo >&4 "$line"
-		cat >&4 &
+		cat >&4 <git_daemon_output &
 
 		# Check expected output
 		if test x"$(expr "$line" : "\[[0-9]*\] \(.*\)")" != x"Ready to rumble"

But the test above does fail. Is it purely luck of the timing that
git-daemon never gets SIGPIPE? I guess the problem is that the
{}-section can finish before "cat <git_daemon_output" has actually
opened the pipe?

I'd just feel better about the solution if we were sure we understood
the exact problem.

-Peff
Previous: Junio C HamanoNext: Clemens Buchacher
Message 9 of 20 in “t5570: forward git-daemon messages in a different way”
  1. t5570: forward git-daemon messages in a different wayZbigniew Jędrzejewski-Szmek, Apr 14, 2012
  2. Clemens BuchacherApr 14, 2012
  3. Clemens BuchacherApr 14, 2012
  4. Zbigniew Jędrzejewski-SzmekApr 16, 2012
  5. Junio C HamanoApr 16, 2012
  6. Clemens BuchacherApr 16, 2012
  7. Zbigniew Jędrzejewski-SzmekApr 16, 2012
  8. Junio C HamanoApr 17, 2012
  9. Jeff KingApr 16, 2012
  10. Clemens BuchacherApr 16, 2012
  11. Jeff KingApr 19, 2012
  12. Johannes SixtApr 19, 2012
  13. Jeff KingApr 26, 2012
  14. Johannes SixtApr 26, 2012
  15. Clemens BuchacherApr 26, 2012
  16. t5570: fix forwarding of git-daemon messages via catJohannes Sixt, Apr 26, 2012
  17. Zbigniew Jędrzejewski-SzmekApr 26, 2012
  18. Jeff KingApr 27, 2012
  19. Junio C HamanoApr 27, 2012
  20. Jeff KingApr 27, 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.