Script to extract the git commit messages?

35 views
Skip to first unread message

John Mellor

unread,
Feb 26, 2015, 11:15:58 AM2/26/15
to jenkins...@googlegroups.com
I'd like to extract the git commit messages for the changes since the last build, and insert them into the debian changelog in the product. This will in many ways make each build self-documenting, and does things in a way that is already very well supported when building .debs.

Has anyone done this?

Christopher Orr

unread,
Feb 26, 2015, 1:57:54 PM2/26/15
to jenkins...@googlegroups.com
On 26/02/15 08:15, John Mellor wrote:
> I'd like to extract the git commit messages for the changes since the last build, and insert them into the debian changelog in the product. This will in many ways make each build self-documenting, and does things in a way that is already very well supported when building .debs.
>
> Has anyone done this?

The SCM changes since the last build are stored with the build and can
be retrieved, for example, from the API during a build, e.g.:
http://jenkins:8080/job/$JOB_NAME/$BUILD_NUMBER/api/xml?wrapper=changes&xpath=//changeSet//comment

That would give you an XML document with each commit message in a
separate tag.

See also: http://stackoverflow.com/a/11837662/234938

Regards,
Chris

John Mellor

unread,
Feb 26, 2015, 2:13:29 PM2/26/15
to jenkins...@googlegroups.com
Cool. I can simply strip off all the headers in a 1-line script and I'm left with something usable as a standard changelog. Thanks!
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/54EF6C97.4070501%40orr.me.uk.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages