3

Does anyone know about anyway to send out colored diffs of commits in bitbucket? I reckon you can do that by pushing out a HTTP call to your own server, but I need a solution in case you do not have your own server to rely on.

I am a big fan of SVN::Notify, so I would like to find some similar for git/mercurial commits in Bitbucket.

Any ideas welcome!

Thanks.

bruno.braga
  • 1,001
  • 12
  • 21

2 Answers2

1

Ended up needing to do this, so I built a HTTP wrapper on Google App Engine to send me colored emails, using pygments:

https://bitbucket.org/brunobraga/bitbucket-color-diff

enter image description here

Suggestions, comments, welcome!

bruno.braga
  • 1,001
  • 12
  • 21
  • +1 I didn't saw your solution right away, more tailored to your issue than my initial answer. – VonC Sep 02 '13 at 05:27
0

Regarding the SVN::Notify part, that would have to be implemented, through one of the BitBucket services, like (for example) the Bitbucket Email Diff Service.

You can then email the result of a colored diff:

# For Mercurial/Git
hg  diff -p --color=always $@ | less -R

More advanced options: "Coloured diff to HTML", or "Making Git show post-receive e-mails as an HTML color formatted diff".

The OP bruno.braga asks:

how do you call this if you can not rely on your own server?
You mean the local machine that executes the commit is in charge of sending the email instead?

I replied:

That could be a solution, or at least have an intermediate remote repo that you can control, which would be in charge of: pushing to the remote repo if some policies are enforced, and sending the appropriate emails.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • yeah, but how do you call this if you can not rely on your own server? You mean the local machine that executes the commit is in charge of sending the email instead? – bruno.braga Sep 25 '12 at 07:15
  • @bruno.braga that could be a solution, or at least have an intermediate remote repo that you can control, which would be in charge of: pushing to the remote repo if some policies are enforced, and sending the appropriate emails. – VonC Sep 25 '12 at 07:18
  • Thanks, I was actually wondering for a different solution, in which I do not need to rely on a local/own server to run a command to send emails.... but it looks like there isn't anything better :S – bruno.braga Sep 26 '12 at 09:16
  • @bruno.braga ok. I have included those comments in the answer for more visibility. – VonC Sep 26 '12 at 09:19