public VersionAndBranch GetVersion(Repository repository)
 {
     var gitFlowVersionFinder = new GitFlowVersionFinder
                                {
                                    Branch = repository.Head,
                                    Commit = repository.Head.Commits.First(),
                                    Repository = repository
                                };
     return gitFlowVersionFinder.FindVersion();
 }
Пример #2
0
    public void NServiceBusDevelop()
    {
        using (var repository = new Repository(@"C:\Code\NServiceBus"))
        {
            var branch = repository.Branches.First(x => x.Name == "develop");
            var commit = branch.Commits.First();

            var finder = new GitFlowVersionFinder
                         {
                             Commit = commit,
                             Repository = repository,
                             Branch = branch
                         };
            var version = finder.FindVersion();
            Debug.WriteLine(version.Version.Major);
            Debug.WriteLine(version.Version.Minor);
            Debug.WriteLine(version.Version.Patch);
            Debug.WriteLine(version.Version.PreReleasePartOne);
            Debug.WriteLine(version.Version.Stability);
            Debug.WriteLine(version.BranchType);
            Debug.WriteLine(version.Version.Suffix);
        }
    }
Пример #3
0
    public void TimingOnNSB()
    {
        var startNew = Stopwatch.StartNew();
        using (var repository = new Repository(@"C:\Code\Particular\NServiceBus"))
        {
            var branch = repository.Branches.First(x => x.Name == "develop");
            var commit = branch.Commits.First();

            var finder = new GitFlowVersionFinder
                         {
                             Commit = commit,
                             Repository = repository,
                             Branch = branch
                         };
            var version = finder.FindVersion();
        }
        Debug.WriteLine(startNew.ElapsedMilliseconds);
        startNew = Stopwatch.StartNew();
        using (var repository = new Repository(@"C:\Code\Particular\NServiceBus"))
        {
            var branch = repository.Branches.First(x => x.Name == "develop");
            var commit = branch.Commits.First();

            var finder = new GitFlowVersionFinder
                         {
                             Commit = commit,
                             Repository = repository,
                             Branch = branch
                         };
            var version = finder.FindVersion();
        }
        Debug.WriteLine(startNew.ElapsedMilliseconds);
    }
Пример #4
0
    public void NServiceBusReleaseSpecificCommit()
    {
        using (var repository = new Repository(@"C:\Code\NServiceBus"))
        {
            var branch = repository.Branches.First(x => x.Name == "release-4.1.0");
            var commit = branch.Commits.First(x => x.Id.Sha == "c0e0a5e13775552cd3e08e039f453e4cf1fd4235");

            var finder = new GitFlowVersionFinder
                         {
                             Commit = commit,
                             Repository = repository,
                             Branch = branch
                         };
            var version = finder.FindVersion();
            Debug.WriteLine(version.Version.Major);
            Debug.WriteLine(version.Version.Minor);
            Debug.WriteLine(version.Version.Patch);
            Debug.WriteLine(version.Version.PreReleasePartOne);
            Debug.WriteLine(version.Version.PreReleasePartTwo);
            Debug.WriteLine(version.Version.Stability);
            Debug.WriteLine(version.BranchType);
            Debug.WriteLine(version.Version.Suffix);
        }
    }