From 1471b392928431e2b19f7e5aaef6aad9f84babfe Mon Sep 17 00:00:00 2001 From: upstream svn Date: Mon, 26 Jan 2015 00:51:09 +0000 Subject: [PATCH] Support older git version in configure As it turns out the "-C" option was quite recently added to git, older versions don't understand it. Use an approach that old versions can also understand. --- .svn-revision | 2 +- configure | 10 +++++----- configure.in | 10 +++++----- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.svn-revision b/.svn-revision index 910636e8..d37efe25 100644 --- a/.svn-revision +++ b/.svn-revision @@ -1 +1 @@ -10867 +10868 diff --git a/configure b/configure index b76134b4..990a0887 100755 --- a/configure +++ b/configure @@ -15803,14 +15803,14 @@ elif test -d "$srcdir"/.svn; then svndate="rev. `svnversion "$srcdir" | ${SED} -e 'h;s/[0-9][0-9]*:\(.*\)/\1/;s/\([0-9][0-9]*\).*/\1/;x;/.*M.*/{x;s/$/+/;b;};x'`" elif test -d "$srcdir"/.git; then - git_revision=`git -C "$srcdir" log --max-count=1 --pretty='tformat:%h'` - if test -n "`git -C "$srcdir" status --porcelain --untracked-files=no`" ; then + git_revision=`git --git-dir="$srcdir"/.git log --max-count=1 --pretty='tformat:%h'` + if test -n "`git --git-dir="$srcdir"/.git --work-tree="$srcdir" status --porcelain --untracked-files=no`" ; then modified="+" fi if test -f $srcdir/.git/svn/.metadata ; then - git_sha=`git -C "$srcdir" log --max-count=1 --pretty='tformat:%H'` - svndate=`git -C "$srcdir" rev-list ${git_sha} | while read sha; do - svn_revision=\`git -C "$srcdir" svn find-rev \${sha}\` + git_sha=`git --git-dir="$srcdir"/.git log --max-count=1 --pretty='tformat:%H'` + svndate=`git --git-dir="$srcdir"/.git rev-list ${git_sha} | while read sha; do + svn_revision=\`git --git-dir="$srcdir"/.git svn find-rev \${sha}\` if test -n "\${svn_revision}" ; then if test \${sha} = ${git_sha} ; then echo "rev. \${svn_revision}${modified}" diff --git a/configure.in b/configure.in index a7e520c9..466a6a1e 100644 --- a/configure.in +++ b/configure.in @@ -384,14 +384,14 @@ dnl SVNDATE for Subversion checkouts dnl SVNDATE for git/git-svn clones [test -d "$srcdir"/.git], [ - git_revision=`git -C "$srcdir" log --max-count=1 --pretty='tformat:%h'` - if test -n "`git -C "$srcdir" status --porcelain --untracked-files=no`" ; then + git_revision=`git --git-dir="$srcdir"/.git log --max-count=1 --pretty='tformat:%h'` + if test -n "`git --git-dir="$srcdir"/.git --work-tree="$srcdir" status --porcelain --untracked-files=no`" ; then modified="+" fi if test -f $srcdir/.git/svn/.metadata ; then - git_sha=`git -C "$srcdir" log --max-count=1 --pretty='tformat:%H'` - svndate=`git -C "$srcdir" rev-list ${git_sha} | while read sha; do - svn_revision=\`git -C "$srcdir" svn find-rev \${sha}\` + git_sha=`git --git-dir="$srcdir"/.git log --max-count=1 --pretty='tformat:%H'` + svndate=`git --git-dir="$srcdir"/.git rev-list ${git_sha} | while read sha; do + svn_revision=\`git --git-dir="$srcdir"/.git svn find-rev \${sha}\` if test -n "\${svn_revision}" ; then if test \${sha} = ${git_sha} ; then echo "rev. \${svn_revision}${modified}" -- 2.11.4.GIT