[cctbxbb] sequential revision number from git repo

markus.gerstel at diamond.ac.uk markus.gerstel at diamond.ac.uk
Tue Apr 5 06:02:54 PDT 2016


Except of course that I chose to illustrate the 'go to a commit'-github-link with a version that has not been published yet.
Try eg. https://github.com/xia2/xia2/commit/2a1e557 instead

Sorry

-Markus

-----Original Message-----
From: cctbxbb-bounces at phenix-online.org [mailto:cctbxbb-bounces at phenix-online.org] On Behalf Of markus.gerstel at diamond.ac.uk
Sent: 05 April 2016 13:56
To: cctbxbb at phenix-online.org
Subject: Re: [cctbxbb] sequential revision number from git repo

Hi Rob,

This is close to what we do with DIALS.
If you run dials.version you may get e.g.
DIALS 1.dev.132-g7042805
So this is the 132nd commit after the commit we tagged "1.dev", which happened when we branched for the 1.1 stable release so we could keep the version numbers sufficiently different

If you run DIALS 1.1, for example the version from CCP4, you might get DIALS 1.1.3-gb5528a5-release The 3rd commit on the 1.1 release branch.

Same with xia2:
XIA2 0.4.0.301-g7f16ab6

In xia2 we also add the branch name if it is not 'master', so the version distributed with DIALS 1.1 is:
XIA2 0.4.0.289-g2a1e557-dials-1.1

We kept the commit ID in - and I would recommend to keep it with cctbx, too.
The reason for this is: 
- The number on its own does not uniquely identify a commit, as you might be on a different branch (although we do put in the branch names, too)
- Because then I can go to https://github.com/dials/dials/commit/b5528a5 and see everything about that commit
- Because then I can do  git checkout b55528a5  and instantly have that particular code version on my machine to fiddle with things.

To see the magic happen, check https://github.com/dials/dials/blob/master/util/version.py or https://github.com/xia2/xia2/blob/master/XIA2Version.py

-Markus


-----Original Message-----
From: cctbxbb-bounces at phenix-online.org [mailto:cctbxbb-bounces at phenix-online.org] On Behalf Of R.D. Oeffner
Sent: 05 April 2016 13:38
To: cctbxbb at phenix-online.org
Subject: [cctbxbb] sequential revision number from git repo

Hi,

We are slowly moving phaser svn to git. One issue that we would like to address is if there is a practical way of conveying a linear commit history from the git repo.

One approach is to just count the number of revisions that was made to the master branch in the git repo with "git rev-list --count HEAD"
and then pretend that number is a revision number. This enables us to tell users "This bug was fixed after revision 6456 of phaser" rather than "This bug was fixed after commit 29b0a1c... of phaser". Is there any pitfalls with this approach?

What workarounds do other people using git come up with?



Rob


--
Robert Oeffner, Ph.D.
Research Associate, The Read Group
Department of Haematology,
Cambridge Institute for Medical Research University of Cambridge Cambridge Biomedical Campus Wellcome Trust/MRC Building Hills Road Cambridge CB2 0XY

www.cimr.cam.ac.uk/investigators/read/index.html
tel: +44(0)1223 763234
mobile: +44(0)7712 887162
_______________________________________________
cctbxbb mailing list
cctbxbb at phenix-online.org
http://phenix-online.org/mailman/listinfo/cctbxbb

--
This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail.
Any opinions expressed within this e-mail are those of the individual and not necessarily of Diamond Light Source Ltd. 
Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments are free from viruses and we cannot accept liability for any damage which you may sustain as a result of software viruses which may be transmitted in or with the message.
Diamond Light Source Limited (company no. 4375679). Registered in England and Wales with its registered office at Diamond House, Harwell Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom


_______________________________________________
cctbxbb mailing list
cctbxbb at phenix-online.org
http://phenix-online.org/mailman/listinfo/cctbxbb



More information about the cctbxbb mailing list