bug: git-sh-setup should not be in $PATH
Hello,
I often install tools locally so I can run SVN/CVS/etc versions in my own account. To do this, I install into
$HOME/usr/pkg/PACKAGE
and a script that generates scripts in $HOME/usr/bin/ (which is in my $PATH) like
#!/bin/sh
exec /home/lilydev/usr/pkg/git/bin/git-prune "$@" # generated: update-pkgs
this breaks with git-sh-setup; all sh scripts are broken with this setup.
git-sh-setup isn't a 'normal' binary, in that it should be called by bash only and not run in a subshell. Therefore I propose that it
- be installed in <prefix>/share/git/
- be invoked with an explicit path, i.e.
. <prefix>/share/git/
--
Han-Wen Nienhuys - [email protected] - http://www.xs4all.nl/~hanwen
Hi,
Quoted 4 lines · Han-Wen Nienhuys
I often install tools locally so I can run SVN/CVS/etc versions in my own account. To do this, I install into
$HOME/usr/pkg/PACKAGE
Why not just set
$ export GIT_EXEC_PATH=$HOME/usr/pkg/git $ export PATH=$PATH:$GIT_EXEC_PATH
?
Ciao,
Johannes Schindelin escreveu:
Quoted 7 lines
Hi,
Quoted 3 lines · Han-Wen Nienhuys
I often install tools locally so I can run SVN/CVS/etc versions in my own account. To do this, I install into
Quoted 8 lines
Quoted 1 line
$HOME/usr/pkg/PACKAGE
Why not just set
$ export GIT_EXEC_PATH=$HOME/usr/pkg/git $ export PATH=$PATH:$GIT_EXEC_PATH?
Because it requires brain cycles from my part. I rather spend those constructively.
GIT is the only package I've seen in a long time that breaks this setup.
Here is the patch that I proposed
From 988813912c4c7b310c489bfffa1b81e2663b7b6f Mon Sep 17 00:00:00 2001
From: Han-Wen Nienhuys <[email protected]>
Date: Wed, 6 Dec 2006 13:27:16 +0100
Subject: [PATCH] Install git-sh-setup.sh into $(prefix)/share/git-core. Call with explicit path.
--- Makefile | 10 ++++++++-- git-am.sh | 2 +- git-applymbox.sh | 2 +- git-applypatch.sh | 2 +- git-bisect.sh | 2 +- git-checkout.sh | 2 +- git-clean.sh | 2 +- git-commit.sh | 2 +- git-fetch.sh | 2 +- git-instaweb.sh | 2 +- git-lost-found.sh | 2 +- git-merge.sh | 2 +- git-pull.sh | 2 +- git-quiltimport.sh | 2 +- git-rebase.sh | 2 +- git-repack.sh | 2 +- git-request-pull.sh | 2 +- git-reset.sh | 2 +- git-resolve.sh | 2 +- git-revert.sh | 2 +- git-tag.sh | 2 +- git-verify-tag.sh | 2 +- 22 files changed, 29 insertions(+), 23 deletions(-)
Makefile +8 -2
@@ -116,8 +116,10 @@ STRIP ?= strip prefix = $(HOME) bindir = $(prefix)/bin +datadir = $(prefix)/share +GIT_datadir = $(datadir)/git-core gitexecdir = $(bindir) -template_dir = $(prefix)/share/git-core/templates/ +template_dir = $(GIT_datadir)/templates/ # DESTDIR= # default configuration for gitweb
@@ -166,7 +168,7 @@ SCRIPT_SH = \ git-merge-one-file.sh git-parse-remote.sh \ git-pull.sh git-rebase.sh \ git-repack.sh git-request-pull.sh git-reset.sh \ - git-resolve.sh git-revert.sh git-sh-setup.sh \ + git-resolve.sh git-revert.sh \ git-tag.sh git-verify-tag.sh \ git-applymbox.sh git-applypatch.sh git-am.sh \ git-merge.sh git-merge-stupid.sh git-merge-octopus.sh \
@@ -550,6 +552,7 @@ endif # Shell quote (do not use $(call) to accommodate ancient setups); SHA1_HEADER_SQ = $(subst ','\'',$(SHA1_HEADER)) +GIT_datadir_SQ = $(subst ','\'',$(GIT_datadir)) DESTDIR_SQ = $(subst ','\'',$(DESTDIR)) bindir_SQ = $(subst ','\'',$(bindir))
@@ -604,6 +607,7 @@ $(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \ -e 's|@@PERL@@|$(PERL_PATH_SQ)|g' \ -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \ + -e 's!@@GIT_datadir@@!$(GIT_datadir)!g' \ -e 's/@@NO_CURL@@/$(NO_CURL)/g' \ [email protected] >$@+ chmod +x $@+
@@ -816,6 +820,8 @@ install: all '$(DESTDIR_SQ)$(gitexecdir_SQ)/git$X'; \ fi $(foreach p,$(BUILT_INS), rm -f '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' && ln '$(DESTDIR_SQ)$(gitexecdir_SQ)/git$X' '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' ;) + $(INSTALL) -d -m755 '$(DESTDIR_SQ)$(GIT_datadir_SQ)' + $(INSTALL) -m755 git-sh-setup.sh '$(DESTDIR_SQ)$(GIT_datadir_SQ)' install-doc: $(MAKE) -C Documentation install
git-am.sh +1 -1
@@ -5,7 +5,7 @@ USAGE='[--signoff] [--dotest=<dir>] [--utf8] [--binary] [--3way] [--interactive] [--whitespace=<option>] <mbox>... or, when resuming [--skip | --resolved]' -. git-sh-setup +. @@GIT_datadir@@/git-sh-setup.sh git var GIT_COMMITTER_IDENT >/dev/null || exit
git-applymbox.sh +1 -1
@@ -19,7 +19,7 @@ ## git-am is supposed to be the newer and better tool for this job. USAGE='[-u] [-k] [-q] [-m] (-c .dotest/<num> | mbox) [signoff]' -. git-sh-setup +. @@GIT_datadir@@/git-sh-setup.sh git var GIT_COMMITTER_IDENT >/dev/null || exit
git-applypatch.sh +1 -1
@@ -12,7 +12,7 @@ ## USAGE='<msg> <patch> <info> [<signoff>]' -. git-sh-setup +. @@GIT_datadir@@/git-sh-setup.sh case "$#" in 3|4) ;; *) usage ;; esac
git-bisect.sh +1 -1
@@ -10,7 +10,7 @@ git bisect visualize show bisect status in gitk. git bisect replay <logfile> replay bisection log git bisect log show bisect log.' -. git-sh-setup +. @@GIT_datadir@@/git-sh-setup.sh sq() { @@PERL@@ -e '
git-checkout.sh +1 -1
@@ -2,7 +2,7 @@ USAGE='[-f] [-b <new_branch>] [-m] [<branch>] [<paths>...]' SUBDIRECTORY_OK=Sometimes -. git-sh-setup +. @@GIT_datadir@@/git-sh-setup.sh old_name=HEAD old=$(git-rev-parse --verify $old_name 2>/dev/null)
git-clean.sh +1 -1
@@ -13,7 +13,7 @@ LONG_USAGE='Clean untracked files from the working directory When optional <paths>... arguments are given, the paths affected are further limited to those that match them.' SUBDIRECTORY_OK=Yes -. git-sh-setup +. @@GIT_datadir@@/git-sh-setup.sh ignored= ignoredonly=
git-commit.sh +1 -1
@@ -5,7 +5,7 @@ USAGE='[-a] [-s] [-v] [--no-verify] [-m <message> | -F <logfile> | (-C|-c) <commit>] [-u] [--amend] [-e] [--author <author>] [[-i | -o] <path>...]' SUBDIRECTORY_OK=Yes -. git-sh-setup +. @@GIT_datadir@@/git-sh-setup.sh git-rev-parse --verify HEAD >/dev/null 2>&1 || initial_commit=t branch=$(GIT_DIR="$GIT_DIR" git-symbolic-ref HEAD)
git-fetch.sh +1 -1
@@ -2,7 +2,7 @@ # USAGE='<fetch-options> <repository> <refspec>...' -. git-sh-setup +. @@GIT_datadir@@/git-sh-setup.sh . git-parse-remote _x40='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]' _x40="$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40"
git-instaweb.sh +1 -1
@@ -6,7 +6,7 @@ USAGE='[--start] [--stop] [--restart] [--local] [--httpd=<httpd>] [--port=<port>] [--browser=<browser>] [--module-path=<path> (for Apache2 only)]' -. git-sh-setup +. @@GIT_datadir@@/git-sh-setup.sh case "$GIT_DIR" in /*)
git-lost-found.sh +1 -1
@@ -2,7 +2,7 @@ USAGE='' SUBDIRECTORY_OK='Yes' -. git-sh-setup +. @@GIT_datadir@@/git-sh-setup.sh if [ "$#" != "0" ] then
git-merge.sh +1 -1
@@ -5,7 +5,7 @@ USAGE='[-n] [--no-commit] [--squash] [-s <strategy>] [--reflog-action=<action>] [-m=<merge-message>] <commit>+' -. git-sh-setup +. @@GIT_datadir@@/git-sh-setup.sh LF=' '
git-pull.sh +1 -1
@@ -6,7 +6,7 @@ USAGE='[-n | --no-summary] [--no-commit] [-s strategy]... [<fetch-options>] <repo> <head>...' LONG_USAGE='Fetch one or more remote refs and merge it/them into the current HEAD.' -. git-sh-setup +. @@GIT_datadir@@/git-sh-setup.sh strategy_args= no_summary= no_commit= squash= while case "$#,$1" in 0) break ;; *,-*) ;; *) break ;; esac
git-quiltimport.sh +1 -1
@@ -1,7 +1,7 @@ #!/bin/sh USAGE='--dry-run --author <author> --patches </path/to/quilt/patch/directory>' SUBDIRECTORY_ON=Yes -. git-sh-setup +. @@GIT_datadir@@/git-sh-setup.sh dry_run="" quilt_author=""
git-rebase.sh +1 -1
@@ -27,7 +27,7 @@ Example: git-rebase master~1 topic / --> / D---E---F---G master D---E---F---G master ' -. git-sh-setup +. @@GIT_datadir@@/git-sh-setup.sh RESOLVEMSG=" When you have resolved this problem run \"git rebase --continue\".
git-repack.sh +1 -1
@@ -5,7 +5,7 @@ USAGE='[-a] [-d] [-f] [-l] [-n] [-q] [--window=N] [--depth=N]' SUBDIRECTORY_OK='Yes' -. git-sh-setup +. @@GIT_datadir@@/git-sh-setup.sh no_update_info= all_into_one= remove_redundant= local= quiet= no_reuse_delta= extra=
git-request-pull.sh +1 -1
@@ -8,7 +8,7 @@ USAGE='<commit> <url> [<head>]' LONG_USAGE='Summarizes the changes since <commit> to the standard output, and includes <url> in the message generated.' SUBDIRECTORY_OK='Yes' -. git-sh-setup +. @@GIT_datadir@@/git-sh-setup.sh revision=$1 url=$2
git-reset.sh +1 -1
@@ -1,7 +1,7 @@ #!/bin/sh USAGE='[--mixed | --soft | --hard] [<commit-ish>]' -. git-sh-setup +. @@GIT_datadir@@/git-sh-setup.sh update= reset_type=--mixed
git-resolve.sh +1 -1
@@ -10,7 +10,7 @@ echo 'WARNING: Please use git-merge or git-pull instead.' >&2 sleep 2 USAGE='<head> <remote> <merge-message>' -. git-sh-setup +. @@GIT_datadir@@/git-sh-setup.sh dropheads() { rm -f -- "$GIT_DIR/MERGE_HEAD" \
git-revert.sh +1 -1
@@ -18,7 +18,7 @@ case "$0" in * ) die "What are you talking about?" ;; esac -. git-sh-setup +. @@GIT_datadir@@/git-sh-setup.sh no_commit= while case "$#" in 0) break ;; esac
git-tag.sh +1 -1
@@ -3,7 +3,7 @@ USAGE='-l [<pattern>] | [-a | -s | -u <key-id>] [-f | -d] [-m <msg>] <tagname> [<head>]' SUBDIRECTORY_OK='Yes' -. git-sh-setup +. @@GIT_datadir@@/git-sh-setup.sh message_given= annotate=
git-verify-tag.sh +1 -1
@@ -2,7 +2,7 @@ USAGE='<tag>' SUBDIRECTORY_OK='Yes' -. git-sh-setup +. @@GIT_datadir@@/git-sh-setup.sh verbose= while case $# in 0) break;; esac
Signature · 4 lines
1.4.4.1.gc9922-dirty --
Quoted 1 line · Han-Wen Nienhuys
Subject: [PATCH] Install
git-sh-setup.shinto $(prefix)/share/git-core. Call with explicit path.
I like it... but could you check if you don't need to change config.mak.in accordingly for ./configure script to generate proper config.mak.autogen?
Signature · 3 lines
Jakub Narebski Warsaw, Poland ShadeHawk on #git
Jakub Narebski escreveu:
Quoted 7 lines
Quoted 1 line · Han-Wen Nienhuys
Subject: [PATCH] Install
git-sh-setup.shinto $(prefix)/share/git-core. Call with explicit path.I like it... but could you check if you don't need to change config.mak.in accordingly for ./configure script to generate proper config.mak.autogen?
I couldn't see anything, but while I was looking at it, I also added support for non-srcdir builds. Can someone with a perl clue look over the braindamaged messing-around with perl/perl.mak and figure out why perl insists
make -C perl PERL_PATH='/usr/bin/perl' prefix='/tmp/test' perl.mak
make[1]: Entering directory `/home/lilydev/vc/go2/perl'
'/usr/bin/perl' -I/home/lilydev/vc/g2/perl /home/lilydev/vc/g2/perl/Makefile.PL FIRST_MAKEFILE='perl.mak' PREFIX='/tmp/test' Could not open 'Git.pm': No such file or directory at /usr/lib/perl5/5.8.8/ExtUtils/MM_Unix.pm line 2649.
despite the -I option?
From 7bbd698891d9102fa26ae53848c9812f6d1b665e Mon Sep 17 00:00:00 2001
From: Han-Wen Nienhuys <[email protected]>
Date: Wed, 6 Dec 2006 15:14:08 +0100
Subject: [PATCH] Allow non-srcdir builds using cd $builddir && $srcdir/configure
--- Makefile | 19 +++++++++++-------- config.mak.in | 5 +---- configure.ac | 31 ++++++++++++++++++++++++++++++- generate-cmdlist.sh | 2 +- perl/Makefile | 2 +- 5 files changed, 44 insertions(+), 15 deletions(-)
Makefile +11 -8
@@ -97,7 +97,7 @@ all: # GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE - @$(SHELL_PATH) ./GIT-VERSION-GEN + @$(SHELL_PATH) $(srcdir)/GIT-VERSION-GEN -include GIT-VERSION-FILE uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
@@ -120,7 +120,10 @@ datadir = $(prefix)/share GIT_datadir = $(datadir)/git-core gitexecdir = $(bindir) template_dir = $(GIT_datadir)/templates/ -# DESTDIR= +srcdir = . + +# this is usually set on the make command line. +DESTDIR= # default configuration for gitweb GITWEB_CONFIG = gitweb_config.perl
@@ -598,8 +601,8 @@ git-merge-recur$X: git-merge-recursive$X $(BUILT_INS): git$X rm -f $@ && ln git$X $@ -common-cmds.h: Documentation/git-*.txt - ./generate-cmdlist.sh > $@+ +common-cmds.h: $(wildcard $(srcdir)/Documentation/git-*.txt) + $(srcdir)/generate-cmdlist.sh $(srcdir)/Documentation/ > $@+ mv $@+ $@ $(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh
@@ -609,7 +612,7 @@ $(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \ -e 's!@@GIT_datadir@@!$(GIT_datadir)!g' \ -e 's/@@NO_CURL@@/$(NO_CURL)/g' \ - [email protected] >$@+ + $^ >$@+ chmod +x $@+ mv $@+ $@
@@ -630,7 +633,7 @@ $(patsubst %.perl,%,$(SCRIPT_PERL)): % : %.perl -e '}' \ -e 's|@@INSTLIBDIR@@|'"$$INSTLIBDIR"'|g' \ -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \ - [email protected] >$@+ + $^ >$@+ chmod +x $@+ mv $@+ $@
@@ -674,7 +677,7 @@ git-instaweb: git-instaweb.sh gitweb/gitweb.cgi gitweb/gitweb.css -e '/@@GITWEB_CGI@@/d' \ -e '/@@GITWEB_CSS@@/r gitweb/gitweb.css' \ -e '/@@GITWEB_CSS@@/d' \ - [email protected] > $@+ + $< > $@+ chmod +x $@+ mv $@+ $@
@@ -821,7 +824,7 @@ install: all fi $(foreach p,$(BUILT_INS), rm -f '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' && ln '$(DESTDIR_SQ)$(gitexecdir_SQ)/git$X' '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' ;) $(INSTALL) -d -m755 '$(DESTDIR_SQ)$(GIT_datadir_SQ)' - $(INSTALL) -m755 git-sh-setup.sh '$(DESTDIR_SQ)$(GIT_datadir_SQ)' + $(INSTALL) -m755 $(srcdir)/git-sh-setup.sh '$(DESTDIR_SQ)$(GIT_datadir_SQ)' install-doc: $(MAKE) -C Documentation install
config.mak.in +1 -4
@@ -2,7 +2,7 @@ # @configure_input@ CC = @CC@ -CFLAGS = @CFLAGS@ +CFLAGS = @CFLAGS@ -I. AR = @AR@ TAR = @TAR@ #INSTALL = @INSTALL@ # needs install-sh or install.sh in sources
@@ -10,9 +10,6 @@ TAR = @TAR@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ -#gitexecdir = @libexecdir@/git-core/ -datarootdir = @datarootdir@ -template_dir = @datadir@/git-core/templates/ mandir=@mandir@
configure.ac +30 -1
@@ -5,11 +5,13 @@ AC_PREREQ(2.59) AC_INIT([git], [@@GIT_VERSION@@], [[email protected]]) AC_CONFIG_SRCDIR([git.c]) - +srcdir=`cd $srcdir && pwd` config_file=config.mak.autogen config_append=config.mak.append config_in=config.mak.in + + echo "# ${config_append}. Generated by configure." > "${config_append}"
@@ -330,10 +332,37 @@ GIT_PARSE_WITH(iconv)) # change being considered an inode change from the update-cache perspective. + + + ## Output files AC_CONFIG_FILES(["${config_file}":"${config_in}":"${config_append}"]) AC_OUTPUT + +## generate subdirectories and sub Makefiles. +for d in `cd $srcdir && find . -type d -print | grep -v '\.git'` ; +do + if test ! -d $d ; then + echo creating $d + mkdir $d + fi + + if test -f $srcdir/$d/Makefile ; then + + dnl [[]] is to keep m4 happy + depth=`echo $d/ | sed -e 's!^\./!!g' -e 's![[^/]]*/!../!g'` + echo creating $d/Makefile + cat << EOF > $d/Makefile +include ${depth}config.mak.autogen +here-srcdir=\$(srcdir)/$d/ +VPATH=\$(here-srcdir) +include \$(here-srcdir)/Makefile +EOF + + fi +done +exit 1 ## Cleanup rm -f "${config_append}"
generate-cmdlist.sh +1 -1
@@ -47,6 +47,6 @@ do x s/.*git-'"$cmd"' - \(.*\)/ {"'"$cmd"'", "\1"},/ p - }' "Documentation/git-$cmd.txt" + }' "$1/git-$cmd.txt" done echo "};"
perl/Makefile +1 -1
@@ -29,7 +29,7 @@ $(makfile): ../GIT-CFLAGS Makefile echo ' echo $(instdir_SQ)' >> $@ else $(makfile): Makefile.PL ../GIT-CFLAGS - '$(PERL_PATH_SQ)' $< FIRST_MAKEFILE='$@' PREFIX='$(prefix_SQ)' + '$(PERL_PATH_SQ)' -I$(srcdir)/perl $< FIRST_MAKEFILE='$@' PREFIX='$(prefix_SQ)' endif # this is just added comfort for calling make directly in perl dir
Signature · 7 lines
1.4.4.1.gc9922-dirty -- Han-Wen Nienhuys - [email protected] - http://www.xs4all.nl/~hanwen
Han-Wen Nienhuys wrote::
Quoted 11 lines
Jakub Narebski escreveu:
Quoted 7 lines
Quoted 1 line · Han-Wen Nienhuys
Subject: [PATCH] Install
git-sh-setup.shinto $(prefix)/share/git-core. Call with explicit path.I like it... but could you check if you don't need to change config.mak.in accordingly for ./configure script to generate proper config.mak.autogen?
I couldn't see anything, but while I was looking at it, I also added support for non-srcdir builds.
[...]
Quoted 4 lines
From
7bbd698891d9102fa26ae53848c9812f6d1b665eMon Sep 17 00:00:00 2001
From: Han-Wen Nienhuys <[email protected]>
Date: Wed, 6 Dec 2006 15:14:08 +0100
Subject: [PATCH] Allow non-srcdir builds using cd $builddir && $srcdir/configure
Please add some longer commit message.
Quoted 8 lines
Signed-off-by Han-Wen Nienhuys <[email protected]>--- Makefile | 19 +++++++++++-------- config.mak.in | 5 +---- configure.ac | 31 ++++++++++++++++++++++++++++++- generate-cmdlist.sh | 2 +- perl/Makefile | 2 +- 5 files changed, 44 insertions(+), 15 deletions(-)
[...]
Quoted 4 lines
config.mak.in +0
-0
[...]
config.mak.in TAR = @TAR@ · line 14
Quoted 9 lines
config.mak.in +0
-3@@ -10,9 +10,6 @@ TAR = @TAR@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ -#gitexecdir = @libexecdir@/git-core/ -datarootdir = @datarootdir@ -template_dir = @datadir@/git-core/templates/ mandir=@mandir@
Why have you removed setting datarootdir and template_dir? I would have thought that you would rather change it to
#gitexecdir = @libexecdir@/git-core/
datarootdir = @datarootdir@
GIT_datadir = @datadir@/git-core/
template_dir= @datadir@/git-core/templates/
in config.mak.in
I have been told that setting 'datarootdir' is required to avoid warnings with new versions of autoconf.
configure.ac AC_PREREQ(2.59) · line 10
Quoted 12 lines
configure.ac +1
-1@@ -5,11 +5,13 @@ AC_PREREQ(2.59) AC_INIT([git], [@@GIT_VERSION@@], [[email protected]]) AC_CONFIG_SRCDIR([git.c]) - +srcdir=`cd $srcdir && pwd` config_file=config.mak.autogen config_append=config.mak.append
AC_CONFIG_SRCDIR should set 'srcdir' correctly.
Quoted 1 line
configure.ac +0
-0@@ -330,10 +332,37 @@ GIT_PARSE_WITH(iconv))
[...]
Quoted 13 lines
configure.ac +13
-0+## generate subdirectories and sub Makefiles. +for d in `cd $srcdir && find . -type d -print | grep -v '\.git'` ; +do + if test ! -d $d ; then + echo creating $d + mkdir $d + fi + + if test -f $srcdir/$d/Makefile ; then + + dnl [[]] is to keep m4 happy + depth=`echo $d/ | sed -e 's!^\./!!g' -e 's![[^/]]*/!../!g'` + echo creating $d/Makefile
configure.ac GIT_PARSE_WITH(iconv)) · line 365
Quoted 10 lines
configure.ac +10
-0+ cat << EOF > $d/Makefile +include ${depth}config.mak.autogen +here-srcdir=\$(srcdir)/$d/ +VPATH=\$(here-srcdir) +include \$(here-srcdir)/Makefile +EOF + + fi +done +exit 1
What is this for? The ./configure script, generated by autoconf from configure.ac (by "make configure"), generates config.mak.autogen file from config.mak.in, which is included in main (top) Makefile.
The variables defined in config.mak.autogen are of course visible in make in subdirectories (make invoked from main makefile). Why the change? What about user-generated config.mak?
This part IMHO has no sense, and has no place here.
Signature · 1 line
Jakub Narebski
Jakub Narebski escreveu:
Quoted 1 line
Please add some longer commit message.
do you have any specifics you would like me to mention?
Quoted 11 lines
config.mak.in TAR = @TAR@ · line 14
Quoted 7 lines
exec_prefix= @exec_prefix@
bindir = @bindir@config.mak.in +0
-3-#gitexecdir = @libexecdir@/git-core/ -datarootdir = @datarootdir@ -template_dir = @datadir@/git-core/templates/ mandir=@mandir@Why have you removed setting datarootdir and
template_dir? I would have thought that you would rather change it to
Quoted 4 lines
#gitexecdir = @libexecdir@/git-core/
datarootdir = @datarootdir@
GIT_datadir= @datadir@/git-core/
template_dir= @datadir@/git-core/templates/
The Makefile already has this code, so adding it here is duplication of work and code.
If you think putting code in the generated file is a good idea, I propose we just generate the entire Makefile, as is the standard usage for autoconf.
Quoted 19 lines
Quoted 19 lines
configure.ac +19
-0+## generate subdirectories and sub Makefiles. +for d in `cd $srcdir && find . -type d -print | grep -v '\.git'` ; +do + if test ! -d $d ; then + echo creating $d + mkdir $d + fi + + if test -f $srcdir/$d/Makefile ; then + + dnl [[]] is to keep m4 happy + depth=`echo $d/ | sed -e 's!^\./!!g' -e 's![[^/]]*/!../!g'` + echo creating $d/Makefile + cat << EOF > $d/Makefile +include ${depth}config.mak.autogen +here-srcdir=\$(srcdir)/$d/ +VPATH=\$(here-srcdir) +include \$(here-srcdir)/Makefile +EOF
Quoted 8 lines
configure.ac GIT_PARSE_WITH(iconv)) · line 365
Quoted 4 lines
configure.ac +4
-0+ + fi +done +exit 1What is this for? The ./configure script, generated by autoconf from configure.ac (by "make configure"), generates config.mak.autogen file from config.mak.in, which is included in main (top)
Makefile.
in some cases, the files can also be called stand alone, eg.
[lilydev@haring perl]$ pwd
/home/lilydev/vc/git/perl
[lilydev@haring perl]$ make
make -f perl.mak all
make[1]: Entering directory /home/lilydev/vc/git/perl' make[1]: Leaving directory /home/lilydev/vc/git/perl'
The above Makefile generation makes sure that this behavior is mirrored in the builddir. Also, I'm not sure if the vpath settings get exported automatically.
Having multiple Makefiles in the builddir is the standard behavior for autotool'ed packages.
Quoted 3 lines
The variables defined in config.mak.autogen are of course visible in make in subdirectories (make invoked from main makefile). Why the change? What about user-generated config.mak?
good point. I'll include it too.
Quoted 1 line
This part IMHO has no sense, and has no place here.
Quoted 5 lines · Han-Wen Nienhuys
Jakub Narebski escreveu:
Quoted 1 line
Please add some longer commit message.
do you have any specifics you would like me to mention?
More detailed description what "Allow non-srcdir builds using cd $builddir && $srcdir/configure" mean and why we might want to do that.
For example:
We might want to build git from outside source directory. For this we need...
By the way, I think this patch is about _two_ changes. Allow to build outside source directory, by providing srcdir AND separate change to allow builds of separate parts of git, with separate Makefile, to include user-generated configuration file config.mak and ./configure generated config.mak.autogen configuration file.
Shouldn't this patch be split into two?
Quoted 11 lines
Quoted 11 lines
config.mak.in TAR = @TAR@ · line 14
Quoted 7 lines
exec_prefix= @exec_prefix@
bindir = @bindir@config.mak.in +0
-3-#gitexecdir = @libexecdir@/git-core/ -datarootdir = @datarootdir@ -template_dir = @datadir@/git-core/templates/ mandir=@mandir@Why have you removed setting datarootdir and
template_dir? I would have thought that you would rather change it to
Quoted 7 lines
Quoted 4 lines
#gitexecdir = @libexecdir@/git-core/
datarootdir = @datarootdir@
GIT_datadir= @datadir@/git-core/
template_dir= @datadir@/git-core/templates/The
Makefilealready has this code, so adding it here is duplication of work and code.
Good call. Well, at least now, when ./configure script doesn't provide means to change template_dir etc. from command line, via options.
Still I think that at least
datarootdir = @datarootdir@
should be not removed.
Quoted 3 lines
If you think putting code in the generated file is a good idea, I propose we just generate the entire
Makefile, as is the standard usage for autoconf.
The stance on autoconf is that it has to be _optional_ part of compilation. And I think it does good job of this.
Quoted 38 lines
Quoted 19 lines
Quoted 19 lines
configure.ac +19
-0+## generate subdirectories and sub Makefiles. +for d in `cd $srcdir && find . -type d -print | grep -v '\.git'` ; +do + if test ! -d $d ; then + echo creating $d + mkdir $d + fi + + if test -f $srcdir/$d/Makefile ; then + + dnl [[]] is to keep m4 happy + depth=`echo $d/ | sed -e 's!^\./!!g' -e 's![[^/]]*/!../!g'` + echo creating $d/Makefile + cat << EOF> $d/Makefile +include ${depth}config.mak.autogen +here-srcdir=\$(srcdir)/$d/ +VPATH=\$(here-srcdir) +include \$(here-srcdir)/Makefile +EOFQuoted 8 lines
configure.ac GIT_PARSE_WITH(iconv)) · line 365
Quoted 4 lines
configure.ac +4
-0+ + fi +done +exit 1What is this for? The ./configure script, generated by autoconf from configure.ac (by "make configure"), generates config.mak.autogen file from config.mak.in, which is included in main (top)
Makefile.in some cases, the files can also be called stand alone, eg.
[lilydev@haring perl]$ pwd
/home/lilydev/vc/git/perl[lilydev@haring perl]$ make
make -f perl.mak all
make[1]: Entering directory/home/lilydev/vc/git/perl' make[1]: Leaving directory/home/lilydev/vc/git/perl'
Quoted 6 lines
The above
Makefilegeneration makes sure that this behavior is mirrored in the builddir. Also, I'm not sure if the vpath settings get exported automatically.Having multiple Makefiles in the builddir is the standard behavior for autotool'ed packages.
Git is not autotool'ed package. Autoconf is used only for _optional_ compile and installation configuration.
Quoted 7 lines
Quoted 3 lines
The variables defined in config.mak.autogen are of course visible in make in subdirectories (make invoked from main makefile). Why the change? What about user-generated config.mak?
good point. I'll include it too.
Quoted 1 line
This part IMHO has no sense, and has no place here.
If you want to create or modify Makefiles, do that. Not generate "minimal" Makefiles in every and each subdirectory.
You would be able to compile git fully only from top directory. So what?
Signature · 1 line
Jakub Narebski
Jakub Narebski escreveu:
Quoted 5 lines
Still I think that at least
datarootdir = @datarootdir@
should be not removed.
yes, agreed.
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
+ if test -f $srcdir/$d/Makefile ; then
[..]
Quoted 7 lines
Quoted 4 lines
Quoted 4 lines
Review
Quoted 2 lines
(quoted diff) +2
-0+ echo creating $d/Makefile + cat << EOF> $d/MakefileThis part IMHO has no sense, and has no place here.
If you want to create or modify Makefiles, do that. Not generate "minimal" Makefiles in every and each subdirectory.
Look more closely at the patch. It only generates Makefiles in directories that have makefiles in the source dir. The makefiles are short because that is the easiest to do.
I'm happy to amend the patch, bUt I can't properly test it until the perl problem gets sorted out.
Signature · 1 line
Han-Wen Nienhuys - [email protected] - http://www.xs4all.nl/~hanwen
Quoted 1 line · Han-Wen Nienhuys
Jakub Narebski escreveu:
[...]
Quoted 5 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
+ if test -f $srcdir/$d/Makefile ; then
[..]
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
(quoted diff) +2
-0+ echo creating $d/Makefile + cat << EOF> $d/Makefile
Quoted 8 lines
Quoted 4 lines
Quoted 1 line
Quoted 1 line
This part IMHO has no sense, and has no place here.
If you want to create or modify Makefiles, do that. Not generate "minimal" Makefiles in every and each subdirectory.
Look more closely at the patch. It only generates Makefiles in directories that have makefiles in the source dir. The makefiles are short because that is the easiest to do.
The fact that I didn't understood what this part of patch is meant to do should be the big hint that this commit needs some longer commit message explaining purpose of such mess.
I still don't understand what this part do (and how come it is in configure.ac which should be _only_ about generating config.mak.autogen Makefile configuration file and _not_ about generating Makefiles). You want what sequence of commands to work?
$ $srcdir/configure --srcdir=$srcdir $ make -D $srcdir $ make -D $srcdir DESTDIR=$DESTDIR install
or what? Why this part is needed?
Once again: git is NOT autotool'ed project. And shouldn't be.
Quoted 2 lines
I'm happy to amend the patch, but I can't properly test it until the perl problem gets sorted out.
I'll be waiting.
Signature · 1 line
Jakub Narebski
Jakub Narebski escreveu:
Quoted 4 lines
The fact that I didn't understood what this part of patch is meant to do should be the big hint that this commit needs some longer commit message explaining purpose of such mess.
Quoted 8 lines
I still don't understand what this part do (and how come it is in configure.ac which should be _only_ about generating config.mak.autogen
Makefileconfiguration file and _not_ about generating Makefiles). You want what sequence of commands to work?$ $srcdir/configure --srcdir=$srcdir $ make -D $srcdir $ make -D $srcdir DESTDIR=$DESTDIR install
make -D doesn't exist.
This is about
mkdir git-build
cd git-build
$my_git_source/configure
make
this _was_ actually documented in that one-line commit message, that you found to be too short.
Since git does recursive makes, among others in
perl/
Documentation/
templates/
contrib/
there should be Makefiles in said directories. Otherwise, every rule in the toplevel Makefile saying
$(MAKE) -C subdir/
will fail because $builddir/ does not have a Makefile in $builddir/subdir.
The part you don't understand is a generic way of duplicating the Makefiles from the git sources, while making sure that they work when $srcdir != $builddir
Yes, if builddir != srcdir , then configure is about more than generating config.mak.autogen
Quoted 11 lines · Han-Wen Nienhuys
Jakub Narebski escreveu:
Quoted 9 lines
The fact that I didn't understood what this part of patch is meant to do should be the big hint that this commit needs some longer commit message explaining purpose of such mess.
I still don't understand what this part do (and how come it is in configure.ac which should be _only_ about generating config.mak.autogen
Makefileconfiguration file and _not_ about generating Makefiles). You want what sequence of commands to work?
Quoted 5 lines
Quoted 3 lines
$ $srcdir/configure --srcdir=$srcdir $ make -D $srcdir $ make -D $srcdir DESTDIR=$DESTDIR installmake -D doesn't exist.
Oops. I meant make -C, not make -D.
Quoted 9 lines
This is about
mkdir git-build
cd git-build
$my_git_source/configure
makethis _was_ actually documented in that one-line commit message, that you found to be too short.
Because it was so short (one line) while being long for one line. Why don't you write above in commit message?
Quoted 7 lines
Since git does recursive makes, among others in
perl/
Documentation/
templates/
contrib/
Quoted 8 lines
there should be Makefiles in said directories. Otherwise, every rule in the toplevel
Makefilesaying$(MAKE) -C subdir/will fail because $builddir/ does not have a
Makefilein $builddir/subdir.
Wouldn't it be better just to modify toplevel Makefile to say:
$(MAKE) -C $(srcdir)/subdir/
without messing with ./configure script, and creating "redirect" Makefiles?
Quoted 7 lines
The part you don't understand is a generic way of duplicating the Makefiles from the git sources, while making sure that they work when $srcdir != $builddir
Yes, if builddir != srcdir , then configure is about more than generating config.mak.autogen
Once again: git is not autotool'ed project. Everything you want to do should work regardless if you would run ./configure, or if you would hand-craft config.mak file.
Signature · 1 line
Jakub Narebski
Jakub Narebski escreveu:
Quoted 9 lines
Quoted 8 lines
there should be Makefiles in said directories. Otherwise, every rule in the toplevel
Makefilesaying$(MAKE) -C subdir/will fail because $builddir/ does not have a
Makefilein $builddir/subdir.
Quoted 7 lines
Wouldn't it be better just to modify toplevel
Makefileto say:$(MAKE) -C $(srcdir)/subdir/without messing with ./configure script, and creating "redirect" Makefiles?
that doesn't work.
make -C foo bla
just does
(cd foo && make bla)
If you did this, part of the object files would end up in the source dir; The idea of separate srcdir builds,is to keep the srcdir completely clean of generated files. That can't really be done without aid of a script, to setup the builddir. In this case that is the configure script.
I did forget to add a check
if "$srcdir" != "." ; then
..
fi
around the messy stuff.
Signature · 1 line
Han-Wen Nienhuys - [email protected] - http://www.xs4all.nl/~hanwen
Quoted 23 lines · Han-Wen Nienhuys
Jakub Narebski escreveu:
Quoted 9 lines
Quoted 8 lines
there should be Makefiles in said directories. Otherwise, every rule in the toplevel
Makefilesaying$(MAKE) -C subdir/will fail because $builddir/ does not have a
Makefilein $builddir/subdir.Quoted 7 lines
Wouldn't it be better just to modify toplevel
Makefileto say:$(MAKE) -C $(srcdir)/subdir/without messing with ./configure script, and creating "redirect" Makefiles?
that doesn't work.
make -C foo bla
Quoted 8 lines
just does
(cd foo && make bla)If you did this, part of the object files would end up in the source dir; The idea of separate srcdir builds,is to keep the srcdir completely clean of generated files. That can't really be done without aid of a script, to setup the builddir. In this case that is the configure script.
Thanks for an explanation. At least some of it should be in commit message, to explain what you want the patch to do.
I don't know autotools enough to check if autotools (autoconf) doesn't have it's own way to do this, some autoconf macro, to not need to write this script creating redirect Makefiles.
I'm still not sure if this has place in git. Is it really common to support building outside source directory? If git didn't support this, so what?
Signature · 1 line
Jakub Narebski
Jakub Narebski escreveu:
Quoted 3 lines
I'm still not sure if this has place in git. Is it really common to support building outside source directory? If git didn't support this, so what?
lots of serious tools support it, as it this comes automatically when using automake. Eg. emacs, gcc, make, pango, lilypond, etc etc.
It's a quite standard feature ; you should be asking why git shouldn't support it.
Another option is to make a special solution based on makefiles, so make is run inside the srcdir, but output shunted output to a separate objects/ subdirectory. However, it's more work, and less standardized.
Quoted 11 lines · Han-Wen Nienhuys
Jakub Narebski escreveu:
Quoted 3 lines
I'm still not sure if this has place in git. Is it really common to support building outside source directory? If git didn't support this, so what?
lots of serious tools support it, as it this comes automatically when using automake. Eg. emacs, gcc, make, pango, lilypond, etc etc.
It's a quite standard feature ; you should be asking why git shouldn't support it.
Because git is not autotool'ed project. And people protested vehemently against adding yet another dependency. So from the whole autotools suite only autoconf is used, and only to generate config.mak.autogen Makefile configuration, which otherwise would be needed to be generated by hand.
BTW git tries to guess configuration based on uname -a result.
There was also for a little while hand-generated configure script, but it got abandoned when it appeared that it is hard to be portable (and autoconf did the work; perhaps too hard but did, not using features which weren't common but now are in standard, but did), and the fact that it was possible to have _optional_ autoconf support.
Add to that the fact that people said that ./configure on Cygwin is slow (can be slow), so they prefer _not_ to run this.
Besides, the fact that some tools suport some feature is not the reason to add it. You have to look at how often is this feature _used_. For example you don't need it (you need only DESTDIR support) for creating RPMS from sources.
Signature · 1 line
Jakub Narebski
Quoted 7 lines · Han-Wen Nienhuys
Since git does recursive makes, among others in
perl/
Documentation/
templates/
contrib/
Quoted 9 lines
there should be Makefiles in said directories. Otherwise, every rule in the toplevel
Makefilesaying$(MAKE) -C subdir/will fail because $builddir/ does not have a
Makefilein $builddir/subdir.
This part should have been in the commit message, possibly without the "among others ... (examples)" and possibly with an added "This patch makes it so by letting fnurg create them through smurfing the frotz".
Signature · 2 lines
Andreas Ericsson [email protected] OP5 AB www.op5.se