Krohm

GitVersionTask woes. Master branch not recognized.

Recommended Posts

Uhm, where did the source control subforum go? Nice to have a modern-looking gamedev.net indeed!

Ok, let's get to the real deal. At my current job I have somewhat managed to get to something useful and to be released. I always had an issue with versioning and so I just installed GitVersion, the relative tools and its automatic MSBuild thingie GitVersionTask.

Leaving aside I'm meeting some resistance in using source control at all, our team is so small there's really no point in using anything more than the old merge/branch model. Software development around here is... curiously managed to say for the least so I had the following needs:

  1. Official builds marked as major.minor.patch
  2. Unofficial builds as (1) plus unique identifier. SHA would be perfect.

So, what I do: I merge off master to work on something, when I merge back to master that would be a 'build'. Whatever that build is released to public or not is not my concern: stuff in master is ideally official. It seems like mainline development should be my thing right? Wrong. I tried countless configurations and wasted about three hours today the end result is always some variation of (output in VS build).

Quote

Version '7.2.3+Branch.master.Sha.<snip>' specified for 'product version' is not in normal format 'major.minor.build.revision'.

My gitVersion.yml:

next-version: 7.2
mode: Mainline

I tried annotating the master branch by using gitVersion.yml 'branch:' subsection with no avail. I have however confirmed the file is being consumed by successfully altering the produced major/minor and by producing errors.

I am a bit reluctant in opening an issue on the project page as it's basically certain it's something by my side.

What am I missing?

 

By the way, after all this pain I might actually consider other versioning mechanisms. All sort of suggestions are welcome.

BranchMerge.png

Share this post


Link to post
Share on other sites

git itself also has some features to name an arbitrary commit, which may be useful. I think it's "git id", but not sure, and I can't easily look it up.

 

I am not so sure your "2" makes sense, for branches, you definitely want a branchname in there, since 1.2.3.abcdf has no meaning at all to understand what branch the build contains.

Given your environment, you may want to only worry about official builds, and allow anything sufficiently unique for unofficial builds.

 

In my experience, the primary profit of a VCS it is that you don't need to copy changes back and forth between developers. Secondary benefits are that you have a list of changes since the last commit nearby, and it's easy to revert to that last state, so random experiments in debugging or trying something unknown are safe. Unfortunately, git pushes you in the distributed development model, which is not always as useful as they claim.

Share this post


Link to post
Share on other sites
23 hours ago, Alberth said:

git itself also has some features to name an arbitrary commit, which may be useful. I think it's "git id", but not sure, and I can't easily look it up.

There are indeed a variety of ways, I know them as 'tags' and in theory they work... except for some reason they really don't in this specific case. I use sourcetree so it's just a matter of pushing a button.

23 hours ago, Alberth said:

I am not so sure your "2" makes sense, for branches, you definitely want a branchname in there, since 1.2.3.abcdf has no meaning at all to understand what branch the build contains.

Well the snip is a full SHA and I've had a collision already in the past (not on SHA) so I feel quite safe for the next few years! They are indeed almost unique.

23 hours ago, Alberth said:

In my experience, the primary profit of a VCS it is that you don't need to copy changes back and forth between developers. Secondary benefits are that you have a list of changes since the last commit nearby, and it's easy to revert to that last state, so random experiments in debugging or trying something unknown are safe. Unfortunately, git pushes you in the distributed development model, which is not always as useful as they claim

Absolutely true. I'd say this problem is orthogonal to being distributed or not (compare P4 or other old stuff). For our environment it's fairly convenient to have a bare repository on a shared folder: ideally we don't push short lived branches there - ideally we sync no more than a couple of times a week and push a full untagged branch with explicit merge commits. I suggest everyone to have a go; my experience with git is positive albeit I used to have a thing for Mercurial.

 

Maybe I should have made clear that GitVersionTask stamps your c# executable with proper versioning by looking at the git. It isn't even just a property setting: you can inspect the result programmatically.

 

Anyhow, I had been given unwelcome news today so I'll be slow on replying. Given my new schedule, I think I might just give up on GitVersionTask and go back on explicit version stamping. Inconvenient but I have already spent too much time in figuring out what's wrong there.

Share this post


Link to post
Share on other sites
8 hours ago, Krohm said:

There are indeed a variety of ways, I know them as 'tags' and in theory they work... except for some reason they really don't in this specific case. I use sourcetree so it's just a matter of pushing a button.

I meant something else.  I once tried to solve this same problem (in a more restrictive form than what you seem to need), and spend a day convincing git to give me the information and looking at prior art. I looked up what the end-result was again, and ended with

https://stackoverflow.com/questions/3300746/deriving-application-build-version-from-git-describe-how-to-get-a-relatively

 

Trying that on a random git repository:
 

$ git describe
fatal: No annotated tags can describe '77553282f0d267032025955f9072e05cb109cfc6'.
However, there were unannotated tags: try --tags.

$ git describe --tags
v0.60-208-g7755328

which is something like 208 commits after "0.60", which sounds fair enough.

I think I made a few more changes to get a good result, but as usual, git has a zillion options for everything.

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Announcements

  • Forum Statistics

    • Total Topics
      628345
    • Total Posts
      2982192
  • Similar Content

    • By idzohar
      I am trying to rotate my car sprite just slightly to the left or right depending on input up to a small maximum. When I use this code, the rotation doesn't stop at the maximum i give it. When i try to reset the rotation back to its original state when not pressing any input, the car also jitters between a z axis rotation of 0 and 2.5. I don't understand why the rotation doesn't stop at the given maximums, nor do I understand why its jittering. Can anybody provide me some insight?
              float movementHorizontal = 0f;
              float movementVertical = 0f;
              if (Input.GetKey(KeyCode.A) && Input.GetKey(KeyCode.D))
              {
              }
              else if (Input.GetKey(KeyCode.A))
              {
                  movementHorizontal = -1;
                  if (transform.rotation.z < 10f)
                  {
                      transform.Rotate(zAxis, 2.5f);
                  }            
              }
              else if (Input.GetKey(KeyCode.D))
              {
                  movementHorizontal = 1;
                  if (transform.rotation.z > -10f)
                  {
                      transform.Rotate(zAxis, -2.5f);
                  }
                  
              }
              else
              {
                  if(transform.rotation.z > 0)
                  {
                      transform.Rotate(zAxis, -2.5f);
                      //transform.rotation.Set(0, 0, 0, 0);
                  }
                  else if (transform.rotation.z < 0)
                  {
                      transform.Rotate(zAxis, 2.5f);
                      //transform.rotation.Set(0, 0, 0, 0);
                  }
                  
              }
    • By Madolite
      (Note to Mods: Could "Input" or "Peripherals" be a good Tag to add to the tag list? Just a thought.)

      Hey, I'm currently working on which keys on a keyboard that a user can rebind their actions to. The trick is that I use a Norwegian keyboard, so it's not obvious which keys correspond to the actual C#/XNA Keys enum values.

      Are there any keys from the XNA Keys enum that, in your opinion, I've neglected to add? I don't need all Keys to be bindable, only the "most commonly used keys on a keyboard". Thanks.
      https://pastebin.com/n1cz8Y0u
    • By Eck
      I just saw their courses were knocked down to $10 each and figured I'd share the info here. They have stuff for Unity, Unreal, drawing, business, etc. I haven't used their stuff before, but the previews I looked at seemed pretty good and there is a user review system as well.
      https://www.udemy.com/courses/search/?q=Unity&src=ukw
      - Eck
       
    • By sidbhati32
      I am working on a game in which we control a rectangular box at the bottom of the screen. Three sphere which has alphabets in it fall down. When the game starts, a word is generated from the predefined list of words(which I'll give) and we are supposed to touch the correct sphere having the alphabet based on that word. The question is how to detect if I have touched the correct sphere. 
      secondly, if I have touched a correct sphere before and there is no recurrence of that alphabet in that word then during the second wave the game should not proceed if I touch the same alphabet again.
      Looking forward to your answers, i have to submit this project in a couple of days. please help! (Working on Unity 3D)
      Thanks
    • By zizulot
      Probably one of the hardest Space Shooters you ever play, try your luck
      MOve with arrow keys, SPACE to shot, you can get hit only 3 times.
      Good Luck
      Available HTML5 , Windows,MacOS and Linux ,
      Get it on: https://gamejolt.com/games/spacerecker/297429
  • Popular Now