git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Felipe Contreras <felipe.contreras@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org
Subject: Re: Topics currently in the Stalled category
Date: Tue, 27 Nov 2012 22:11:18 -0500	[thread overview]
Message-ID: <20121128031118.GB27772@sigill.intra.peff.net> (raw)
In-Reply-To: <20121128025928.GA27772@sigill.intra.peff.net>

On Tue, Nov 27, 2012 at 09:59:28PM -0500, Jeff King wrote:

> > >  Renaming of remote-testgit feels to be a mistake.  It probably
> > >  should keep its source in remote-testgit.bash and generate it,
> > 
> > Why generate it? There's nothing to generate. python's source code
> > needs regeneration, bash's code doesn't.
> 
> We fix up the #!-lines on all of the existing shell scripts (as well as
> python and perl). Wouldn't we want to do the same for people who have
> bash in an alternate location?
> 
> As the series is now, people with bash in their PATH, but not in
> /bin/bash, will fail t5801 (the prereq to skip the test uses "type", but
> git-remote-testgit hardcodes /bin/bash).

We could improve the test in t5801, but it is nice to let people on such
systems test it, as well. And the infrastructure might be useful if we
ever acquire more bash scripts.

There's a fair bit of boilerplate, but I think this squashable patch
would do it:

diff --git a/.gitignore b/.gitignore
index 46595db..3b636bd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -124,6 +124,7 @@
 /git-remote-ftps
 /git-remote-fd
 /git-remote-ext
+/git-remote-testgit
 /git-remote-testsvn
 /git-remote-testpy
 /git-repack
diff --git a/Makefile b/Makefile
index 68f1ac2..19f6fd2 100644
--- a/Makefile
+++ b/Makefile
@@ -424,6 +424,7 @@ PROGRAM_OBJS =
 PROGRAMS =
 SCRIPT_PERL =
 SCRIPT_PYTHON =
+SCRIPT_BASH =
 SCRIPT_SH =
 SCRIPT_LIB =
 TEST_PROGRAMS_NEED_X =
@@ -473,9 +474,12 @@ SCRIPT_PERL += git-svn.perl
 SCRIPT_PYTHON += git-remote-testpy.py
 SCRIPT_PYTHON += git-p4.py
 
+SCRIPT_BASH += git-remote-testgit.bash
+
 SCRIPTS = $(patsubst %.sh,%,$(SCRIPT_SH)) \
 	  $(patsubst %.perl,%,$(SCRIPT_PERL)) \
 	  $(patsubst %.py,%,$(SCRIPT_PYTHON)) \
+	  $(patsubst %.bash,%,$(SCRIPT_BASH)) \
 	  git-instaweb
 
 ETAGS_TARGET = TAGS
@@ -571,9 +575,13 @@ endif
 ifndef PYTHON_PATH
 	PYTHON_PATH = /usr/bin/python
 endif
+ifndef BASH_PATH
+	BASH_PATH = /bin/bash
+endif
 
 export PERL_PATH
 export PYTHON_PATH
+export BASH_PATH
 
 LIB_FILE=libgit.a
 XDIFF_LIB=xdiff/lib.a
@@ -1931,6 +1939,10 @@ ifeq ($(PYTHON_PATH),)
 NO_PYTHON=NoThanks
 endif
 
+ifeq ($(BASH_PATH),)
+NO_BASH=NoThanks
+endif
+
 QUIET_SUBDIR0  = +$(MAKE) -C # space to separate -C and subdir
 QUIET_SUBDIR1  =
 
@@ -2006,6 +2018,7 @@ gitwebdir_SQ = $(subst ','\'',$(gitwebdir))
 SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
 PERL_PATH_SQ = $(subst ','\'',$(PERL_PATH))
 PYTHON_PATH_SQ = $(subst ','\'',$(PYTHON_PATH))
+BASH_PATH_SQ = $(subst ','\'',$(BASH_PATH))
 TCLTK_PATH_SQ = $(subst ','\'',$(TCLTK_PATH))
 DIFF_SQ = $(subst ','\'',$(DIFF))
 
@@ -2267,6 +2280,15 @@ $(patsubst %.py,%,$(SCRIPT_PYTHON)): % : unimplemented.sh
 	mv $@+ $@
 endif # NO_PYTHON
 
+ifndef NO_BASH
+$(patsubst %.bash,%,$(SCRIPT_BASH)):
+	$(QUIET_GEN)$(RM) $@ $@+ && \
+	sed -e '1s|#!.*/bash|#!$(BASH_PATH_SQ)|' \
+	    $@.bash >$@+ && \
+	chmod +x $@+ && \
+	mv $@+ $@
+endif
+
 configure: configure.ac GIT-VERSION-FILE
 	$(QUIET_GEN)$(RM) $@ $<+ && \
 	sed -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
@@ -2599,6 +2621,7 @@ GIT-BUILD-OPTIONS: FORCE
 	@echo USE_LIBPCRE=\''$(subst ','\'',$(subst ','\'',$(USE_LIBPCRE)))'\' >>$@
 	@echo NO_PERL=\''$(subst ','\'',$(subst ','\'',$(NO_PERL)))'\' >>$@
 	@echo NO_PYTHON=\''$(subst ','\'',$(subst ','\'',$(NO_PYTHON)))'\' >>$@
+	@echo NO_BASH=\''$(subst ','\'',$(subst ','\'',$(NO_BASH)))'\' >>$@
 	@echo NO_UNIX_SOCKETS=\''$(subst ','\'',$(subst ','\'',$(NO_UNIX_SOCKETS)))'\' >>$@
 ifdef GIT_TEST_OPTS
 	@echo GIT_TEST_OPTS=\''$(subst ','\'',$(subst ','\'',$(GIT_TEST_OPTS)))'\' >>$@
diff --git a/git-remote-testgit b/git-remote-testgit.bash
similarity index 100%
rename from git-remote-testgit
rename to git-remote-testgit.bash
diff --git a/t/t5801-remote-helpers.sh b/t/t5801-remote-helpers.sh
index 456303b..d6ebc5e 100755
--- a/t/t5801-remote-helpers.sh
+++ b/t/t5801-remote-helpers.sh
@@ -7,7 +7,7 @@ test_description='Test remote-helper import and export commands'
 
 . ./test-lib.sh
 
-if ! type "${BASH-bash}" >/dev/null 2>&1; then
+if ! test_have_prereq BASH; then
 	skip_all='skipping remote-testgit tests, bash not available'
 	test_done
 fi
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 489bc80..5300fa9 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -675,6 +675,7 @@ esac
 ( COLUMNS=1 && test $COLUMNS = 1 ) && test_set_prereq COLUMNS_CAN_BE_1
 test -z "$NO_PERL" && test_set_prereq PERL
 test -z "$NO_PYTHON" && test_set_prereq PYTHON
+test -z "$NO_BASH" && test_set_prereq BASH
 test -n "$USE_LIBPCRE" && test_set_prereq LIBPCRE
 test -z "$NO_GETTEXT" && test_set_prereq GETTEXT
 

  parent reply	other threads:[~2012-11-28  3:11 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-19 23:55 What's cooking in git.git (Nov 2012, #06; Mon, 19) Junio C Hamano
2012-11-20  1:41 ` Felipe Contreras
2012-11-20 11:59 ` Paul Fox
2012-11-20 23:50 ` Junio C Hamano
2012-11-21  0:05   ` Topics currently in the Stalled category Junio C Hamano
2012-11-21  3:31     ` Felipe Contreras
2012-11-28  2:59       ` Jeff King
2012-11-28  3:10         ` Felipe Contreras
2012-11-28  3:12           ` Jeff King
2012-11-28  3:11         ` Jeff King [this message]
2012-11-28  3:15           ` Felipe Contreras
2012-11-28  3:22             ` Jeff King
2012-11-28  3:33               ` Felipe Contreras
2012-11-21 14:55     ` Marc Branchaud
2012-11-22 11:24     ` Nguyen Thai Ngoc Duy
2012-11-22 16:38       ` [PATCH v2 0/4] nd/unify-appending-of-s-o-b Nguyễn Thái Ngọc Duy
2012-11-22 16:38         ` [PATCH v2 1/4] t4014: more tests about appending s-o-b lines Nguyễn Thái Ngọc Duy
2012-12-02  7:06           ` Torsten Bögershausen
2012-12-02  8:03             ` Brandon Casey
2012-11-22 16:38         ` [PATCH v2 2/4] format-patch: stricter S-o-b detection Nguyễn Thái Ngọc Duy
2012-11-22 16:38         ` [PATCH v2 3/4] format-patch: update append_signoff prototype Nguyễn Thái Ngọc Duy
2012-11-22 16:38         ` [PATCH v2 4/4] Unify appending signoff in format-patch, commit and sequencer Nguyễn Thái Ngọc Duy
2012-11-24  2:05         ` [PATCH v2 0/4] nd/unify-appending-of-s-o-b Junio C Hamano
2012-12-01  0:36     ` Topics currently in the Stalled category Adam Spiers
  -- strict thread matches above, loose matches on Subject: below --
2012-11-21  2:46 Paul Fox
2012-11-21  9:27 ` Krzysztof Mazur
2012-11-21 19:34   ` Jeff King
2012-11-21 19:50     ` Paul Fox
2012-11-21 19:53     ` Junio C Hamano
2012-11-21 20:13       ` Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20121128031118.GB27772@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=felipe.contreras@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).