How to manage build-ids in git? As messages, branches, both or other?
Clash Royale CLAN TAG#URR8PPP
How to manage build-ids in git? As messages, branches, both or other?
A colleague and I were talking about how to manage versioning of source code. Our company currently has a user-id for creating a null commit with the message stating the build-id. We use build-ids such as XXyyyy.zz.bbb
that are auto generated every day, where XX
is the project id, yyyy
is the year of the code, zz
is some number that we don't seem to use as it always seems to be 00
, and bbb
is the build number which is incremented every day.
XXyyyy.zz.bbb
XX
yyyy
zz
00
bbb
If I need to get the source code of a particular build, I need to grep the log to find the hash id and then checkout that hash id to put git into a detached head state. Or if using the VS IDE, get the history, filter on the user-id, then scroll down to the appropriate item and check it out.
However, I was thinking that perhaps this isn't efficient as maybe using branches, because from the git bash command line, we could use git checkout builds/XXyyyy/zz/bbb
, or from VS just go into branches and select the tree branch on builds -> XXyyyy -> zz -> bbb
. This has the added benefit not putting the repository in a detached head state, and you can easily see where you are from the git-bash command line (though I don't know if this is enough of a reason to do it this way).
git checkout builds/XXyyyy/zz/bbb
builds -> XXyyyy -> zz -> bbb
Are there any best practices for tracking build-ids in git that I can reference? Or pros and cons for these two methods? Perhaps both might be good to use?
FYI, my team is using VS2017 15.6.7.
1 Answer
1
I would use git tags to do this:git tag XXyyy.ss.bbb a1b2c3d4
git tag XXyyy.ss.bbb a1b2c3d4
Then you would check it out later:git checkout XXyyy.ss.bbb
git checkout XXyyy.ss.bbb
It still puts you in a detached HEAD state, but that should not be worrisome as that "version" should no longer receive any updates since it has been released.
Also, re comment about no longer receiving updates. That is not necessarily true as there are the (now more rare) hot fixes that we occasionally produce.
– Adrian
Aug 10 at 21:33
Oh, my mistake, VS2017 Update 6 does have it. We're just not there yet or maybe I just can't see it. :( We're using VS2017 15.6.7.
– Adrian
Aug 10 at 21:34
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
That's interesting. However, I don't think that VS2017 has support for tags yet, so unfortunately, I don't think that would be useful. :(
– Adrian
Aug 10 at 21:30