Latest commits notes from github

For AOP with Roslyn I want to automatically get the latest commits message before doing a new commit.

This was  solved easily using 

The code is  very simple:

public async Task<DateForCommit[]> BetweenLatest2Commits()
var client = new GitHubClient(new ProductHeaderValue("GitBetweenCommits"));
var rep = await client.Repository.Get(Author, RepositoryName);
var relLatest = await client.Repository.Release.GetLatest(rep.Id);
var relAll = await client.Repository.Release.GetAll(rep.Id, new ApiOptions() { PageSize = int.MaxValue - 1 });
var relBeforeLatest = relAll.OrderByDescending(it => it.CreatedAt).Skip(1).FirstOrDefault();

var dateLatest = relLatest.CreatedAt;
var dateBeforeLatest = relBeforeLatest.CreatedAt;

var commits = await client.Repository.Commit.GetAll(rep.Id, ApiOptions.None);
var res = commits
    .Where(it => 
    it.Commit.Author.Date >= dateBeforeLatest
    .Select(it => new DateForCommit()
        Author = it.Commit.Author.Name,
        Message = it.Commit.Message,
        CommitDate = it.Commit.Author.Date.DateTime
return res;

It works also as a .NET Global tool
Install with

dotnet tool install –global dotnet-gcr

run with

dotnet gcr

for example for the arguments are

dotnet gcr ignatandrei AOP_With_Roslyn

NuGet at

Full Code at