I wonder whether there is a convenient way to include the git commit hash into the debug build of a crate, but not into the release build.
My attempt on solving this is: this build script and this helper macro.
Maybe there’s a more convenient way? Cargo does not include this information as environment variable itself, as far as I see? Maybe that’s an idea for a feature in cargo?