Skip to content

Commit

Permalink
Merge pull request #5 from ChrisTTian667/feature/SkipLastCommitMessage
Browse files Browse the repository at this point in the history
Add optional parameter to skip last commit messages
  • Loading branch information
hoffmann-beni authored Sep 16, 2024
2 parents 6667a34 + 9ede7fe commit 008f9b9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/CakeExt.Git/GitAlias.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ public static IEnumerable<string> Git(this ICakeContext context, string argument
/// Gets the last commit message
/// </summary>
[CakeMethodAlias]
public static string GitGetLastCommitMessage(this ICakeContext context) =>
context.Git("log -1 --pretty=format:'%s'").FirstOrDefault() ?? "";
public static string GitGetLastCommitMessage(this ICakeContext context, int skip = 0) =>
context.Git($"log -{1+skip} --pretty=format:'%s'")
.FirstOrDefault() ?? "";

/// <summary>
/// Gets the current branch name
Expand Down

0 comments on commit 008f9b9

Please sign in to comment.