Since master takes the version string of the next release, it is difficult to tell the difference between a release and edge build from --version alone.
In the CI environment, we can pull the existing CI_COMMIT env var to get the commit hash.
For dev builds, I think the commit hash should be -unknown or even -$USER. The proposed solution of running git from builds.rs is 馃憥, for one it breaks if you download a release source archive and try to build it
SG. The link was more of a "someone did it like this" than an actual proposal. I've done similar for a project in the past, but it was Autotools and C++, so :cake: What I did there for dev builds was HEAD_commit_hash and an optional ~dirty suffix if the working tree had modifications. $USER can get a little weird if we don't have control over that namespace, but probably not an issue for us at this time.
Fixed a while ago! eg:
solana --version
solana-cli 0.22.4 [channel=beta commit=13af04998874b0ba411e2966b8eb7101192b2783]