Re: patch: version_stamp.pl: Add Git commit info to version if 'git' is specified

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Øyvind A(dot) Holm <sunny(at)sunbase(dot)org>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: patch: version_stamp.pl: Add Git commit info to version if 'git' is specified
Date: 2015-08-28 03:46:51
Message-ID: 4205.1440733611@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

=?utf-8?Q?=C3=98yvind_A=2E?= Holm <sunny(at)sunbase(dot)org> writes:
> this is a patch for src/tools/version_stamp.pl that adds the current Git
> commit information from "git describe --tags --long" to the current
> version string if "git" is specified on the command line.

Salesforce did something similar in their internal build, and TBH I do not
find it a good idea. The basic problem is it's completely misleading to
equate the last commit with the source you actually built from, because
that might not have been an unmodified file set. It's particularly a bad
idea to bind the data in as early as version_stamp.pl, which even precedes
autoconf let alone configure+build. There are too many opportunities to
modify the source and then later think that what you built exactly matches
the stamped commit hash. (In the Salesforce hack, we actually captured
the commit hash at the time of running configure, two steps later than you
have here --- but that's still too early to have any confidence that the
hash matches the built files.)

As a more concrete complaint: it's physically impossible for something
done this way to match an official git commit, let alone an official
tarball, because the commit hash you're starting from would have to
predate a commit of the files that version_stamp.pl stamps.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2015-08-28 04:17:13 Re: patch: version_stamp.pl: Add Git commit info to version if 'git' is specified
Previous Message Michael Paquier 2015-08-28 03:27:21 Re: patch: version_stamp.pl: Add Git commit info to version if 'git' is specified