fix git describe for 2009 vintage git!

This commit is contained in:
Dirk Koopman 2021-12-12 18:20:03 +00:00
parent 58dc48be20
commit c42b114fbe
2 changed files with 4 additions and 2 deletions

View File

@ -1,3 +1,5 @@
12Dec21=======================================================================
1. fix git describe et al AGAIN to cope with (very) old (2009) git versions.
11Dec21=======================================================================
1. Removed dependency on perl Git package.
2. Fixed errors caused by change 1 (use git -C $root to force .git location).

View File

@ -407,7 +407,7 @@ if (DXSql::init($dsn)) {
# determine the real Git build number and branch
my $desc;
eval {$desc = `git -C $root describe --long`};
eval {$desc = `git --git-dir=$root/.git describe --long`};
if (!$@ && $desc) {
my ($v, $s, $b, $g) = $desc =~ /^([\d\.]+)(?:\.(\d+))?-(\d+)-g([0-9a-f]+)/;
$version = $v;
@ -418,7 +418,7 @@ if (DXSql::init($dsn)) {
if (!$@) {
my @branch;
eval {@branch = `git -C $root branch`};
eval {@branch = `git --git-dir=$root/.git branch`};
unless ($@) {
for (@branch) {
my ($star, $b) = split /\s+/;