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

Re: [PATCH 1/6] git-p4 tests: refactor and cleanup

From
Stefano Lattarini <stefano.lattarini@gmail.com>
Date
Oct 16, 2011, 09:38 UTC
Message-ID
<201110161138.58396.stefano.lattarini@gmail.com>
In-Reply-To
<20111015155517.GB29436@arf.padd.com>
Hi Pete, hope you don't mind a couple of minor nits from an outsider ...
Show 9 quoted lines
> +# Try to pick a unique port: guess a large number, then hope
> +# no more than one of each test is running.
> +#
> +# This does not handle the case where somebody else is running the
> +# same tests and has chosen the same ports.
> +testid=${this_test#t}
> +git_p4_test_start=9800
> +P4DPORT=$((10669 + (testid - git_p4_test_start)))
> +

This won't work with older versions of the Almquist shell (without prepending `testid' and `git_p4_test_start' with a `$', that is):

  $ ash-0.5.2 -c 'a=4; b=2; echo $(( 1 + (a - b) ))'
  ash-0.5.2: arith: syntax error: " 1 + (a - b) "

Still, it works with all the other POSIX-ish shells that I've tried, including dash 0.5.5.1 on GNU/Linux, NetBSD 5.1 /bin/sh and /bin/ksh, and Solaris 10 /bin/ksh and /usr/xpg4/bin/sh, so it might not be worth worrying about.

Same goes for other similar usages in the rest of the patch, such as "git config git-p4.detectCopies $((level + 2))"

Regards,
  Stefano
Previous: Pete WyckoffNext: Stefano Lattarini
Message 3 of 13 in “git-p4 tests, filetypes, shell metacharacters”
  1. 0/6 git-p4 tests, filetypes, shell metacharactersPete Wyckoff, Oct 15, 2011
  2. 1/6 git-p4 tests: refactor and cleanupPete Wyckoff, Oct 15, 2011
  3. Stefano LattariniOct 16, 2011
  4. Stefano LattariniOct 16, 2011
  5. Pete WyckoffOct 16, 2011
  6. 2/6 git-p4: handle utf16 filetype properlyPete Wyckoff, Oct 15, 2011
  7. Stefano LattariniOct 16, 2011
  8. Pete WyckoffOct 16, 2011
  9. 3/6 git-p4: recognize all p4 filetypesPete Wyckoff, Oct 15, 2011
  10. 4/6 git-p4: stop ignoring apple filetypePete Wyckoff, Oct 15, 2011
  11. 5/6 git-p4: keyword flattening fixesPete Wyckoff, Oct 15, 2011
  12. 6/6 git-p4: handle files with shell metacharactersPete Wyckoff, Oct 15, 2011
  13. Luke DiamandOct 15, 2011

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.