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

Re: [PATCH 1/7] Use 'printf %s $x' notation in t5401

From
Shawn O. Pearce <spearce@spearce.org>
Date
Jan 31, 2008, 03:41 UTC
Message-ID
<20080131034156.GV24004@spearce.org>
In-Reply-To
<7vbq72hjzo.fsf@gitster.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> wrote:
Show 10 quoted lines
> "Shawn O. Pearce" <spearce@spearce.org> writes:
> >> 	printf '%s\n' "$@"
> >
> > Eh.  Since all we care is that the argument count is 0 we probably
> > should be looking at $# and calling it a day.
> 
> I'll apply as-is, but once you break the code that calls
> pre-receive hook in such a way that it sends unexpected
> arguments, you'd thank me for suggesting to print the arguments
> separately while debugging the problem with the test script.

Well, I don't really think it matters. I doubt we'll break that code that invokes the pre-receive or post-receive hooks. And as those hooks are defined to never take arguments if we did suddenly start passing arguments we want the test to break. When tests break sometimes its not obvious why they have broken.

Case in point, the "remote: " prefixing caused by the sideband demultiplexer really confused me for about 15 minutes. I could not figure out why the last test in this script was failing. Until I pulled my head out of the sand and looked at the "actual" file and saw those prefixes. At which point it was very obvious.

:)

We haven't touched that script in almost a year. I poked at it only to fix a stupid error from my printf implementation, and because of the new "remote:" prefix. Which since it is a change in behavior may cause problems for anyone who is trying to screen-scrape the stderr of git-push. Gawd I hope nobody's scripts are that convoluted.

-- 
Shawn.
Previous: Junio C Hamano
Message 5 of 5 in “Use 'printf %s $x' notation in t5401”
  1. 1/7 Use 'printf %s $x' notation in t5401Shawn O. Pearce, Jan 30, 2008
  2. Junio C HamanoJan 30, 2008
  3. Shawn O. PearceJan 30, 2008
  4. Junio C HamanoJan 31, 2008
  5. Shawn O. PearceJan 31, 2008

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.