Krohm

GitVersionTask woes. Master branch not recognized.

Recommended Posts

Krohm    5031

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
Alberth    9530

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
Krohm    5031
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
Alberth    9530
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


  • Partner Spotlight

  • Similar Content

    • By louie999
      I am trying to create a simple GUI system, with buttons and text for now, but this little problem has me absolutely stumped. Basically, I'm creating a new instance of the class GUI and giving it a reference of the newly created window (wnd) which then stores it in the variable "w". With that, I loop through all the current buttons and draw it using the window's draw function (w.Draw()) but the variable "w" always ends up being null and giving me that error. Here's part of my code:
      // Program.cs static void Main(string[] args) { RenderWindow wnd = new RenderWindow(new VideoMode(800, 600), "Test"); Font font = new Font("ITCBLKAD.TTF"); GUI gui = new GUI(ref wnd); wnd.Closed += new EventHandler(CloseEvn); while (wnd.IsOpen) { wnd.DispatchEvents(); wnd.Clear(); gui.RenderAll(); wnd.Display(); } // ... // GUIHandler.cs class GUI { protected RenderWindow w; static protected List<Button> buttonContainer = new List<Button>(); public GUI() { } public GUI(ref RenderWindow window) { w = window; } public void RenderAll() { foreach (Button obj in buttonContainer) { obj.Draw(); } } } class Button : GUI { Text textObj; FloatRect rect; RectangleShape shape; Vector2f vec; State state; readonly string type = "button"; private Button(string text, Font _font, float xpos, float ypos, State _state) { vec.X = xpos; vec.Y = ypos; textObj = new Text(text, _font); textObj.Position = vec; state = _state; rect.Left = xpos; rect.Top = ypos; rect.Width = 10; rect.Height = 10; } public static Button NewText(string text, Font _font, float xpos, float ypos, State _state) { Button temp = new Button(text, _font, xpos, ypos, _state); buttonContainer.Add(temp); return temp; } public void Draw() { w.Draw(textObj); } } Is there anything I'm missing? I'll post the whole code if needed.
    • By mbmusicpl
      Hi,
      I am composer and sound designer that is trying to learn some codeing  Could You help me and tell me what should i add to change volume to 1.0F when enter trigger
      using System.Collections;
      using System.Collections.Generic;
      using UnityEngine;
      public class AudioPlay : MonoBehaviour {

          public AudioClip strings_1;
          AudioSource audioSource;

          // Use this for initialization
          void Start () {
              audioSource = GetComponent<AudioSource> (); 
              audioSource.PlayOneShot (strings_1, 0.0F );   - when game starts i want it to start but with 0 volume
          }
          // Update is called once per frame
          void Update () {
          }
          void OnTriggerEnter2D (Collider2D other) 
          {
              if(other.gameObject.tag == "slotviolin")
              {
                  Debug.Log ("coilder works");
          
              // how can i change volume to 1.0F and if it's possible how to make it smooth ?

              }
          }
      }
       
      Thanks
    • By Affgoo
      About us:
      We are a team of 14 developers developing multiple mid scope games both are over halfway complete. We polish all of our games and focus on quality.


      We are a small team, everyone currently on the team and future teammates must be interested in game development as a whole and not just one role, being a small indie company it is very important that you can wear a few hats and not just one. Everyone on our team is a game dev.

      looking for:
      3d Artist (hand painting a huge plus)
      3d Animator
      entry level Software engineer with reasonable skills in c# / shaders. 

      ^ requirement for all positions: A true love of game development and to be very self motivated.
      We are a very active team, you must be too. 


      If interested or for more information add me on skype: nicholas.boucher4


      Atlas Sentry art style: (art complete)(code complete)
      http://www.slidedb.com/games/atlas-sentry

      Rat n Gat art style: In Devlopment

    • By gomidas
      I am trying to add normal map to my project I have an example of a cube: 
      I have normal in my shader I think. Then I set shader resource view for texture (NOT BUMP)
                  device.ImmediateContext.PixelShader.SetShaderResource(0, textureView);             device.ImmediateContext.Draw(VerticesCount,0); What should I do to set my normal map or how it is done in dx11 generally example c++?
    • By Jcyshadow97
      Hi guys,i m looking for someone that can work with me on a "top-down" multiplayer fps as 2d and 3d artist.I used photon server and i can take the part of programming.For now i made only the basic gameplay of the game that include shooting,switch weapon and and damage player.If someone can help me please contact me via e mail: 270514974@libero.it.
      I really appreciate your collaboration and hope you have a good day.....
      Thanks for you time to read the post
      At the bottom i attach some screenshot of the current game,i m sorry that i can't attach a video...



  • Popular Now