Current-Users archive

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

Re: Git and ident of binaries

On Tue, Jan 12, 2010 at 11:50 PM, Curt Sampson <> wrote:
> On 2010-01-12 17:19 +0000 (Tue), David Holland wrote:
>>  > These days, my preference would be to kill [keyword expansion]. It
>>  > makes me nervous that a checkout of a particular revision is not
>>  > what's in the repository for that particular revision, but instead
>>  > a modified copy whose particular modifications may change when the
>>  > VCS software changes.
>> It is nonetheless desirable to be able to ident binaries.
> I agree that that would be nice.
> In git, it seems to me that this could be done with a pre-commit hook
> which would expand or change the $NetBSD$ tag appropriately just before
> commit, thus ensuring that the right thing is in the repository itself.

What I have seen in other projects (and what I do in atf) is:

If building from the repository: at build time, get the current
revision number and store it in a file (say revision.h).  Also store
if the source code is clean or if it's locally modified.  And then
just embed this information into the binary somehow.

If building from a tarball (assuming it doesn't include vcs control
directories and/or the vcs tool is not available): ship a copy of
revision.h created at the time the tarball was created.  This
revision.h, as it's "cached", will state that the information may not
reflect reality.

Julio Merino

Home | Main Index | Thread Index | Old Index