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

Re: [PATCH 0/5] some shell portability fixes

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 6, 2007, 20:46 UTC
Message-ID
<7v8x5bgl04.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<20071106201518.GA6361@ins.uni-bonn.de>
All missing Signed-off-by: lines.
[1/5] In addition to take advantage of the fact that the RHS of
      assignment is not split, I'd prefer replacing `` with $()
      with these cases.	 Much easier to read if your shell
      supports it (and all the modern ones do).
[2/5] Gaah, AIX sed X-<.  I am not opposed to this patch but
      would want to get Yays from people with non GNU sed.  Is
      busybox sed good enough to grok our scripts these days?
      Please ask help and collect Acks at least from folks on
      Solaris, MacOS, FBSD, and OBSD.
[3/5] Arithmetic expansion.  Have you caught _all_ of them, or
      is this patch about only the ones you noticed?
      We used to have expr all over the place as I was one of
      the primary authors of our shell scripts, and I am
      "80-ish" old fashioned.  There was a long discussion on
      scripts in the past and we ruled that $(( ... )) is easier
      to read and supported widely enough to be acceptable.
      This patch goes backwards.  Will drop, unless you can
      demonstrate that an implementation does not support it and
      convince people that the implementation is important.
      /bin/sh on Solaris does not count as you can configure
      SHELL_PATH to point at xpg4 shell or ksh on that platform.
[4/5] I wonder if use of fgrep would be easier to read and more
      portable with this one:
	name=$( GIT_CONFIG=.gitmodules \
		git config --get-regexp '^submodule\..*\.path$' |
		fgrep "submodule.$1.path" |
		sed -e 's/^submodule\.\(.*\)\.path$/\1/'
	)
[5/5] Again, have you covered all of them?  I am not opposed to
      this one, although I am a bit curious who lacks -a/-o in
      practice.
Previous: Ralf WildenhuesNext: Mike Hommey
Message 25 of 38 in “some shell portability fixes”
  1. 0/5 some shell portability fixesRalf Wildenhues, Nov 6, 2007
  2. 1/5 Avoid a few unportable, needlessly nested "...`...".Ralf Wildenhues, Nov 6, 2007
  3. 2/5 Fix sed script to work with AIX sed.Ralf Wildenhues, Nov 6, 2007
  4. Ralf WildenhuesNov 6, 2007
  5. Ralf WildenhuesNov 6, 2007
  6. Junio C HamanoNov 6, 2007
  7. Add Documentation/CodingStyleJohannes Schindelin, Nov 6, 2007
  8. Andreas EricssonNov 7, 2007
  9. Junio C HamanoNov 7, 2007
  10. Andreas EricssonNov 7, 2007
  11. Add Documentation/CodingStyleJohannes Schindelin, Nov 7, 2007
  12. Robin RosenbergNov 7, 2007
  13. Add Documentation/CodingGuidelinesJohannes Schindelin, Nov 7, 2007
  14. Junio C HamanoNov 7, 2007
  15. Add Documentation/CodingGuidelinesJohannes Schindelin, Nov 8, 2007
  16. Junio C HamanoNov 8, 2007
  17. Johannes SchindelinNov 7, 2007
  18. Wincent ColaiutaNov 7, 2007
  19. Andreas EricssonNov 7, 2007
  20. Jon LoeligerNov 7, 2007
  21. Johannes SchindelinNov 7, 2007
  22. Mike RalphsonNov 8, 2007
  23. 4/5 Fix sed string regex escaping in module_name.Ralf Wildenhues, Nov 6, 2007
  24. 5/5 Avoid "test -o" and "test -a" which are not POSIX, only XSI.Ralf Wildenhues, Nov 6, 2007
  25. Junio C HamanoNov 6, 2007
  26. Mike HommeyNov 6, 2007
  27. Johannes SchindelinNov 6, 2007
  28. Mike RalphsonNov 7, 2007
  29. Johannes SchindelinNov 7, 2007
  30. Mike RalphsonNov 7, 2007
  31. Johannes SchindelinNov 7, 2007
  32. Ralf WildenhuesNov 6, 2007
  33. Nguyen Thai Ngoc DuyNov 7, 2007
  34. Nguyen Thai Ngoc DuyNov 7, 2007
  35. Junio C HamanoNov 7, 2007
  36. Ralf WildenhuesNov 8, 2007
  37. Nguyen Thai Ngoc DuyNov 12, 2007
  38. Miles BaderNov 10, 2007

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.