[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Enable use of older two part flavor 'git describe'.
From: |
Jim Meyering |
Subject: |
Re: [PATCH] Enable use of older two part flavor 'git describe'. |
Date: |
Thu, 21 Feb 2008 09:37:27 +0100 |
FYI, I've just pushed the following patch.
Bob found that it is required to work around a relatively obscure
problem you'd see only when trying to bootstrap the autotools tool chain
with only the relatively old git-1.4.4.4 installed (debian unstable).
The problem was that your built-from-sources autoconf would end up with
a version string like 2.61a-ab8fd, which is not of the usual M.N.O-hhhhhh form.
That difference is due to the way older "git describe" works.
It doesn't include the commit-number.
That would then cause trouble with m4's configure.ac, which does this:
AC_PREREQ([2.61a.347])
So Bob fixed git-version-gen to do the right thing,
even with older versions of git.
Here's this patch:
address@hidden (Bob Proulx) wrote:
> Jim,
>
> This appears to allow git-version-gen to handle either the old or the
> new git describe format. Using this in gnulib allows m4 to build
> using the latest autoconf which was checked out using the older git.
>
> Bob
>
>
> diff --git a/ChangeLog b/ChangeLog
> index 1c052ac..b5e537d 100644
> --- a/ChangeLog
> +++ b/ChangeLog
> @@ -1,3 +1,10 @@
> +2008-02-20 Bob Proulx <address@hidden>
> +
> + Enable use of older two part flavor 'git describe'.
> + * build-aux/git-version-gen: If using the older two part flavor of
> + git version then recreate the third part now present in the
> + newer three part flavor of git describe.
> +
> 2008-02-20 Martin Buchholz <address@hidden> (tiny change)
>
> * lib/fts.c (fts_build): Typo correction to comment.
> diff --git a/build-aux/git-version-gen b/build-aux/git-version-gen
> index 1d58adc..1a00107 100755
> --- a/build-aux/git-version-gen
> +++ b/build-aux/git-version-gen
> @@ -59,6 +59,23 @@ elif test -d .git \
> *) (exit 1) ;;
> esac
> then
> + # Is this a new git that lists number of commits since the last
> + # tag or the previous older version that did not?
> + # Newer: v6.10-77-g0f8faeb
> + # Older: v6.10-g0f8faeb
> + case $v in
> + *-*-*) : git describe is okay three part flavor ;;
> + *-*)
> + : git describe is older two part flavor
> + # Recreate the number of commits and rewrite such that the
> + # result is the same as if we were using the newer version
> + # of git describe.
> + vtag=`echo "$v" | sed 's/-.*//'`
> + numcommits=`git rev-list "$vtag"..HEAD | wc -l`
> + v=`echo "$v" | sed "s/\(.*\)-\(.*\)/\1-$numcommits-\2/"`;
> + ;;
> + esac
> +
> # Change the first '-' to a '.', so version-comparing tools work
> properly.
> # Remove the "g" in git describe's output string, to save a byte.
> v=`echo "$v" | sed 's/-/./;s/\(.*\)-g/\1-/'`;
- Re: [PATCH] Enable use of older two part flavor 'git describe'.,
Jim Meyering <=