Hi, When I tried to delete a remote branch on devmanual, I got the following error: ``` $ git push -d origin pkg_pretend_improvement remote: fatal: Invalid revision range d60840bad84d133aa2b97c7dcebf3e5e4942d17a..0000000000000000000000000000000000000000 remote: To github.com:gentoo/devmanual.gentoo.org.git remote: - [deleted] pkg_pretend_improvement remote: fatal: Invalid revision range d60840bad84d133aa2b97c7dcebf3e5e4942d17a..0000000000000000000000000000000000000000 remote: Traceback (most recent call last): remote: File "hooks/post-receive.h03-notify-webhook", line 335, in <module> remote: main(sys.stdin) remote: File "hooks/post-receive.h03-notify-webhook", line 321, in main remote: data = make_json(old, new, ref) remote: File "hooks/post-receive.h03-notify-webhook", line 251, in make_json remote: revisions = get_revisions(old, new) remote: File "hooks/post-receive.h03-notify-webhook", line 129, in get_revisions remote: props = {'id': lines[0].strip().split(' ')[1], 'added': [], 'removed': [], 'modified': []} remote: IndexError: list index out of range To git+ssh://git.gentoo.org/proj/devmanual.git - [deleted] pkg_pretend_improvement ```
Fixed here: https://github.com/metajack/notify-webhook/issues/18
Not fixed. I got the same error today, when deleting a branch in proj/emacs-tools.git: ~/git/emacs-tools $ git push -d origin patchsets remote: Traceback (most recent call last): remote: File "hooks/post-receive.h03-notify-webhook", line 410, in <module> remote: main(sys.stdin) remote: File "hooks/post-receive.h03-notify-webhook", line 397, in main remote: data = make_json(old, new, ref) remote: File "hooks/post-receive.h03-notify-webhook", line 316, in make_json remote: revisions = get_revisions(old, new) remote: File "hooks/post-receive.h03-notify-webhook", line 177, in get_revisions remote: ' ')[1], 'added': [], 'removed': [], 'modified': []} remote: IndexError: list index out of range To git+ssh://git.gentoo.org/proj/emacs-tools.git - [deleted] patchsets
The upstream script at https://github.com/metajack/notify-webhook/blob/master/notify-webhook.py#L167 does this: revs = git(['rev-list', '--pretty=medium', '--reverse', commit_range]) sections = revs.split('\n\n') revisions = [] s = 0 while s < len(sections): revs is an empty string as expected, but sections is _not_ an empty list, but a list with one empty element. So the while loop is entered which is where it fails.
*** Bug 706370 has been marked as a duplicate of this bug. ***