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

Re: [PATCH] Allow shell scripts to run with non-Bash /bin/sh

From
Adam Flott <adam@npjh.com>
Date
Sep 22, 2007, 21:37 UTC
Message-ID
<20070922162750.Y1876@localhost>
In-Reply-To
<7vhclngpgd.fsf@gitster.siamese.dyndns.org>
On Fri, 21 Sep 2007, Junio C Hamano wrote:
Show 5 quoted lines
> I vaguely recall somebody else had exactly this issue and he
> concluded that the shell was busted.  I do not recall the
> details of the story but interestingly, if he did something that
> accesses "$#" before the problematic "while case $# in ..." the
> shell behaved for him in his experiments.
That is what I did notice, just accessing $# fixed later uses of it.
Show 5 quoted lines
> Also by my comment about "/bin/sh and bash not being the only
> shells available on FreeBSD", I did not mean that you should
> change your /bin/sh.  You can build git with SHELL_PATH make
> varilable pointing at a non-broken shell, which does not have to
> be installed as /bin/sh.

If one's installing from the ports tree, then the port should depend on a non-broken shell and set SHELL_PATH. And as for installing by hand, just print out a warning that SHELL_PATH points to a broken shell and be done with it. This is a FreeBSD bug, not a git one.

I had been meaning to write up a bug about this using a small test case, but I couldn't reproduce it.

Adam
Previous: Junio C HamanoNext: Junio C Hamano
Message 14 of 45 in “Allow shell scripts to run with non-Bash /bin/sh”
  1. Allow shell scripts to run with non-Bash /bin/shEygene Ryabinkin, Sep 21, 2007
  2. Junio C HamanoSep 21, 2007
  3. David KastrupSep 22, 2007
  4. Junio C HamanoSep 22, 2007
  5. Junio C HamanoSep 22, 2007
  6. David KastrupSep 22, 2007
  7. Junio C HamanoSep 22, 2007
  8. Eygene RyabinkinSep 22, 2007
  9. David KastrupSep 22, 2007
  10. Junio C HamanoSep 22, 2007
  11. Vineet KumarSep 22, 2007
  12. David KastrupSep 22, 2007
  13. Junio C HamanoSep 22, 2007
  14. Adam FlottSep 22, 2007
  15. Junio C HamanoSep 22, 2007
  16. Eygene RyabinkinSep 23, 2007
  17. David KastrupSep 23, 2007
  18. Junio C HamanoSep 23, 2007
  19. David KastrupSep 23, 2007
  20. Supplant the "while case ... break ;; esac" idiomDavid Kastrup, Sep 23, 2007
  21. Junio C HamanoSep 23, 2007
  22. David KastrupSep 24, 2007
  23. David KastrupSep 24, 2007
  24. Junio C HamanoSep 24, 2007
  25. David KastrupSep 25, 2007
  26. Junio C HamanoSep 25, 2007
  27. Johannes SchindelinSep 25, 2007
  28. Avi KivitySep 25, 2007
  29. Mike HommeySep 24, 2007
  30. David KastrupSep 24, 2007
  31. David SymondsSep 24, 2007
  32. David KastrupSep 24, 2007
  33. Pierre HabouzitSep 24, 2007
  34. Pierre HabouzitSep 24, 2007
  35. Johannes SchindelinSep 24, 2007
  36. Miles BaderSep 24, 2007
  37. Eygene RyabinkinSep 24, 2007
  38. Miles BaderSep 24, 2007
  39. David KastrupSep 24, 2007
  40. Johannes SchindelinSep 24, 2007
  41. David KastrupSep 24, 2007
  42. Miles BaderSep 24, 2007
  43. Junio C HamanoSep 24, 2007
  44. David KastrupSep 24, 2007
  45. David KastrupSep 24, 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.