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

Re: /bin/sh portability question

From
Junio C Hamano <junkio@cox.net>
Date
Sep 24, 2005, 21:31 UTC
Message-ID
<7vll1mup98.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<20050924195029.GA20514@bohr.gbar.dtu.dk>
"Peter Eriksen" <s022018@student.dtu.dk> writes:
> Here are some small problems to begin with.

Thanks. Next time, please format your patch according to Documentation/SubmittingPatches. Your MUA ate tabs and leading whitespaces from the diff, and you lack Signed-off-by line.

I think you need to pass down SHELL_PATH, and prepare for people running 'make' by hand in t/ directory.

diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -252,7 +252,7 @@ SCRIPTS = $(patsubst %.sh,%,$(SCRIPT_SH)
 	  $(patsubst %.py,%,$(SCRIPT_PYTHON)) \
 	  gitk
 
-export TAR INSTALL DESTDIR
+export TAR INSTALL DESTDIR SHELL_PATH
 ### Build rules
 
 all: $(PROGRAMS) $(SCRIPTS)
diff --git a/t/Makefile b/t/Makefile
--- a/t/Makefile
+++ b/t/Makefile
@@ -4,8 +4,9 @@
 #
 
 #GIT_TEST_OPTS=--verbose --debug
+SHELL_PATH ?= $(SHELL)
 

BTW, do you have access to a Linux machine to play with?  It
would have caught this fairly easily.

Test of 'tar' timestamp would also fail if you do not use
'gtar', but as far as I know that test is the only place we
really rely on 'tar', so it may not be worth fixing.

'xargs -0' and 'find -print0' is really essential in some of the
git barebone scripts.  I think the one in git-reset can go, by 
unlinking in the Perl script instead of printing the name and
running "xargs -0 rm -f --" on it.

The one in git-commit I am not sure about.  We do want to make
it really generic and keep allowing LF in paths.  Maybe we would
want 'git-update-index --stdin [-z]' to read list of paths from
the standard input.

The one in git-grep I would not worry too much about; we should
rewrite the whole thing in Perl and the problem will disappear.
Previous: H. Peter AnvinNext: Nico -telmich- Schottelius
Message 14 of 16 in “/bin/sh portability question”
  1. Peter EriksenSep 23, 2005
  2. Junio C HamanoSep 23, 2005
  3. SeanSep 23, 2005
  4. Junio C HamanoSep 23, 2005
  5. SeanSep 23, 2005
  6. Junio C HamanoSep 23, 2005
  7. Peter EriksenSep 23, 2005
  8. Junio C HamanoSep 24, 2005
  9. Patrick MauritzSep 24, 2005
  10. H. Peter AnvinSep 23, 2005
  11. Morten WelinderSep 23, 2005
  12. Joel BeckerSep 23, 2005
  13. H. Peter AnvinSep 23, 2005
  14. Junio C HamanoSep 24, 2005
  15. Nico -telmich- SchotteliusSep 25, 2005
  16. SeanSep 25, 2005

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.