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

181.0 13.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 Issues

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?

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

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?

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

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)

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

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...

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.

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.

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.

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.

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

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

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

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.

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

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

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.

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

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.

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.

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!

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

Identify rebase

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

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.

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.

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:

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

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?

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.

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

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).

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.

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.