cake-contrib / Cake_Git

Cake AddIn that extends Cake with Git features using LibGit2 and LibGit2Sharp
https://cakebuild.net/extensions/cake-git
Other
39 stars 64 forks source link

How to define a custom commit message and getting it in GitLogTip? #33

Closed mdmoura closed 7 years ago

mdmoura commented 7 years ago

I am using the following in a build.cake file:

var lastCommit = GitLogTip("My repository path");

Information(@"Last commit {0}
    Short message: {1}
    Author:        {2}
    Authored:      {3:yyyy-MM-dd HH:mm:ss}
    Committer:     {4}
    Committed:     {5:yyyy-MM-dd HH:mm:ss}",
    lastCommit.Sha,
    lastCommit.MessageShort,
    lastCommit.Author.Name,
    lastCommit.Author.When,
    lastCommit.Committer.Name,
    lastCommit.Committer.When
 );

But where does the Message, e.g "Added Travis test folding" comes from?

I am using GitVersion to specify the version and I get the following message in GitLogInfo "Version 1.2.0"

devlead commented 7 years ago

I'm sorry, I'm not following on the issue, what's the relation to GitVersion?

GitLogTip will give you the latest commit in repo. So if you great a new commit that'll be what's returned.

mdmoura commented 7 years ago

@devlead My confusion ... So basically Commits but be done manually on local repository and then GitVersion gets that information and pushes it to Github? I am asking this because I also had GitCommit (http://cakebuild.net/api/Cake.Git/GitCommit/) in my Cake script. So when I run the build script it would add all files and commit to local repository, get the info and then push to Github. But in this case I wasn't sure how to define a custom Commit question. So this was my question.

devlead commented 7 years ago

To push your commit to a remote you use one of the GitPush aliases.