GithubHelp home page GithubHelp logo

git-commit-notifier / git-commit-notifier Goto Github PK

View Code? Open in Web Editor NEW

This project forked from wesabe/git-commit-notifier

182.0 182.0 64.0 947 KB

Sends HTML email commit messages splitting commits that were pushed in one step. Changes are highlighted per word.

License: MIT License

Ruby 98.46% CSS 1.08% HTML 0.46%

git-commit-notifier's Introduction

Git Commit Notifier

build status Code Climate Coverage Status

Description

This gem sends email commit messages splitting commits that were pushed in one step. The Email is delivered as text or HTML with changes refined per word. Emails have a scannable subject containing the first sentence of the commit as well as the author, project and branch name.

It's also possible to send a mail to a newsgroup using NNTP.

For example:

[rails][branch] Fix Brasilia timezone. [#1180 state:resolved]

A reply-to header is added containing the author of the commit. This makes follow up really simple. If multiple commits are pushed at once, emails are numbered in chronological order:

[rails][branch][0] Added deprecated warning messages to Float#months and Float#years deprecations.
[rails][branch][1] Enhance testing for fractional days and weeks. Update changelog.

Example email:

Example

by Bodo Tasche (bodo 'at' wannawork 'dot' de), Akzhan Abdulin (akzhan 'dot' abdulin 'at' gmail 'dot' com), Csoma Zoltan (info 'at' railsprogrammer 'dot' net)

Requirements

Installing and Configuring

Install the gem:

gem install git-commit-notifier

After you installed the gem, you need to configure your git repository. Add a file called "post-receive" to the "hooks" directory of your git repository with this content:

#!/bin/sh
git-commit-notifier path_to_config.yml

(Don't forget to make that file executable.)

An example for the config file can be found in config/git-notifier-config.example.yml.

If you want to send mails on each commit instead on each push, you should add a file called "post-commit" with this content:

#!/bin/sh
echo "HEAD^1 HEAD refs/heads/master" | git-commit-notifier path_to_config.yml

Decorate files and commit ids with link to a webview

You need change next line in config file link_files: none

Possible values: none, gitweb, gitorious, cgit, trac, gitlabhq, or redmine

  • "cgit" you can omit "project". In this case repository name will be used by default

Integration with Redmine, Bugzilla, MediaWiki

Git-commit-notifier supports easy integration with Redmine, Bugzilla and MediaWiki. All you need is to uncomment the according line in the configuration and change the links to your software installations instead of example ones (no trailing slash please).

  • "BUG 123" sentence in commit message will be replaced with link to bug in Bugzilla.
  • "refs #123" and "fixes #123" sentences in commit message will be replaced with link to issue in Redmine.
  • "[[SomePage]]" sentence in commit message will be replaced with link to page in MediaWiki.

Github-flavored Webhooks

Git-commit-notifier can send a webhook just after sending a mail. This webhook will be sent in a POST request to a server specified in the configuration (webhook / url), under JSON format following the same syntax as Github webhooks.

  • Cogbot is the irc bot for which that feature was originally designed. Only a subset of the Github json file was required for that one so maybe it won't work on all Github webhook receivers.
  • Github webhooks describes the json format expected and some hints on how to design a webhook receiver. Be sure to extract the 'ref' from the json. An example Sinatra server to use git-commit-notifier might look like:
require 'rubygems'
require 'json'
require 'sinatra'

post '/' do
  if params[:payload]
    push = JSON.parse(params[:payload])

    repo = push['repository']['name']
    before_id = push['before']
    after_id = push['after']
    ref = push['ref']

    system("/usr/local/bin/change-notify.sh #{repo} #{before_id} #{after_id} #{ref}")
  end
end

change-notify.sh might look like:

#!/bin/sh

set -e

EXPECTED_ARGS=4
E_BADARGS=65

if [ $# -ne $EXPECTED_ARGS ]
then
    echo "Usage: `basename $0` {repo} {before commit ID} {after commit ID} {ref}"
    exit $E_BADARGS
fi

REPO=$1
BEFORE=$2
AFTER=$3
REF=$4
CONFIG=myconfig.yml

# Assume repository exists in directory and user has pull access
cd /repository/$REPO
git pull
echo $BEFORE $AFTER $REF | /usr/local/bin/git-commit-notifier $CONFIG

Integration of links to other websites

If you need integration with other websites not supported by git-commit-notifier you can use the message_map property. For that you need to know the basics of regular expressions syntax.

Each key of message_map is a case sensitive Regexp pattern, and its value is the replacement string. Every matched group (that defined by round brackets in regular expression) will be automatically substituted instead of \1-\9 backreferences in replacement string where the number after the backslash informs which group should be substituted instead of the backreference. The first matched group is known as \1.

For example, when we need to expand "follow 23" to http://example.com/answer/23, simply type this:

  '\bfollow\s+(\d+)': 'http://example.com/answer/\1'

Key and value are each enclosed in single quotes. \b means that "follow" must not be preceded by other word chars, so "befollow" will not match but "be follow" will match. After "follow" we expect one or more spaces followed by group of one or more digits. The \1 in the result url will be replaced with the matched group.

More examples can be found in the config file.

Logic of commits handling

By default all commits are tracked through the whole repository so after a merge you should not receive messages about those commits already posted in other branches.

This behaviour can be changed using unique_commits_per_branch option. When it's true, you should receive new message about commit when it's merged in other branch.

Yet another option, skip_commits_older_than (in days), should be used to not inform about old commits in processes of forking, branching etc.

Note on development

It's easy to fork and clone our repository.

Next step is installation of required dependencies:

cd $GCN_REPO
bundle install
rake # Run specs

or

gem build git-commit-notifier.gemspec
[sudo] gem install git-commit-notifier-0.11.10.gem

Now you can create test configuration file (example provided in config directory) and test your code over any test repository in this manner:

cd $TEST_REPO
echo "HEAD^1 HEAD refs/heads/master" | $GCN_REPO/local-run.rb $PATH_TO_YAML_CONFIG

Note on Patches/Pull Requests

  • Fork the project.
  • Make your feature addition or bug fix.
  • Add tests for it. This is important so I don't break it in a future version unintentionally.
  • Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
  • Send me a pull request. Bonus points for topic branches.

Credits

Thanks for putpat.tv, Primalgrasp and Undev for sponsoring this work.

License

MIT License, see the {file:LICENSE}.

git-commit-notifier's People

Contributors

akzhan avatar arkadius avatar bitboxer avatar digitalcardboard avatar fonsrademakers avatar h13ronim avatar holzman avatar indirect avatar jdberry avatar kconnor13 avatar liuhui998 avatar m1h4 avatar marcmengel avatar masteriv avatar mdaguete avatar mfn avatar mgedmin avatar mixonic avatar mose avatar pcabido avatar pmorch avatar redox avatar seanhussey avatar sheenobu avatar sloory avatar spmohanty avatar timboudreau avatar troter avatar tsteur avatar tuxdude avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

git-commit-notifier's Issues

notifier hanging / memleak/ cpuhog

This happens to me randomly, and just occured but dunno how to replicate

git commit notifier randomly hangs and just stalls the push

Pushing to github:aikar/cosmos
To github:aikar/cosmos
   2b5706f..7e7ee7c  master -> master
Pushing to git:cosmos
remote: Sending mail...   

When I looked at my server, I saw this:

USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
git       4370  0.0  0.0  80240  2604 ?        S    22:02   0:00  |   \_ sshd: git@notty     
git       4371  0.0  0.0   9652   720 ?        Ss   22:02   0:00  |       \_ git shell -c git-receive-pack 'repositories/cosmos.git'
git       4372  0.0  0.0  10712  1108 ?        S    22:02   0:00  |           \_ git receive-pack repositories/cosmos.git
git       4380  0.0  0.0  10712   312 ?        S    22:02   0:00  |               \_ git receive-pack repositories/cosmos.git
git       4381  0.0  0.0  10724  1388 ?        S    22:02   0:00  |               \_ /bin/sh hooks/post-receive
git       4382 99.0 51.6 2146892 2094092 ?     R    22:02   1:43  |                   \_ /usr/bin/ruby1.8 /var/lib/gems/1.8/bin/git-commit-notifier /etc/git-commit-notifier.cfg

2 gb of memory...

I killed the process from server and this printed:

remote: /var/lib/gems/1.8/gems/tamtam-0.0.3/lib/tamtam.rb:83:in `apply_to': Trouble on style td on element <td>&nbsp;cat&nbsp;&gt;&nbsp;confinc&nbsp;&lt;&lt;&nbsp;'END'</td> (InvalidStyleException)        
remote:     from /var/lib/gems/1.8/gems/tamtam-0.0.3/lib/tamtam.rb:24:in `inline'        
remote:     from /var/lib/gems/1.8/gems/tamtam-0.0.3/lib/tamtam.rb:23:in `each'        
remote:     from /var/lib/gems/1.8/gems/tamtam-0.0.3/lib/tamtam.rb:23:in `inline'        
remote:     from /var/lib/gems/1.8/gems/tamtam-0.0.3/lib/tamtam.rb:20:in `each'        
remote:     from /var/lib/gems/1.8/gems/tamtam-0.0.3/lib/tamtam.rb:20:in `inline'        
remote:     from /var/lib/gems/1.8/gems/git-commit-notifier-0.8.1/bin/../lib/emailer.rb:39:in `generate_message'        
remote:     from /var/lib/gems/1.8/gems/git-commit-notifier-0.8.1/bin/../lib/emailer.rb:87:in `send'        
remote:     from /var/lib/gems/1.8/gems/git-commit-notifier-0.8.1/bin/../lib/commit_hook.rb:113:in `run'        
remote:     from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `each_with_index'        
remote:     from /var/lib/gems/1.8/gems/git-commit-notifier-0.8.1/bin/../lib/commit_hook.rb:97:in `each'        
remote:     from /var/lib/gems/1.8/gems/git-commit-notifier-0.8.1/bin/../lib/commit_hook.rb:97:in `each_with_index'        
remote:     from /var/lib/gems/1.8/gems/git-commit-notifier-0.8.1/bin/../lib/commit_hook.rb:97:in `run'        
remote:     from /var/lib/gems/1.8/gems/git-commit-notifier-0.8.1/bin/git-commit-notifier:20        
remote:     from /var/lib/gems/1.8/bin/git-commit-notifier:19:in `load'        
remote:     from /var/lib/gems/1.8/bin/git-commit-notifier:19        
To git:cosmos
   2b5706f..7e7ee7c  master -> master

group_email_by_push=true: different subject depending on Ruby version

I don't know if anyone cares, but we happened to see a difference now that we were using an outdated git-commit-notifier version for a long time, recently upgraded, and saw this different.

When group_email_by_push is true, the subject between 1.8 vs. 1.9. , specifically ruby 1.8.7 (2011-06-30 patchlevel 352) [i686-linux] against ruby 1.9.2p290 (2011-07-09 revision 32553) [i686-linux], is different.

In Ruby 1.8, the Subject is the message of the last commit in the email.

In Ruby 1.9, the Subject is the message of the first commit in the email.

If I were to make a call I'd say the Ruby 1.9 behavior is the expected one; it's also less confusing because the Subject matches the first message to be seen in the email. You kind of expect to see this commit immediately after you already read the Subject/message line of it.

sendmail not working

Sendmail is currently not working

sendmail: fatal: Recipient addresses must be specified on the command line or via the -t option
postdrop: warning: stdin: unexpected EOF in data, record type 78 length 197
postdrop: fatal: uid=107: malformed input

using smtp the mail will be sent.

Sometimes HTML Diff is empty (wrong)

Sometimes HTML Diff is empty, while plain text diff is not empty, so it indicates bad behaviour.

We need to add failed spec and fix code later.

message_integration not working?

So, I set up this hook and it generates emails fine, etc. I have the link_files option set for redmine and it works great as well, even though I am using ChiliProject. The problem comes when I try using the message_integration. I have it set to:

message_integration:
redmine: http://url.for.my.install

Unfortunately, adding "refs #1234" in to a commit message does not ever result in a link being created. Is this an actual bug or is there something I am doing wrong?

Thanks!

A lot of messages when merging master to some branch

The normal work process for us is to use topic branches. It is simple - just create a brunch, make work in it and and after testing merge it into master. But we are also working in long living branches and we sometimes merge to that branches from master.

When we merge the master into some branch we get a lot of messages from git-commit-notifier. Actually we get every commit that was made in master for the second time.

So this is the problem. (maybe it has something in common with issue #11)

I see 2 possible solutions for this:

  • just fix this behavior
  • make setting in config file where you can specify branches. Only commits that are made into branches specified will be send to email.

Crash if large amount of files added

If several hundred files are pushed, the mail gets too big and the emailer crashes

/usr/local/lib/ruby/1.8/net/protocol.rb:301:in `slice!': Stack overflow in regexp matcher: /\A.*(?:\n|\r\n|\r(?!\z))/n (RegexpError)
from /usr/local/lib/ruby/1.8/net/protocol.rb:301:in `each_crlf_line'
from /usr/local/lib/ruby/1.8/net/protocol.rb:312:in `buffer_filling'
from /usr/local/lib/ruby/1.8/net/protocol.rb:310:in `step'
from /usr/local/lib/ruby/1.8/net/protocol.rb:310:in `buffer_filling'
from /usr/local/lib/ruby/1.8/net/protocol.rb:300:in `each_crlf_line'
from /usr/local/lib/ruby/1.8/net/protocol.rb:245:in `write_message_0'
from /usr/local/lib/ruby/1.8/net/protocol.rb:344:in `__send__'
from /usr/local/lib/ruby/1.8/net/protocol.rb:344:in `write'
from /usr/local/lib/ruby/1.8/net/protocol.rb:355:in `puts'
from /usr/local/lib/ruby/gems/1.8/gems/git-commit-notifier-0.5.0/bin/../lib/emailer.rb:50:in `perform_delivery_smtp'
from /usr/local/lib/ruby/gems/1.8/gems/git-commit-notifier-0.5.0/bin/../lib/emailer.rb:49:in `each'
from /usr/local/lib/ruby/gems/1.8/gems/git-commit-notifier-0.5.0/bin/../lib/emailer.rb:49:in `perform_delivery_smtp'
from /usr/local/lib/ruby/1.8/net/protocol.rb:274:in `call'
from /usr/local/lib/ruby/1.8/net/protocol.rb:274:in `write_message_by_block'
from /usr/local/lib/ruby/1.8/net/protocol.rb:289:in `using_each_crlf_line'
from /usr/local/lib/ruby/1.8/net/protocol.rb:272:in `write_message_by_block'
from /usr/local/lib/ruby/1.8/net/protocol.rb:168:in `writing'
from /usr/local/lib/ruby/1.8/net/protocol.rb:271:in `write_message_by_block'
from /usr/local/lib/ruby/1.8/net/smtp.rb:880:in `data'
from /usr/local/lib/ruby/1.8/net/smtp.rb:921:in `critical'
from /usr/local/lib/ruby/1.8/net/smtp.rb:875:in `data'
from /usr/local/lib/ruby/1.8/net/smtp.rb:709:in `open_message_stream'
from /usr/local/lib/ruby/gems/1.8/gems/git-commit-notifier-0.5.0/bin/../lib/emailer.rb:48:in `perform_delivery_smtp'
from /usr/local/lib/ruby/1.8/net/smtp.rb:526:in `start'
from /usr/local/lib/ruby/1.8/net/smtp.rb:463:in `start'
from /usr/local/lib/ruby/gems/1.8/gems/git-commit-notifier-0.5.0/bin/../lib/emailer.rb:43:in `perform_delivery_smtp'
from /usr/local/lib/ruby/gems/1.8/gems/git-commit-notifier-0.5.0/bin/../lib/emailer.rb:97:in `send'
from /usr/local/lib/ruby/gems/1.8/gems/git-commit-notifier-0.5.0/bin/../lib/commit_hook.rb:55:in `run'
from /usr/local/lib/ruby/gems/1.8/gems/git-commit-notifier-0.5.0/bin/../lib/diff_to_html.rb:277:in `each_with_index'
from /usr/local/lib/ruby/gems/1.8/gems/git-commit-notifier-0.5.0/bin/../lib/commit_hook.rb:51:in `each'
from /usr/local/lib/ruby/gems/1.8/gems/git-commit-notifier-0.5.0/bin/../lib/commit_hook.rb:51:in `each_with_index'
from /usr/local/lib/ruby/gems/1.8/gems/git-commit-notifier-0.5.0/bin/../lib/commit_hook.rb:51:in `run'
from /usr/local/lib/ruby/gems/1.8/gems/git-commit-notifier-0.5.0/bin/git-commit-notifier:11
from /usr/local/bin/git-commit-notifier:19:in `load'
from /usr/local/bin/git-commit-notifier:19

Promlem with utf-8 texts

I'm using version 0.8.0 and I have problems with unicode.

I have file a.txt:

ะฐะฑะฒ
ะฐะฑะฒ

Then I change it:

ะฐะฑะฒ
ะณะดะต

Commit and push.

In my mail I have both correct utf-8 symbols (the ones that are not changed) and the mess with the symbols that are chaned in the commit. Here is what I've got in the mail:

ะฐะฑะฒ
รยฐรยฑรยฒ
รยณรยดรยต

And here is the screenshot: http://yfrog.com/jmf05yp

1.9.1/1.9.2: diff_to_html.rb:320:in `check_handled_commits': undefined method `to_a' for "....

With current master I get this on 1.9.1 and 1.9.2 :
/data/git/git-commit-notifier/lib/diff_to_html.rb:320:in check_handled_commits': undefined methodto_a' for "b77509dca97b0fddf9b682656b7ac8817d4b2a5d":String (NoMethodError)
from /data/git/git-commit-notifier/lib/diff_to_html.rb:351:in diff_between_revisions' from /data/git/git-commit-notifier/lib/commit_hook.rb:63:inrun'
from /data/git/git-commit-notifier/bin/git-commit-notifier:21:in <main>' 1.8.6 didn't work either, I get /data/git/git-commit-notifier/bin/../lib/diff_to_html.rb:348:indiff_between_revisions': wrong argument type Symbol (expected Proc) (TypeError)
from /data/git/git-commit-notifier/bin/../lib/commit_hook.rb:63:in `run'
from /data/git/git-commit-notifier/bin/git-commit-notifier:21
there, but I just figured it's too old anyway.

I got it working with 1.8.7 only.

Add more settings to the config file

It's stupid to configure the system in two places : the config file and the git config. Add the git config params to the config file and get the git config stuff only if the values are not set in the config file.

These params need to be moved:

git config hooks.mailinglist
git config hooks.emailprefix

Need help wih message_map:

I've successfully installed git-commit-notifier on my server. The emails came. Everything is nearly perfect. The last thing I want to to is to place the link to web system that tracks all commits. The system is trac, it is not nativly supported by git-commit-notifier, but the docs say "if you need integration with any other software use message_map property."

So, I've placed in the config file:

message_map:
  'Commit: (\w*)': 'https://example.com/trac/changeset/\1'

But this is not working. Can you please explain what should I write in config to make it work.

previously.txt is always created in mode 644

The previously.txt control file is always created in 644 mode, this creates problems, as my repo is shared among a unix group and used by different users.

For this, the mode should be 664.

BR,
Sebastian

Fix folder structure

Today all source files of the gem placed in root of ./lib gem folder.

It is wrong because it's source of possible resolution conflicts.

We need to move all library files to ./lib/git-commit-notifier subfolder.

Identify rebase

It would be nice if the notifier could identify rebase and notify you in such case.

Mac mail.app, and iPhone mail.app: Sometimes there's weird characters in a diff

Occasionally happens when I'm committing a bunch of files. I viewed the email in Gmail and it looks fine but in Mac mail.app and the iPhone's native mail client people complain to me about seeing the characters. The sample email below was from a commit modifying css, js, and php files. All of them showed the ร‚ character.

Changed file application/views/game/layout.php
14 14 ร‚ ร‚ ร‚ ร‚ ร‚ <metaร‚ name="viewport"ร‚ content="width=device-width;ร‚ initial-scale=1.0;ร‚ maximum-scale=1.0;ร‚ user-scalable=0;"/>
15 15 ร‚
16 16 ร‚
17 ร‚ ร‚ ร‚ ร‚ ร‚ <linkร‚ rel="stylesheet"ร‚ type="text/css"ร‚ href="/css/zqtouch.css"ร‚ />
17 ร‚ ร‚ ร‚ ร‚ ร‚ <linkร‚ rel="stylesheet"ร‚ type="text/css"ร‚ href="/css/platform/zqtouch.css"ร‚ />

Note that this is a minor issue, compared to the issue where a commit that's too large will choke GCN. :)

Support for various encodings

For now - all released versions of git-commit-notifier support correctly only ASCII charset.

Latest patches extend support to generic utf-8 charset.

But we need to support any charsets (by converting at runtime using iconv etc.) - a lot of repositories use very special encoding like windows-1251 etc.

Ignore empty merge commits

If a fast-forward merge happens, the merge can be ingnored while sending mails. there is no important contant in that.

notifier doesnt handle tag only commit well

I Updated tags on my repo and pushed them and the notifier blew up.

[Tyrial] ------ [10:39 PM] ------ [aikar] --- [master] --- [~/projects/wormhole]

git push --tags
Counting objects: 2, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (2/2), 279 bytes, done.
Total 2 (delta 0), reused 0 (delta 0)
To github:aikar/wormhole

  • [new tag] 1.0 -> 1.0
  • [new tag] 2.0 -> 2.0
    Counting objects: 2, done.
    Delta compression using up to 4 threads.
    Compressing objects: 100% (2/2), done.
    Writing objects: 100% (2/2), 279 bytes, done.
    Total 2 (delta 0), reused 0 (delta 0)
    remote: Sending mail...
    remote: /var/lib/gems/1.9.1/gems/git-commit-notifier-0.9.1/lib/git_commit_notifier/git.rb:16:in branch_commits': uninitialized constant Class::Git (NameError) remote: from /var/lib/gems/1.9.1/gems/git-commit-notifier-0.9.1/lib/git_commit_notifier/diff_to_html.rb:385:indiff_between_revisions'
    remote: from /var/lib/gems/1.9.1/gems/git-commit-notifier-0.9.1/lib/git_commit_notifier/commit_hook.rb:68:in run' remote: from /var/lib/gems/1.9.1/gems/git-commit-notifier-0.9.1/lib/git_commit_notifier/executor.rb:14:inrun!'
    remote: from /var/lib/gems/1.9.1/gems/git-commit-notifier-0.9.1/bin/git-commit-notifier:15:in <top (required)>' remote: from /var/lib/gems/1.9.1/bin/git-commit-notifier:19:inload'
    remote: from /var/lib/gems/1.9.1/bin/git-commit-notifier:19:in `'
    To git:wormhole
  • [new tag] 1.0 -> 1.0
  • [new tag] 2.0 -> 2.0

1.9.2 error: `require': no such file to load -- sha1 (LoadError)

With 1.9.2 I get the following error:
internal:lib/rubygems/custom_require:29:in require': no such file to load -- sha1 (LoadError) from <internal:lib/rubygems/custom_require>:29:inrequire'
from /usr/local/rvm/gems/ruby-1.9.2-p0/gems/git-commit-notifier-0.8.0/lib/commit_hook.rb:4:in <top (required)>' from <internal:lib/rubygems/custom_require>:29:inrequire'
from internal:lib/rubygems/custom_require:29:in require' from /usr/local/rvm/gems/ruby-1.9.2-p0/gems/git-commit-notifier-0.8.0/bin/git-commit-notifier:5:in<top (required)>'
from /usr/local/rvm/gems/ruby-1.9.2-p0/bin/git-commit-notifier:19:in load' from /usr/local/rvm/gems/ruby-1.9.2-p0/bin/git-commit-notifier:19:in

'

When I change sha1 to digest/sha1 I get an follow error:
/usr/local/rvm/gems/ruby-1.9.2-p0/gems/git-commit-notifier-0.8.0/lib/diff_to_html.rb:300:in block in diff_between_revisions': undefined methodfind' for "dbf23a5eacac8c655cd71d15d7ce5515b38a49e7":String (NoMethodError)
from /usr/local/rvm/gems/ruby-1.9.2-p0/gems/git-commit-notifier-0.8.0/lib/diff_to_html.rb:300:in reject!' from /usr/local/rvm/gems/ruby-1.9.2-p0/gems/git-commit-notifier-0.8.0/lib/diff_to_html.rb:300:indiff_between_revisions'
from /usr/local/rvm/gems/ruby-1.9.2-p0/gems/git-commit-notifier-0.8.0/lib/commit_hook.rb:41:in run' from /usr/local/rvm/gems/ruby-1.9.2-p0/gems/git-commit-notifier-0.8.0/bin/git-commit-notifier:13:in<top (required)>'
from /usr/local/rvm/gems/ruby-1.9.2-p0/bin/git-commit-notifier:19:in load' from /usr/local/rvm/gems/ruby-1.9.2-p0/bin/git-commit-notifier:19:in

'
I also suspect that I'm missing something trivial, because I cannot get it work in any version from 1.8.7 to 1.9.2 . There is always just digest/sha1.so available on my system too.

With 1.8.6 I get another, unique, error:
/usr/local/rvm/gems/ruby-1.8.6-p399/gems/git-commit-notifier-0.8.0/bin/../lib/diff_to_html.rb:347:in message_map': undefined methodeach_pair' for nil:NilClass (NoMethodError)
from /usr/local/rvm/gems/ruby-1.8.6-p399/gems/git-commit-notifier-0.8.0/bin/../lib/diff_to_html.rb:261:in message_array_as_html' from /usr/local/rvm/gems/ruby-1.8.6-p399/gems/git-commit-notifier-0.8.0/bin/../lib/diff_to_html.rb:313:indiff_between_revisions'
from /usr/local/rvm/gems/ruby-1.8.6-p399/gems/git-commit-notifier-0.8.0/bin/../lib/diff_to_html.rb:302:in each_with_index' from /usr/local/rvm/gems/ruby-1.8.6-p399/gems/git-commit-notifier-0.8.0/bin/../lib/diff_to_html.rb:304:ineach'
from /usr/local/rvm/gems/ruby-1.8.6-p399/gems/git-commit-notifier-0.8.0/bin/../lib/diff_to_html.rb:304:in each_with_index' from /usr/local/rvm/gems/ruby-1.8.6-p399/gems/git-commit-notifier-0.8.0/bin/../lib/diff_to_html.rb:304:indiff_between_revisions'
from /usr/local/rvm/gems/ruby-1.8.6-p399/gems/git-commit-notifier-0.8.0/bin/../lib/commit_hook.rb:41:in run' from /usr/local/rvm/gems/ruby-1.8.6-p399/gems/git-commit-notifier-0.8.0/bin/git-commit-notifier:13 from /usr/local/rvm/gems/ruby-1.8.6-p399/bin/git-commit-notifier:19:inload'
from /usr/local/rvm/gems/ruby-1.8.6-p399/bin/git-commit-notifier:19
O

diff_to_html has issues with message_map config

Using the given example config, (e.g. message_map being empty), the following error is triggered on commit.

Sending mail...
/usr/lib64/ruby/gems/1.8/gems/git-commit-notifier-6.6.6/bin/../lib/diff_to_html.rb:369:in message_map': undefined methodeach_pair' for nil:NilClass (NoMethodError)
from /usr/lib64/ruby/gems/1.8/gems/git-commit-notifier-6.6.6/bin/../lib/diff_to_html.rb:281:in message_array_as_html' from /usr/lib64/ruby/gems/1.8/gems/git-commit-notifier-6.6.6/bin/../lib/diff_to_html.rb:333:indiff_between_revisions'
from /usr/lib64/ruby/gems/1.8/gems/git-commit-notifier-6.6.6/bin/../lib/diff_to_html.rb:322:in each_with_index' from /usr/lib64/ruby/gems/1.8/gems/git-commit-notifier-6.6.6/bin/../lib/diff_to_html.rb:324:ineach'
from /usr/lib64/ruby/gems/1.8/gems/git-commit-notifier-6.6.6/bin/../lib/diff_to_html.rb:324:in each_with_index' from /usr/lib64/ruby/gems/1.8/gems/git-commit-notifier-6.6.6/bin/../lib/diff_to_html.rb:324:indiff_between_revisions'
from /usr/lib64/ruby/gems/1.8/gems/git-commit-notifier-6.6.6/bin/../lib/commit_hook.rb:41:in run' from /usr/lib64/ruby/gems/1.8/gems/git-commit-notifier-6.6.6/bin/git-commit-notifier:18 from /usr/bin/git-commit-notifier:19:inload'
from /usr/bin/git-commit-notifier:19
error: hooks/post-receive exited with error code 1

After pushing huge commit into remote repo, "Sending mail..." message stuck

I have many files in my project. Thousands of files. When I doing first push of my project into remote repo and after project is pushed - "Sending mail..." message stucks. I don't want to wait while email will be sent to developers. Is there a option by which the process that sending mails would work in the background?

gitweb link_files only works for top-level projects

We sometimes like to organize our repositories into folders, but the notifier doesn't produce links for these correctly.

Example-wise, consider a directory that contain three git repos like this:

  • fizzle.git
  • goggle.git
  • bubble.git

The respective urls for these are:

The git-commit-notifier produces links to these repos just fine.

However, if we want to organize fizzle.git and goggle.git together in a directory "funky" like this:

  • funky/fizzle.git
  • funky/goggle.git
  • bubble.git

.. git-commit-notifier keeps on generating links the way they were before, instead of how they should be:

Write doc how to use git-commit-notifier after commit

I have one repository that has no remotes. It situated only local on one server. I need to send mails after earch git commit.

The normal way of using git-commit-notifier is to write hook post-receive that will send mail after the push to the remote repository.

I've just created post-commit hook with the same content that was in post-receive, but this is not working. I've got error:

/var/lib/gems/1.8/gems/git-commit-notifier-0.8.0/bin/git-commit-notifier:12: undefined method `strip' for nil:NilClass (NoMethodError)
        from /var/lib/gems/1.8/bin/git-commit-notifier:19:in `load'
        from /var/lib/gems/1.8/bin/git-commit-notifier:19

So, how can I setup git-commit-notifier to sena mails after each commit?

Email error with 0.9.0

installed the new version with branch restrictions and get the following:
remote: Sending mail...
remote: sendmail: fatal: gitosis(109): No recipient addresses found in message header
remote: postdrop: warning: stdin: unexpected EOF in data, record type 78 length 214
remote: postdrop: fatal: uid=109: malformed input

diff_to_html.rb:318:in `split': invalid byte sequence in US-ASCII (ArgumentError)

When pushing commits to repository containing e.g. UTF8 characters, I get this:

remote: /usr/local/rvm/gems/ruby-1.9.2-p290/gems/git-commit-notifier-0.10.2/lib/git_commit_notifier/diff_to_html.rb:318:in `split': invalid byte sequence in US-ASCII (ArgumentError)
remote:         from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/git-commit-notifier-0.10.2/lib/git_commit_notifier/diff_to_html.rb:318:in `extract_commit_info_from_git_show_output'
remote:         from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/git-commit-notifier-0.10.2/lib/git_commit_notifier/diff_to_html.rb:433:in `diff_for_commit'
remote:         from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/git-commit-notifier-0.10.2/lib/git_commit_notifier/diff_to_html.rb:509:in `block in diff_between_revisions'
remote:         from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/git-commit-notifier-0.10.2/lib/git_commit_notifier/diff_to_html.rb:506:in `each'
remote:         from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/git-commit-notifier-0.10.2/lib/git_commit_notifier/diff_to_html.rb:506:in `diff_between_revisions'
remote:         from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/git-commit-notifier-0.10.2/lib/git_commit_notifier/commit_hook.rb:87:in `run'
remote:         from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/git-commit-notifier-0.10.2/lib/git_commit_notifier/executor.rb:14:in `run!'
remote:         from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/git-commit-notifier-0.10.2/bin/git-commit-notifier:15:in `<top (required)>'
remote:         from /usr/local/rvm/gems/ruby-1.9.2-p290/bin/git-commit-notifier:19:in `load'
remote:         from /usr/local/rvm/gems/ruby-1.9.2-p290/bin/git-commit-notifier:19:in `<main>'

What I mean is that the diff change I did to one file contained UTF8 characters on which the diff_to_html library chokes.

Regular diffs in text/plain output

I've been digging up but apparently I'm unable to tweak/flip a configuration option
regarding the output of diffs. I'm guessing (as you require diff-lcs) that this might be
done from another place?

What I want is that text/plain diffs have regular '-' '+' instead of line
numbers as it's rather ``impossible'' to differentiate parse and/or read
when output is rendered on vt-like terminals (e-mail clients such as mutt).

include_branches not working

I have added this:

include_branches: [master,branchname]

but sadly the commits for the master branch are excluded, aswel.

Writing objects: 100% (28/28), 4.71 KiB, done.
Total 28 (delta 20), reused 0 (delta 0)
Supressing mail for branch master...

Bad revision range passed to git when pushing

I got this error when pushing a merge commit on git-commit-notifier 0.10.2 (on Mac OS X Snow Leopard):
Too many dots seem to be added when building the revision range.

Sending mail...
fatal: ambiguous argument 'bd375ae.....1579c6a...': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions
/Library/Ruby/Gems/1.8/gems/git-commit-notifier-0.10.2/lib/git_commit_notifier/git.rb:5:in `from_shell': git log bd375ae.....1579c6a... --name-status --oneline failed (ArgumentError)
 from /Library/Ruby/Gems/1.8/gems/git-commit-notifier-0.10.2/lib/git_commit_notifier/git.rb:22:in `changed_files'
 from /Library/Ruby/Gems/1.8/gems/git-commit-notifier-0.10.2/lib/git_commit_notifier/diff_to_html.rb:438:in `diff_for_commit'
 from /Library/Ruby/Gems/1.8/gems/git-commit-notifier-0.10.2/lib/git_commit_notifier/diff_to_html.rb:509:in `diff_between_revisions'
 from /Library/Ruby/Gems/1.8/gems/git-commit-notifier-0.10.2/lib/git_commit_notifier/diff_to_html.rb:506:in `each'
 from /Library/Ruby/Gems/1.8/gems/git-commit-notifier-0.10.2/lib/git_commit_notifier/diff_to_html.rb:506:in `diff_between_revisions'
 from /Library/Ruby/Gems/1.8/gems/git-commit-notifier-0.10.2/lib/git_commit_notifier/commit_hook.rb:121:in `run'
 from /Library/Ruby/Gems/1.8/gems/git-commit-notifier-0.10.2/lib/git_commit_notifier/executor.rb:14:in `run!'
 from /Library/Ruby/Gems/1.8/gems/git-commit-notifier-0.10.2/bin/git-commit-notifier:15
 from /usr/bin/git-commit-notifier:19:in `load'
 from /usr/bin/git-commit-notifier:19
error: hooks/post-receive exited with error code 1

Remove Hpricot

We should remove hpricot as gem that sometimes hardly to setup in production.

Take a note that with Premailer we need no Hpricot (Premailer already moved to Nokogiri in latest release).

So we need to simply update the specs to use Nokogiri.

crashs on RHEL 5.5

Whenever there is a new commit, I get the following crash:

$ git-commit-notifier git-notifier-config.yml a7c91f 5de7899 refs/heads/trunk
Sending mail...
*** glibc detected *** /usr/bin/ruby: malloc(): memory corruption: 0x00002ab64d505c08 ***
======= Backtrace: =========
/lib64/libc.so.6[0x37be672fae]
/lib64/libc.so.6(__libc_malloc+0x6e)[0x37be674cde]
/usr/lib64/libruby.so.1.8(ruby_xmalloc+0x5a)[0x2ab64b75f18a]
/usr/lib64/libruby.so.1.8[0x2ab64b7a5537]
/usr/lib/ruby/gems/1.8/gems/hpricot-0.8.3/lib/hpricot_scan.so(rb_hpricot_token+0x326)[0x2ab64cefc296]
/usr/lib/ruby/gems/1.8/gems/hpricot-0.8.3/lib/hpricot_scan.so(hpricot_scan+0x53c0)[0x2ab64cf02020]
/usr/lib64/libruby.so.1.8[0x2ab64b74898e]
/usr/lib64/libruby.so.1.8[0x2ab64b748ea8]
/usr/lib64/libruby.so.1.8[0x2ab64b74fc26]
/usr/lib64/libruby.so.1.8[0x2ab64b7489aa]
/usr/lib64/libruby.so.1.8[0x2ab64b748ea8]
/usr/lib64/libruby.so.1.8[0x2ab64b74fc26]
/usr/lib64/libruby.so.1.8[0x2ab64b75285f]
/usr/lib64/libruby.so.1.8[0x2ab64b74ffd5]
/usr/lib64/libruby.so.1.8[0x2ab64b7489aa]
/usr/lib64/libruby.so.1.8[0x2ab64b748ea8]
/usr/lib64/libruby.so.1.8[0x2ab64b74fd59]
/usr/lib64/libruby.so.1.8[0x2ab64b74f015]
/usr/lib64/libruby.so.1.8[0x2ab64b74f015]
/usr/lib64/libruby.so.1.8[0x2ab64b7489aa]
/usr/lib64/libruby.so.1.8[0x2ab64b748ea8]
/usr/lib64/libruby.so.1.8[0x2ab64b74fd59]
/usr/lib64/libruby.so.1.8[0x2ab64b74ff3c]
/usr/lib64/libruby.so.1.8[0x2ab64b74efce]
/usr/lib64/libruby.so.1.8[0x2ab64b7489aa]
/usr/lib64/libruby.so.1.8[0x2ab64b748ea8]
/usr/lib64/libruby.so.1.8[0x2ab64b74fc26]
/usr/lib64/libruby.so.1.8[0x2ab64b74eef9]
/usr/lib64/libruby.so.1.8[0x2ab64b7489aa]
/usr/lib64/libruby.so.1.8[0x2ab64b748ea8]
/usr/lib64/libruby.so.1.8[0x2ab64b750155]
/usr/lib64/libruby.so.1.8[0x2ab64b7489aa]
/usr/lib64/libruby.so.1.8[0x2ab64b748ea8]
/usr/lib64/libruby.so.1.8[0x2ab64b74fc26]
/usr/lib64/libruby.so.1.8[0x2ab64b753baf]
/usr/lib64/libruby.so.1.8(rb_yield_values+0xc1)[0x2ab64b755211]
/usr/lib64/libruby.so.1.8[0x2ab64b73a6fd]
/usr/lib64/libruby.so.1.8[0x2ab64b753f63]
/usr/lib64/libruby.so.1.8(rb_ary_each+0x23)[0x2ab64b72f1a3]
/usr/lib64/libruby.so.1.8[0x2ab64b74898e]
/usr/lib64/libruby.so.1.8[0x2ab64b748ea8]
/usr/lib64/libruby.so.1.8[0x2ab64b749452]
/usr/lib64/libruby.so.1.8(rb_funcall+0x85)[0x2ab64b749725]
/usr/lib64/libruby.so.1.8(rb_iterate+0x348)[0x2ab64b744d38]
/usr/lib64/libruby.so.1.8[0x2ab64b73a6d1]
/usr/lib64/libruby.so.1.8[0x2ab64b74898e]
/usr/lib64/libruby.so.1.8[0x2ab64b748ea8]
/usr/lib64/libruby.so.1.8[0x2ab64b74fc26]
/usr/lib64/libruby.so.1.8[0x2ab64b751ffd]
/usr/lib64/libruby.so.1.8[0x2ab64b7489aa]
/usr/lib64/libruby.so.1.8[0x2ab64b748ea8]
/usr/lib64/libruby.so.1.8[0x2ab64b74fc26]
/usr/lib64/libruby.so.1.8(rb_load+0x655)[0x2ab64b756595]
/usr/lib64/libruby.so.1.8[0x2ab64b756e65]
/usr/lib64/libruby.so.1.8[0x2ab64b74898e]
/usr/lib64/libruby.so.1.8[0x2ab64b748ea8]
/usr/lib64/libruby.so.1.8[0x2ab64b74fd59]
/usr/lib64/libruby.so.1.8[0x2ab64b75704b]
/usr/lib64/libruby.so.1.8(ruby_exec+0x15)[0x2ab64b757095]
/usr/lib64/libruby.so.1.8(ruby_run+0x20)[0x2ab64b7570c0]
/usr/bin/ruby[0x400799]
/lib64/libc.so.6(__libc_start_main+0xf4)[0x37be61d994]
/usr/bin/ruby[0x4006b9]
======= Memory map: ========
00400000-00401000 r-xp 00000000 fd:00 7960180                            /usr/bin/ruby
00600000-00601000 rw-p 00000000 fd:00 7960180                            /usr/bin/ruby
18739000-18b30000 rw-p 18739000 00:00 0                                  [heap]
37be200000-37be21c000 r-xp 00000000 fd:00 6357308                        /lib64/ld-2.5.so
37be41b000-37be41c000 r--p 0001b000 fd:00 6357308                        /lib64/ld-2.5.so
37be41c000-37be41d000 rw-p 0001c000 fd:00 6357308                        /lib64/ld-2.5.so
37be600000-37be74e000 r-xp 00000000 fd:00 6357309                        /lib64/libc-2.5.so
37be74e000-37be94d000 ---p 0014e000 fd:00 6357309                        /lib64/libc-2.5.so
37be94d000-37be951000 r--p 0014d000 fd:00 6357309                        /lib64/libc-2.5.so
37be951000-37be952000 rw-p 00151000 fd:00 6357309                        /lib64/libc-2.5.so
37be952000-37be957000 rw-p 37be952000 00:00 0 
37bea00000-37bea02000 r-xp 00000000 fd:00 6357310                        /lib64/libdl-2.5.so
37bea02000-37bec02000 ---p 00002000 fd:00 6357310                        /lib64/libdl-2.5.so
37bec02000-37bec03000 r--p 00002000 fd:00 6357310                        /lib64/libdl-2.5.so
37bec03000-37bec04000 rw-p 00003000 fd:00 6357310                        /lib64/libdl-2.5.so
37bee00000-37bee82000 r-xp 00000000 fd:00 6357315                        /lib64/libm-2.5.so
37bee82000-37bf081000 ---p 00082000 fd:00 6357315                        /lib64/libm-2.5.so
37bf081000-37bf082000 r--p 00081000 fd:00 6357315                        /lib64/libm-2.5.so
37bf082000-37bf083000 rw-p 00082000 fd:00 6357315                        /lib64/libm-2.5.so
37bf200000-37bf216000 r-xp 00000000 fd:00 6357314                        /lib64/libpthread-2.5.so
37bf216000-37bf415000 ---p 00016000 fd:00 6357314                        /lib64/libpthread-2.5.so
37bf415000-37bf416000 r--p 00015000 fd:00 6357314                        /lib64/libpthread-2.5.so
37bf416000-37bf417000 rw-p 00016000 fd:00 6357314                        /lib64/libpthread-2.5.so
37bf417000-37bf41b000 rw-p 37bf417000 00:00 0 
37cf400000-37cf40d000 r-xp 00000000 fd:00 6357322                        /lib64/libgcc_s-4.1.2-20080825.so.1
37cf40d000-37cf60d000 ---p 0000d000 fd:00 6357322                        /lib64/libgcc_s-4.1.2-20080825.so.1
37cf60d000-37cf60e000 rw-p 0000d000 fd:00 6357322                        /lib64/libgcc_s-4.1.2-20080825.so.1
37d0c00000-37d0c09000 r-xp 00000000 fd:00 6357325                        /lib64/libcrypt-2.5.so
37d0c09000-37d0e08000 ---p 00009000 fd:00 6357325                        /lib64/libcrypt-2.5.so
37d0e08000-37d0e09000 r--p 00008000 fd:00 6357325                        /lib64/libcrypt-2.5.so
37d0e09000-37d0e0a000 rw-p 00009000 fd:00 6357325                        /lib64/libcrypt-2.5.so
37d0e0a000-37d0e38000 rw-p 37d0e0a000 00:00 0 
2ab64b6f8000-2ab64b6f9000 rw-p 2ab64b6f8000 00:00 0 
2ab64b713000-2ab64b714000 rw-p 2ab64b713000 00:00 0 
2ab64b714000-2ab64b7ec000 r-xp 00000000 fd:00 7960178                    /usr/lib64/libruby.so.1.8.5
2ab64b7ec000-2ab64b9ec000 ---p 000d8000 fd:00 7960178                    /usr/lib64/libruby.so.1.8.5
2ab64b9ec000-2ab64b9f1000 rw-p 000d8000 fd:00 7960178                    /usr/lib64/libruby.so.1.8.5
2ab64b9f1000-2ab64ba74000 rw-p 2ab64b9f1000 00:00 0 
2ab64ba75000-2ab64bb25000 rw-p 2ab64ba75000 00:00 0 
2ab64bb25000-2ab64bb29000 r-xp 00000000 fd:00 7964993                    /usr/lib64/ruby/1.8/x86_64-linux/stringio.so
2ab64bb29000-2ab64bd29000 ---p 00004000 fd:00 7964993                    /usr/lib64/ruby/1.8/x86_64-linux/stringio.so
2ab64bd29000-2ab64bd2a000 rw-p 00004000 fd:00 7964993                    /usr/lib64/ruby/1.8/x86_64-linux/stringio.so
2ab64bd2a000-2ab64bd46000 r-xp 00000000 fd:00 7964995                    /usr/lib64/ruby/1.8/x86_64-linux/syck.so
2ab64bd46000-2ab64bf45000 ---p 0001c000 fd:00 7964995                    /usr/lib64/ruby/1.8/x86_64-linux/syck.so
2ab64bf45000-2ab64bf47000 rw-p 0001b000 fd:00 7964995                    /usr/lib64/ruby/1.8/x86_64-linux/syck.so
2ab64bf48000-2ab64c085000 rw-p 2ab64bf48000 00:00 0 
2ab64c085000-2ab64c087000 r-xp 00000000 fd:00 7964980                    /usr/lib64/ruby/1.8/x86_64-linux/etc.so
2ab64c087000-2ab64c287000 ---p 00002000 fd:00 7964980                    /usr/lib64/ruby/1.8/x86_64-linux/etc.so
2ab64c287000-2ab64c288000 rw-p 00002000 fd:00 7964980                    /usr/lib64/ruby/1.8/x86_64-linux/etc.so
2ab64c2a2000-2ab64c2ac000 r-xp 00000000 fd:00 6357019                    /lib64/libnss_files-2.5.so
2ab64c2ac000-2ab64c4ab000 ---p 0000a000 fd:00 6357019                    /lib64/libnss_files-2.5.so
2ab64c4ab000-2ab64c4ac000 r--p 00009000 fd:00 6357019                    /lib64/libnss_files-2.5.so
2ab64c4ac000-2ab64c4ad000 rw-p 0000a000 fd:00 6357019                    /lib64/libnss_files-2.5.so
2ab64c4ad000-2ab64c6e7000 rw-p 2ab64c4ad000 00:00 0 
2ab64c6e7000-2ab64c6f2000 r-xp 00000000 fd:00 7964992                    /usr/lib64/ruby/1.8/x86_64-linux/socket.so
2ab64c6f2000-2ab64c8f1000 ---p 0000b000 fd:00 7964992                    /usr/lib64/ruby/1.8/x86_64-linux/socket.so
2ab64c8f1000-2ab64c8f2000 rw-p 0000a000 fd:00 7964992                    /usr/lib64/ruby/1.8/x86_64-linux/socket.so
2ab64c8f2000-2ab64c8f4000 r-xp 00000000 fd:00 8095382                    /usr/lib64/ruby/1.8/x86_64-linux/digest/md5.so
2ab64c8f4000-2ab64caf3000 ---p 00002000 fd:00 8095382                    /usr/lib64/ruby/1.8/x86_64-linux/digest/md5.so
2ab64caf3000-2ab64caf4000 rw-p 00001000 fd:00 8095382                    /usr/lib64/ruby/1.8/x86_64-linux/digest/md5.so
2ab64caf4000-2ab64caf6000 r-xp 00000000 fd:00 7964977                    /usr/lib64/ruby/1.8/x86_64-linux/digest.so
2ab64caf6000-2ab64ccf5000 ---p 00002000 fd:00 7964977                    /usr/lib64/ruby/1.8/x86_64-linux/digest.so
2ab64ccf5000-2ab64ccf6000 rw-p 00001000 fd:00 7964977                    /usr/lib64/ruby/1.8/x86_64-linux/digest.so
2ab64ccf6000-2ab64ccf9000 r-xp 00000000 fd:00 8095384                    /usr/lib64/ruby/1.8/x86_64-linux/digest/sha1.so
2ab64ccf9000-2ab64cef8000 ---p 00003000 fd:00 8095384                    /usr/lib64/ruby/1.8/x86_64-linux/digest/sha1.so
2ab64cef8000-2ab64cef9000 rw-p 00002000 fd:00 8095384                    /usr/lib64/ruby/1.8/x86_64-linux/digest/sha1.so
2ab64cef9000-2ab64cf12000 r-xp 00000000 fd:00 8261735                    /usr/lib/ruby/gems/1.8/gems/hpricot-0.8.3/lib/hpricot_scan.so
2ab64cf12000-2ab64d111000 ---p 00019000 fd:00 8261735                    /usr/lib/ruby/gems/1.8/gems/hpricot-0.8.3/lib/hpricot_scan.so
2ab64d111000-2ab64d112000 rw-p 00018000 fd:00 8261735                    /usr/lib/ruby/gems/1.8/gems/hpricot-0.8.3/lib/hpricot_scan.so
2ab64d112000-2ab64d514000 rw-p 2ab64d112000 00:00 0 
2ab64d514000-2ab64d515000 r-xp 00000000 fd:00 8261729                    /usr/lib/ruby/gems/1.8/gems/hpricot-0.8.3/lib/fast_xs.so
2ab64d515000-2ab64d715000 ---p 00001000 fd:00 8261729                    /usr/lib/ruby/gems/1.8/gems/hpricot-0.8.3/lib/fast_xs.so
2ab64d715000-2ab64d716000 rw-p 00001000 fd:00 8261729                    /usr/lib/ruby/gems/1.8/gems/hpricot-0.8.3/lib/fast_xs.so
2ab64d716000-2ab64d717000 rw-p 2ab64d716000 00:00 0 
2ab64d717000-2ab64d71b000 r-xp 00000000 fd:00 7964994                    /usr/lib64/ruby/1.8/x86_64-linux/strscan.so
2ab64d71b000-2ab64d91a000 ---p 00004000 fd:00 7964994                    /usr/lib64/ruby/1.8/x86_64-linux/strscan.so
2ab64d91a000-2ab64d91b000 rw-p 00003000 fd:00 7964994                    /usr/lib64/ruby/1.8/x86_64-linux/strscan.so
2ab650000000-2ab650021000 rw-p 2ab650000000 00:00 0 
2ab650021000-2ab654000000 ---p 2ab650021000 00:00 0 
7fff045a8000-7fff045d0000 rw-p 7ffffffd7000 00:00 0                      [stack]
ffffffffff600000-ffffffffffe00000 ---p 00000000 00:00 0                  [vdso]
Aborted

Not sure if this is really a bug, or just too old a ruby..

$ ruby --version
ruby 1.8.5 (2006-08-25) [x86_64-linux]
$ gem --version
1.3.1

No info about previously.txt in docs

I've installed git-commit-notifier, and it worked fine when I tested it for my user, but when I placed it into our work server we've found an error. Some person pushes to repo and gets error message:

Sending mail...
/var/lib/gems/1.8/gems/git-commit-notifier-0.7.2/bin/../lib/diff_to_html.rb:285:in `initialize': Permission denied - /var/git/repo/previously.txt (Errno::EACCES)
        from /var/lib/gems/1.8/gems/git-commit-notifier-0.7.2/bin/../lib/diff_to_html.rb:285:in `open'
        from /var/lib/gems/1.8/gems/git-commit-notifier-0.7.2/bin/../lib/diff_to_html.rb:285:in `diff_between_revisions'
        from /var/lib/gems/1.8/gems/git-commit-notifier-0.7.2/bin/../lib/commit_hook.rb:41:in `run'
        from /var/lib/gems/1.8/gems/git-commit-notifier-0.7.2/bin/git-commit-notifier:13
        from /var/lib/gems/1.8/bin/git-commit-notifier:19:in `load'
        from /var/lib/gems/1.8/bin/git-commit-notifier:19
error: hooks/post-receive exited with error code 1

The solution for this problem is very simple:

sudo chmod a+w /var/git/repo/previously.txt

But I think in the docs there should be info to execute these command to make git-commit-notifier work correctly:

sudo touch /var/git/repo/previously.txt
sudo chmod a+x /var/git/repo/previously.txt

Set default value "true" for parameter ignore_merge

Hi!

Yesterday I've got a small problem with git-commit-notifier. After a merge, git-commit-notifier send on my mail several dozens empty mails. It is very easy to fix - just to place "ignore_merge: true" in config file. But I think this setting should be true be default, so light users will not get the problem with tons of mails.

Add "Sending Mail"-Output

The commit takes a little bit longer because the mail needs to be generated and sent. It would be great if a "Sending Mail..." notify would be visible during the commit.

Octopus merges don't send out notifications

This is for me to fix. The code to detect which files were changed by merge only work on recursive merges, since it picks off the merge heads and calls changed_files(rev1, rev2). For an octopus merge, there's more than two merge heads, so it fails with an ArgumentError.

I'll add a little more code to handle this.

(Adding @holzman so it sends me mail)

undefined method `to_sym' for nil

I get this error

remote: /usr/lib/ruby/gems/1.8/gems/git-commit-notifier-0.9.2/lib/git_commit_notifier/emailer.rb:128:in send': undefined methodto_sym' for nil:NilClass remote: from /usr/lib/ruby/gems/1.8/gems/git-commit-notifier-remote: from remote: from /usr/lib/ruby/gems/1.8/gems/git-commit-notifier-remote: from /usr/lib/ruby/gems/1.8/gems/git-commit-notifier-0.9.2/lib/git_commit_notifier/commit_hook.rb:111:in `each_with_index'ach':31:in remote: from /usr/lib/ruby/gems/1.8/gems/git-commit-notifier-remote: from /usr/lib/ruby/gems/1.8/gems/git-commit-notifier-remote: from remote: from remote: from /usr/bin/git-commit-notifier:19t-notifier:15un'

How can this be fixed?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.