Use "git describe" for version number display


(Kane York) #1

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
v1.3.0.beta1-47-gca57300
$ git checkout v1.3.0.beta1
$ git describe
v1.3.0.beta1

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).


Admin Panel shows Installed "v1.3.0.beta2 +2"
(Sam Saffron) #2

Sure, put through a PR


(Kane York) #3

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.


(Sam Saffron) #4

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.


(Kane York) #5

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).


(Sam Saffron) #6

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.


(Kane York) #7

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.


(Dean Taylor) #8


(Sam Saffron) #9

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

V1.3.0+22

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


Admin Panel shows Installed "v1.3.0.beta2 +2"
(Kane York) #10

I can do that:

https://github.com/discourse/discourse/pull/3228


Admin Panel shows Installed "v1.3.0.beta2 +2"
(Dave McClure) #11

Also requested here:


(Régis Hanol) #12