[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gnulib bootstrap and git submodules

From: Eric Blake
Subject: Re: gnulib bootstrap and git submodules
Date: Wed, 17 Feb 2010 13:20:24 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20090812 Thunderbird/ Mnenhy/

According to Paolo Bonzini on 2/17/2010 10:10 AM:
> On 02/17/2010 02:57 PM, Eric Blake wrote:
> > Any objections?
> Where is the patch?

Here's my first cut at it.  Beware that it is a slight semantic change
from Jim's commit 9efa515ce last November; but I actually prefer my
semantics.  With Jim's semantics and with GNULIB_SRCDIR set in my
environment, the mere act of running ./bootstrap was giving me dirty trees
because .gitmodules was modified; I ended up having to run 'env -u
GNULIB_SRCDIR ./bootstrap' in projects that were using variants of
gnulib's bootstrap.  Also, remember that you have to actually copy the
updated bootstrap into your project to benefit from the change (for
example, I noticed that coreutils' copy of bootstrap has several unrelated
differences compared to gnulib's copy).

But I won't push without more feedback, particularly if Jim has an
argument of why to keep his semantics, or if we need to introduce some
alternate means of supporting his intent of quickly testing a one-off grab
from the latest and greatest local copy of gnulib rather than the
configured commit and location stored in .gitmodules.

From: Eric Blake <address@hidden>
Date: Wed, 17 Feb 2010 11:42:16 -0700
Subject: [PATCH] bootstrap: use GNULIB_SRCDIR to reduce disk usage

This slightly changes the semantics of GNULIB_SRCDIR; previously,
it was a way to change the contents of .gitmodules to actually
point to a new location, which meant that running:
 GNULIB_SRCDIR=~/gnulib ./bootstrap
would result in a dirty tree.  The new semantics are nicer; the
submodule is cloned as normal, but the clone uses the original
$GNULIB_SRCDIR as an object reference to reduce download time
and disk space, all without modifying .gitmodules.  And you can
continue to use proj/.git/config to override proj/.gitmodules,
if you don't like pulling from the canonical upstream.

* build-aux/bootstrap (GNULIB_SRCDIR): If set, use as a reference,
rather than reconfiguring where the submodule points.

Signed-off-by: Eric Blake <address@hidden>
 ChangeLog           |    6 ++++++
 build-aux/bootstrap |   10 +++-------
 2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index c240412..d5eec63 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-02-17  Eric Blake  <address@hidden>
+       bootstrap: use GNULIB_SRCDIR to reduce disk usage
+       * build-aux/bootstrap (GNULIB_SRCDIR): If set, use as a reference,
+       rather than reconfiguring where the submodule points.
 2009-11-17  Eric Blake  <address@hidden>

        manywarnings: add more warnings
diff --git a/build-aux/bootstrap b/build-aux/bootstrap
index 0fb0ac5..1595d1b 100755
--- a/build-aux/bootstrap
+++ b/build-aux/bootstrap
@@ -43,7 +43,7 @@ Options:
                           sources reside.  Use this if you already
                           have gnulib sources on your machine, and
                           do not want to waste your bandwidth downloading
-                          them again.
+                          them again.  Defaults to \$GNULIB_SRCDIR.
  --copy                   Copy files instead of creating symbolic links.
  --force                  Attempt to bootstrap even if the sources seem
                           not to have been checked out.
@@ -421,15 +421,11 @@ case ${GNULIB_SRCDIR--} in
-  # Redirect the gnulib submodule to the directory on the command line
-  # if possible.
+  # Use GNULIB_SRCDIR as a reference.  Assumes git 1.6.4 or newer.
   if test -d "$GNULIB_SRCDIR"/.git && \
         git_modules_config submodule.gnulib.url >/dev/null; then
-    git submodule init
-    git_modules_config --replace-all submodule.gnulib.url $GNULIB_SRCDIR
     echo "$0: getting gnulib files..."
-    git submodule update || exit $?
+    git submodule update --init --reference "$GNULIB_SRCDIR" gnulib ||
exit $?

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]