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

4 Likes

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.

2 Likes

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.

2 Likes

I can do that:

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

5 Likes

Also requested here:

1 Like