davidmalcolm/gcc-refactoring-scripts — pull request #3 by tromey (2014-01-08 17:00:32+00:00)
Title: handle a missing "file" in the diff output

A hunk might start like this:

@@ -4,6 +4,18 @@

This can easily happen for a change near the start of a file.

With this sort of input, generate-changelog will die:

File "/home/tromey/bin/scripts/generate-changelog", line 121, in
main()
File "/home/tromey/bin/scripts/generate-changelog", line 118, in main
p.on_line(line)
File "/home/tromey/bin/scripts/generate-changelog", line 82, in on_line
scope = m.group(2).split(' ')
AttributeError: 'NoneType' object has no attribute 'group'

The fix is to check whether the regexp matched and use the empty
string for the scope.