Closed halex2005 closed 8 years ago
So, without this PR I have workaround like:
var processSettings = new ProcessSettings()
.SetRedirectStandardOutput(true)
.WithArguments(x => {
x.Append("describe")
.Append("--tags")
.AppendSwitch("--match", "versions/*")
.Append("--abbrev=0");
});
using (var describeProcess = StartAndReturnProcess("git", processSettings))
{
describeProcess.WaitForExit();
var lines = describeProcess.GetStandardOutput().ToList();
if (lines.Count == 0 || lines.Count > 1)
{
Warning("git describe returns no tags [{0}]", string.Join("\n", lines));
return null;
}
lastestTag = lines.FirstOrDefault();
}
instead of one line using PR:
lastestTag = GitDescribe(".", GitDescribeStrategy.Tags);
Hi @halex2005,
Sorry we've been very busy with other projects, we'll review this PR as soon as possible. If possible please add a test case too test.cake
Left some minor comments, will review more tomorrow. If possible please add example code to the aliases too you can read more about it here
Also added git describe specified commit, not only head. Review, please.
@halex2005 Currently exceptions are swallowed and test aren't failed just logged, throw in tasks if unexpected result is returned see build log https://ci.appveyor.com/project/WCOMAB/cake-git/build/0.2.0-build-0125#L401
It seems I'm done. Thanks for your review!
Could you please rebase into one commit and I'll do a final review before merging.
Made one commit
@halex2005 LGTM:+1: merged! thanks for your contribution.
Thanks for feedback and merging! That was awesome experience for me!
Hello!
I'd like to use Cake.Git tool in by build scripts. We have versioning scheme based on tagging our branches with version number (like
v1.0.0
). I'd like to receive current tag name in build scripts.This can be done with
git describe --tags
command line. I found that libgit2sharp already have implemented Describe() method (see this closed issue).Please, consider to accept this PR. Also I guess, this implementation can be improved by passing Commit as parameter. What do you think?
/cc:@devlead