From 6305da0809e11e1f663f55760d0fc13100e8ed3f Mon Sep 17 00:00:00 2001 From: Alexander Sidorenko Date: Mon, 3 Sep 2018 15:59:29 +0300 Subject: [PATCH 01/10] Fix for #75: GitLog returns only one commit when using sinceCommitId --- src/Cake.Git/GitAliases.Log.cs | 2 +- test.cake | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/Cake.Git/GitAliases.Log.cs b/src/Cake.Git/GitAliases.Log.cs index 9e4c756..6a9f5fc 100644 --- a/src/Cake.Git/GitAliases.Log.cs +++ b/src/Cake.Git/GitAliases.Log.cs @@ -133,7 +133,7 @@ string sinceCommitId return repository.Commits .QueryBy(new CommitFilter { - IncludeReachableFrom = sinceCommitId, + IncludeReachableFrom = repository.Head, ExcludeReachableFrom = repository.Lookup(sinceCommitId).Parents }) .Select(commit => new GitCommit(commit)) diff --git a/test.cake b/test.cake index 3f2aa74..743b2d9 100644 --- a/test.cake +++ b/test.cake @@ -189,6 +189,17 @@ Task("Git-Init-Commit") Information("Commit created:\r\n{0}", initalCommit); }); +Task("Git-Second-Commit") + .IsDependentOn("Git-Init-Commit") + .Does(() => +{ + var filePath = testInitalRepo.CombineWithFilePath(string.Format("{0}.new", Guid.NewGuid())); + CreateRandomDataFile(Context, filePath); + GitAdd(testInitalRepo, filePath); + var secondCommit = GitCommit(testInitalRepo, testUser, testUserEmail, "Second commit"); + Information("Commit created:\r\n{0}", secondCommit); +}); + Task("Git-HasUncommitedChanges-Dirty") .IsDependentOn("Git-Init-Add") .Does(() => @@ -223,9 +234,9 @@ Task("Git-Init-Diff") }); Task("Git-Log-TipToCommitId") - .IsDependentOn("Git-Init-Commit") + .IsDependentOn("Git-Second-Commit") .Does(() => -{ +{ var commits = GitLog(testInitalRepo, initalCommit.Sha); foreach(var commit in commits) { From a4b713ac811b3a644b5230dc25dee25bd392acd3 Mon Sep 17 00:00:00 2001 From: MDK3 Date: Mon, 1 Oct 2018 10:39:54 -0300 Subject: [PATCH 02/10] Update file addition of . --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4d1286a..295c7e0 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![NuGet](https://img.shields.io/nuget/v/Cake.Git.svg)](https://www.nuget.org/packages/Cake.Git) [![MyGet](https://img.shields.io/myget/cake-contrib/vpre/Cake.Git.svg?label=MyGet)](https://www.myget.org/feed/wcomab/package/nuget/Cake.Git) -Cake AddIn that extends Cake with Git features using LibGit2 and LibGit2Sharp +Cake AddIn that extends Cake with Git features using LibGit2 and LibGit2Sharp. | Build server | Platform | Status | |-----------------------------|--------------|---------------------------------------------------------------------------------------------------------------------------| @@ -11,7 +11,7 @@ Cake AddIn that extends Cake with Git features using LibGit2 and LibGit2Sharp ## Documentation -Documentation available at [cakebuild.net/dsl/git](http://cakebuild.net/dsl/git) +Documentation available at [cakebuild.net/dsl/git](http://cakebuild.net/dsl/git). ## Example usage ```cake From 2a0fabc8a518efa019c59d69fb28dd855d38bc3c Mon Sep 17 00:00:00 2001 From: Dantttt <40569546+Dantttt@users.noreply.github.com> Date: Sat, 13 Oct 2018 17:33:30 +0200 Subject: [PATCH 03/10] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 295c7e0..a077a4a 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Cake AddIn that extends Cake with Git features using LibGit2 and LibGit2Sharp. ## Documentation -Documentation available at [cakebuild.net/dsl/git](http://cakebuild.net/dsl/git). +Documentation is available at [cakebuild.net/dsl/git](http://cakebuild.net/dsl/git). ## Example usage ```cake From ff41bb24071178505dffdd064bc227c52b7cc962 Mon Sep 17 00:00:00 2001 From: Pascal Berger Date: Wed, 2 Jan 2019 17:03:13 +0100 Subject: [PATCH 04/10] Use Tags category for all tag related aliases --- src/Cake.Git/GitAliases.Tag.cs | 2 +- src/Cake.Git/GitAliases.Tags.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Cake.Git/GitAliases.Tag.cs b/src/Cake.Git/GitAliases.Tag.cs index 766a8a4..6e1335e 100644 --- a/src/Cake.Git/GitAliases.Tag.cs +++ b/src/Cake.Git/GitAliases.Tag.cs @@ -25,7 +25,7 @@ public static partial class GitAliases /// The tag name. /// [CakeMethodAlias] - [CakeAliasCategory("Tag")] + [CakeAliasCategory("Tags")] public static void GitTag( this ICakeContext context, DirectoryPath repositoryDirectoryPath, diff --git a/src/Cake.Git/GitAliases.Tags.cs b/src/Cake.Git/GitAliases.Tags.cs index 0f87b18..8d9be67 100644 --- a/src/Cake.Git/GitAliases.Tags.cs +++ b/src/Cake.Git/GitAliases.Tags.cs @@ -18,7 +18,7 @@ partial class GitAliases /// /// [CakeMethodAlias] - [CakeAliasCategory("AllTags")] + [CakeAliasCategory("Tags")] public static List GitTags( this ICakeContext context, DirectoryPath repositoryDirectoryPath) From 8225b7f774b1beffbcdc54ee85689d78708dc0ba Mon Sep 17 00:00:00 2001 From: Pascal Berger Date: Wed, 2 Jan 2019 17:08:09 +0100 Subject: [PATCH 05/10] Use Branch category for all branch related aliases --- src/Cake.Git/GitAliases.Branch.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Cake.Git/GitAliases.Branch.cs b/src/Cake.Git/GitAliases.Branch.cs index ea3d563..a79c69e 100644 --- a/src/Cake.Git/GitAliases.Branch.cs +++ b/src/Cake.Git/GitAliases.Branch.cs @@ -67,7 +67,6 @@ public static GitBranch GitBranchCurrent(this ICakeContext context, DirectoryPat /// /// [CakeMethodAlias] - [CakeAliasCategory("CreateBranch")] public static void GitCreateBranch(this ICakeContext context, DirectoryPath repositoryDirectoryPath, string branchName, bool checkOut) { if (context == null) From f98b2ae0279a3a813a50d599f600c1e5f22944b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20M=C3=BCller?= Date: Mon, 11 Feb 2019 15:55:16 +0100 Subject: [PATCH 06/10] Add return value to CreateBranch alias to avoid unnecessary rounds --- src/Cake.Git/GitAliases.Branch.cs | 12 +++++++++--- test.cake | 6 ++++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/Cake.Git/GitAliases.Branch.cs b/src/Cake.Git/GitAliases.Branch.cs index a79c69e..0a11db2 100644 --- a/src/Cake.Git/GitAliases.Branch.cs +++ b/src/Cake.Git/GitAliases.Branch.cs @@ -67,7 +67,7 @@ public static GitBranch GitBranchCurrent(this ICakeContext context, DirectoryPat /// /// [CakeMethodAlias] - public static void GitCreateBranch(this ICakeContext context, DirectoryPath repositoryDirectoryPath, string branchName, bool checkOut) + public static GitBranch GitCreateBranch(this ICakeContext context, DirectoryPath repositoryDirectoryPath, string branchName, bool checkOut) { if (context == null) { @@ -84,13 +84,19 @@ public static void GitCreateBranch(this ICakeContext context, DirectoryPath repo throw new ArgumentNullException(nameof(branchName)); } - context.UseRepository(repositoryDirectoryPath, + return context.UseRepository(repositoryDirectoryPath, repository => { var localBranch = repository.CreateBranch(branchName); - if (checkOut) Commands.Checkout(repository, localBranch); + if (checkOut) + { + Commands.Checkout(repository, localBranch); + } + + return new GitBranch(repository); }); + } } } diff --git a/test.cake b/test.cake index 743b2d9..9b9754e 100644 --- a/test.cake +++ b/test.cake @@ -680,10 +680,12 @@ Task("Git-Create-Branch") .Does(() => { var branchName = "Foo"; - GitCreateBranch(testInitalRepo, branchName, true); + var createdBranch = GitCreateBranch(testInitalRepo, branchName, true); + if (createdBranch.FriendlyName != branchName) + throw new Exception($"Incorrect Branch returned. Expected {branchName} and got {createdBranch.FriendlyName}"); var branch = GitBranchCurrent(testInitalRepo); if (branch.FriendlyName != branchName) - throw new Exception($"Incorrect Branch created. Expected {branchName} and got {branch.FriendlyName}"); + throw new Exception($"Incorrect Branch created. Expected {branchName} and got {branch.FriendlyName}"); }); Task("Git-Remote-Branch") From 91061839f40665b3d16f658919069ff046f5ddc9 Mon Sep 17 00:00:00 2001 From: Sean Fausett Date: Sun, 21 Apr 2019 13:18:34 +1200 Subject: [PATCH 07/10] Bump Cake to 0.33.0 --- src/Cake.Git/Cake.Git.csproj | 4 +--- src/SolutionInfo.cs | 2 +- tools/packages.config | 4 ++-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/Cake.Git/Cake.Git.csproj b/src/Cake.Git/Cake.Git.csproj index 730e584..c65528c 100644 --- a/src/Cake.Git/Cake.Git.csproj +++ b/src/Cake.Git/Cake.Git.csproj @@ -17,9 +17,7 @@ {08F0A5C3-0E9C-451D-B003-14FF73699BE1} - - All - + diff --git a/src/SolutionInfo.cs b/src/SolutionInfo.cs index 675253a..38d30c2 100644 --- a/src/SolutionInfo.cs +++ b/src/SolutionInfo.cs @@ -13,6 +13,6 @@ [assembly: AssemblyVersion("0.19.0")] [assembly: AssemblyFileVersion("0.19.0")] [assembly: AssemblyInformationalVersion("0.19.0")] -[assembly: AssemblyCopyright("Copyright © WCOM AB 2018")] +[assembly: AssemblyCopyright("Copyright © WCOM AB 2019")] [assembly: CLSCompliant(true)] diff --git a/tools/packages.config b/tools/packages.config index 5247765..cf77e99 100644 --- a/tools/packages.config +++ b/tools/packages.config @@ -1,5 +1,5 @@ - - + + From fdeadf5e44e8ed75f44ed3b51c9ffb2be3a0e757 Mon Sep 17 00:00:00 2001 From: Sean Fausett Date: Sun, 21 Apr 2019 14:00:55 +1200 Subject: [PATCH 08/10] Bump Travis dotnet to 2.1.505 on xenial --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index d83da49..ce3eff3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,9 +3,9 @@ os: - osx - linux -# Ubuntu 14.04 +# Ubuntu 16.04 sudo: required -dist: trusty +dist: xenial # OS X 10.12 osx_image: xcode9.2 @@ -13,7 +13,7 @@ osx_image: xcode9.2 mono: - 5.12.0 -dotnet: 2.1.400 +dotnet: 2.1.505 before_install: - git fetch --unshallow # Travis always does a shallow clone, but GitVersion needs the full history including branches and tags From bf35326884ae6c45fc52946ea1ee07afbcc6affb Mon Sep 17 00:00:00 2001 From: Sean Fausett Date: Wed, 24 Apr 2019 17:23:00 +1200 Subject: [PATCH 09/10] Fix package icon --- build.cake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.cake b/build.cake index 8b7d897..62e3e89 100644 --- a/build.cake +++ b/build.cake @@ -41,7 +41,7 @@ var nuGetPackSettings = new NuGetPackSettings { Description = assemblyInfo.Description, Summary = "Cake AddIn that extends Cake with Git SCM features", ProjectUrl = new Uri("https://github.com/cake-contrib/Cake_Git/"), - IconUrl = new Uri("https://cdn.rawgit.com/cake-contrib/graphics/a5cf0f881c390650144b2243ae551d5b9f836196/png/cake-contrib-medium.png"), + IconUrl = new Uri("https://cdn.jsdelivr.net/gh/cake-contrib/graphics/png/cake-contrib-medium.png"), LicenseUrl = new Uri("https://github.com/cake-contrib/Cake_Git/blob/master/LICENSE.md"), Copyright = assemblyInfo.Copyright, ReleaseNotes = releaseNotes.Notes.ToArray(), From 8b3a1d608b47140216c4bcc27092259c848318ba Mon Sep 17 00:00:00 2001 From: Mattias Karlsson Date: Sat, 22 Jun 2019 19:44:51 +0200 Subject: [PATCH 10/10] Bumped version to 0.20.0 --- ReleaseNotes.md | 7 +++++++ src/SolutionInfo.cs | 6 +++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ReleaseNotes.md b/ReleaseNotes.md index 1ef705a..cc62bc5 100644 --- a/ReleaseNotes.md +++ b/ReleaseNotes.md @@ -1,3 +1,10 @@ +### New in 0.20.0 (Released 2019/06/22) + +* Bumped Cake.Core to 0.33.0 +* GitCreateBranch returns GitBranch +* Fix GitLog +* Unify tags documentation + ### New in 0.19.0 (Released 2018/08/23) * Ported to .NET Standard 2.0 diff --git a/src/SolutionInfo.cs b/src/SolutionInfo.cs index 38d30c2..d3d9695 100644 --- a/src/SolutionInfo.cs +++ b/src/SolutionInfo.cs @@ -10,9 +10,9 @@ [assembly: AssemblyDescription("Cake Git AddIn")] [assembly: AssemblyCompany("WCOM AB")] [assembly: AssemblyProduct("Cake.Git")] -[assembly: AssemblyVersion("0.19.0")] -[assembly: AssemblyFileVersion("0.19.0")] -[assembly: AssemblyInformationalVersion("0.19.0")] +[assembly: AssemblyVersion("0.20.0")] +[assembly: AssemblyFileVersion("0.20.0")] +[assembly: AssemblyInformationalVersion("0.20.0")] [assembly: AssemblyCopyright("Copyright © WCOM AB 2019")] [assembly: CLSCompliant(true)]