How to get commit message?

343 views
Skip to first unread message

Jonathan Fisher

unread,
Mar 31, 2015, 4:00:56 AM3/31/15
to go...@googlegroups.com
Hello all,

I'm missing one thing in our Go setup - I have have a Gradle file to upload our Android .apks to HockeyApp (using cURL) but I can't figure out how to get hold of the Git commit message - it's important that our testers know what they're testing so passing the commit message through to HockeyApp is crucial. 

We have the GO_REVISION environment variable, I was expecting there to be something like GO_REVISION_COMMIT_MESSAGE but there isn't,

any help much appreciated,

thanks,
Jonathan

Aravind SV

unread,
Mar 31, 2015, 8:21:13 AM3/31/15
to Jonathan Fisher, go...@googlegroups.com
Hello Jonathan,

You'll need to use the go revision environment variable and get it. There are two reasons for this:

1. There can be multiple repositories (dependencies) to a pipeline, and each can have its own commit messages. So, only one cannot be chosen, for instance.

2. Multiple commits can lead to a pipeline run. If you merged in a branch, for instance, then multiple commits would have led to this build. Ostensibly, the top commit is only one, but the commit messages which led to this could be multiple.

So, you'll need to do something along the lines of:
git log -n 1 --format=format:%B GO_REVISION

To really get all the commits that led to this pipeline run, you'll need to do something like:
git log GO_FROM_REVISION..GO_TO_REVISION

Hope that makes sense. Thinking about this, I can see how the top commit message could be useful, if it was in an environment variable, but it isn't.

Regards,
Aravind
 

--
You received this message because you are subscribed to the Google Groups "go-cd" group.
To unsubscribe from this group and stop receiving emails from it, send an email to go-cd+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jonathan Fisher

unread,
Mar 31, 2015, 8:29:39 AM3/31/15
to go...@googlegroups.com, jona...@fiskur.eu
Aah, of course I can get it that way - perfect, thank you!
Reply all
Reply to author
Forward
0 new messages