Use "git describe" for version number display

Currently, people on the tests-passed branch see in the dashboard that they are running a “beta” version, when that isn’t quite the case.

The git describe command has a pretty meaningful output for Discourse:

$ git checkout master
$ git describe
$ git checkout v1.3.0.beta1
$ git describe

I would like to suggest using the git describe output to represent both (a) how long it has been since the beta and (b) if the currently running version of Discourse is carrying unsupported patches (through a sha mismatch and number increment).


Sure, put through a PR

I posted a topic because I think this will need some ‘mothership’ changes as well, so I’ll go ahead and write the Discourse side.

I am not sure anything is required on mothership, though I would start with only doing “describe” on tests-passed branch. Process wise we can be more militant on stable and beta always getting a new tag per commit.

I think it wouldn’t be a bad idea to try some gsub magic to turn that first dash into a plus (v1.3.0.beta1+48-g34dc1f9).

we should totally only be doing this if you are on the master branch. but yeah, seeing guids can be kind of scary, I would suppress it from the UI and allow people to click to expand or something.

Version 2:

Well, as you can see above from my screenshot of checking out the beta branch, that shouldn’t be an issue!

The -dirty is due to my changes not being committed.


Actually the nicest thing to display to the user is number of commits since that tag… so:


22 commits after tag V1.3.0 … no need to look at hashes there.


I can do that:


Also requested here:

1 Like