]> asedeno.scripts.mit.edu Git - PuTTY.git/commit
Show the git commit hash in local dev builds too.
authorSimon Tatham <anakin@pobox.com>
Sat, 21 Jan 2017 14:57:31 +0000 (14:57 +0000)
committerSimon Tatham <anakin@pobox.com>
Sat, 21 Jan 2017 14:57:31 +0000 (14:57 +0000)
commitbe586d53b0e503a00c72982667f8e8d11b1893fe
tree3e765f2e284a00fbd490a3fff5c055221188c5a4
parent5687a16fc1b60345c76d4f5088edc41004a3529d
Show the git commit hash in local dev builds too.

This is perhaps the more useful end of the mechanism I added in the
previous commit: now, when a developer runs a configure+make build
from a git checkout (rather than from a bob-built source tarball), the
Makefile will automatically run 'git rev-parse HEAD' and embed the
result in the binaries.

So now when I want to deploy my own bleeding-edge code for day-to-day
use on my own machine, I can easily check whether I've done it right
(e.g. did I install to the right prefix?), and also easily check
whether any given PuTTY or pterm has been restarted since I rolled out
a new version.

In order to arrange this (and in particular to force version.o to be
rebuilt when _any_ source file changes), I've had to reintroduce some
of the slightly painful Makefile nastiness that I removed in 4d8782e74
when I retired the 'manifest' system, namely having version.o depend
on a file empty.h, which in turn is trivially rebuilt by a custom make
rule whose dependencies include $(allsources). That's a bit
unfortunate, but I think acceptable: the main horribleness of the
manifest system was not that part, but the actual _manifests_, which
were there to arrange that if you modified the sources in a
distribution tarball the binaries would automatically switch to
reporting themselves as local builds rather than the version baked
into the tarball. I haven't reintroduced that part of the system: if
you check out a given git commit, modify the checked-out sources, and
build the result, the Makefile won't make any inconvenient attempts to
detect that, and the resulting build will still announce itself as the
git commit you started from.
Recipe
version.c
version.h