Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
cmd/dist: Consider using "git describe" for "go version" string #9230
The current code for VERSION.cache results in output like
Many git projects use
Or even noting uncommitted changes:
As part of cmd/dist, it could look something like this:
and this would also seem to make the explicit branch logic in src/cmd/dist/build.c unnecessary, as "git describe" can already look for tags.
This is useful (to me, at least) because it immediately communicates more than just that sha1 in the original; it tells me what tag I'm near, how far away from it I am, it includes the sha1 from earlier, and then can even mark dirty working trees so I know to suspect my build to be tainted.