David
David

Reputation: 2748

Get email with the diff changes from the last 'git pull'

I want to get an email that will display the last changes made by git. It should be nicely formatted similar to github ( + are green, - are red).

This is what I have done so far:

  1. Configured Jenkins to check every 5 minutes for changes, pull the changes, and send email.
  2. Installed 'Jenkins Email Extension Plugin', configured it to work with a custom 'jelly' template, which send also the console output to the email.
  3. I added a script to the build, which run 'git show'.

This way, I get the output of 'git show' to the email every 5 minutes if code is changed within this time.

What is missing is as follows:

  1. If two commits occurred within 5 minutes, it'll show only the diff made by the last one. I guess that's what git show does. I need all the changes from the current code, not all changes from last commit.
  2. It is not formatted nicely. it is just a plain text.

I'd appreciate any help here. Thanks.

Upvotes: 1

Views: 1231

Answers (1)

vonbrand
vonbrand

Reputation: 11791

git diff --color @{yesterday} (or whenever the last pull was done/differences are of interest) works nicely for me...

Upvotes: 1

Related Questions