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

Re: [PATCH] NO_PERL support

From
Jeff King <peff@peff.net>
Date
Apr 3, 2009, 15:16 UTC
Message-ID
<20090403151601.GA27034@coredump.intra.peff.net>
In-Reply-To
<alpine.DEB.1.00.0904031701430.10279@pacific.mpi-cbg.de>
On Fri, Apr 03, 2009 at 05:02:16PM +0200, Johannes Schindelin wrote:
Show 12 quoted lines
> > Yes, there are really two cases here:
> > 
> >   1. options to programs that will be disabled
> > 
> >   2. whole programs that will not be installed
> > 
> > Are you proposing to print "sorry, perl support not compiled in" (or
> > whatever) for case 1, but ignore case 2? (And I am not sure if that is a
> > bad idea, but I am trying to be clear on what you mean).
> 
> 1) as it is all too easy, but not 2) as that would require too much work, 
> which would be overkill.

I don't think 2 is that hard. See the patch below (on top of Robin's). The question is whether it is more confusing for these programs to show up in completion and then turn out to be totally broken, or for them to simply be missing altogether. That is, as a git user who is accustomed to the regular build, will I be more confused by:

  $ git svn
  Sorry, git was built without support for git-svn (NO_PERL).
or
  $ git svn
  git: 'svn' is not a git-command. See 'git --help'.
---
diff --git a/Makefile b/Makefile
index c4eb1ad..41abadb 100644
--- a/Makefile
+++ b/Makefile
@@ -298,7 +298,6 @@ SCRIPT_SH += git-submodule.sh
 SCRIPT_SH += git-web--browse.sh
 
 SCRIPTS = $(patsubst %.sh,%,$(SCRIPT_SH))
-ifndef NO_PERL
 SCRIPT_PERL += git-add--interactive.perl
 SCRIPT_PERL += git-archimport.perl
 SCRIPT_PERL += git-cvsexportcommit.perl
@@ -309,9 +308,6 @@ SCRIPT_PERL += git-send-email.perl
 SCRIPT_PERL += git-svn.perl
 SCRIPTS += $(patsubst %.perl,%,$(SCRIPT_PERL)) \
 			git-instaweb
-else
-SCRIPT_PERL =
-endif
 
 # Empty...
 EXTRA_PROGRAMS =
@@ -1304,6 +1300,13 @@ git-instaweb: git-instaweb.sh gitweb/gitweb.cgi gitweb/gitweb.css
 	    $@.sh > $@+ && \
 	chmod +x $@+ && \
 	mv $@+ $@
+else # NO_PERL
+$(patsubst %.perl,%,$(SCRIPT_PERL)) git-instaweb: % : missing-perl.sh
+	$(QUIET_GEN)$(RM) $@ $@+ && \
+	sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
+	    missing-perl.sh >$@+ && \
+	chmod +x $@+ && \
+	mv $@+ $@
 endif # NO_PERL
 
 configure: configure.ac
diff --git a/missing-perl.sh b/missing-perl.sh
new file mode 100644
index 0000000..d277be9
--- /dev/null
+++ b/missing-perl.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+echo "Sorry, git was built without support for `basename $0` (NO_PERL)."
+exit 128
Previous: Miklos VajnaNext: Johannes Sixt
Message 7 of 30 in “NO_PERL support”
  1. NO_PERL supportRobin H. Johnson, Apr 3, 2009
  2. Jeff KingApr 3, 2009
  3. Johannes SchindelinApr 3, 2009
  4. Jeff KingApr 3, 2009
  5. Johannes SchindelinApr 3, 2009
  6. Miklos VajnaApr 3, 2009
  7. Jeff KingApr 3, 2009
  8. Johannes SixtApr 3, 2009
  9. Jeff KingApr 3, 2009
  10. Jeff KingApr 3, 2009
  11. Robin H. JohnsonApr 3, 2009
  12. Jeff KingApr 3, 2009
  13. Junio C HamanoApr 3, 2009
  14. Jeff KingApr 3, 2009
  15. Junio C HamanoApr 3, 2009
  16. Jeff KingApr 3, 2009
  17. 0/4 NO_PERL supportJeff King, Apr 3, 2009
  18. 1/4 commit: abort commit if interactive add failedJeff King, Apr 3, 2009
  19. 2/4 tests: remove exit after test_done callJeff King, Apr 3, 2009
  20. 3/4 Makefile: allow building without perlJeff King, Apr 3, 2009
  21. Robin H. JohnsonApr 4, 2009
  22. Jeff KingApr 4, 2009
  23. Robin H. JohnsonApr 4, 2009
  24. Jeff KingApr 4, 2009
  25. Robin H. JohnsonApr 5, 2009
  26. Jeff KingApr 7, 2009
  27. 4/4 tests: skip perl tests if NO_PERL is definedJeff King, Apr 3, 2009
  28. Robin H. JohnsonApr 4, 2009
  29. Jeff KingApr 4, 2009
  30. Jeff KingApr 7, 2009

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.