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

Re: [Breakage] Git v2.21.0-rc0 - t5403 (NonStop)

From
SZEDER Gábor <szeder.dev@gmail.com>
Date
Feb 8, 2019, 11:10 UTC
Message-ID
<20190208111002.GU10587@szeder.dev>
In-Reply-To
<000d01d4bf9b$d5d48da0$817da8e0$@nexbridge.com>
On Fri, Feb 08, 2019 at 05:48:27AM -0500, Randall S. Becker wrote:
Show 26 quoted lines
> We have a few new breakages on the NonStop port in 2.21.0-rc0. The first is in t5403, as below:
> 
> /home/git/git/t/trash directory.t5403-post-checkout-hook/clone3/.git/hooks/post-checkout: line 2: $GIT_DIR/post-checkout.args: ambiguous redirect
> not ok 8 - post-checkout hook is triggered by clone
> #
> #               mkdir -p templates/hooks &&
> #               write_script templates/hooks/post-checkout <<-\EOF &&
> #               echo "$@" >$GIT_DIR/post-checkout.args
> #               EOF
> #               git clone --template=templates . clone3 &&
> #               test -f clone3/.git/post-checkout.args
> #
> 
> The post-checkout hook is:
> #!/usr/local/bin/bash
> echo "$@" >$GIT_DIR/post-checkout.args
> 
> This looks like it is a "bash thing" and $GIT_DIR might have to be in quotes, and is not be specific to the platform. If I replace 
> 
> echo "$@" >$GIT_DIR/post-checkout.args
> 
> with
> 
> echo "$@" >"$GIT_DIR/post-checkout.args"
> 
> The test passes.

Wow, this is the second time this "redirection to a filename with spaces under Bash" issue pops up today, see the other one here:

  https://public-inbox.org/git/20190208031746.22683-2-tmz@pobox.com/T/#u

In short, Bash (when invoked as bash) doesn't conform to POSIX in this respect; for a (too detailed) explanation see:

  https://public-inbox.org/git/20180926121107.GH27036@localhost/

Even our CodingGuidelines suggest the use of quotes around the redirection's target.

> I wonder I should provide this patch or whether the author would like to do so.

Well, since you didn't Cc the author, he might very well overlook this issue, so I think you should ;)

Previous: Randall S. BeckerNext: Randall S. Becker
Message 4 of 8 in “[Breakage] Git v2.21.0-rc0 - t5403 (NonStop)”
  1. Randall S. BeckerFeb 8, 2019
  2. Johannes SchindelinFeb 8, 2019
  3. Randall S. BeckerFeb 8, 2019
  4. SZEDER GáborFeb 8, 2019
  5. Randall S. BeckerFeb 8, 2019
  6. Todd ZullingerFeb 8, 2019
  7. SZEDER GáborFeb 8, 2019
  8. Todd ZullingerFeb 9, 2019

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.