ejwa / gitinspector

:bar_chart: The statistical analysis tool for git repositories
GNU General Public License v3.0
2.38k stars 328 forks source link

AttributeError when running gitinspector on a repository with no scanned files #91

Closed gregrs-uk closed 8 years ago

gregrs-uk commented 8 years ago

I came across the following error trying to run gitinspector for a repository containing Lilypond (.ly and .ily) files but no files that would be scanned by default by gitinspector. Adding the option -f ly,ily fixes the issue but it would be nice if the user could be told that no files were scanned and prompted to check that they have supplied the -f option if necessary. It would also be nice if .ly and .ily files could be enabled by default.

I will try to fix the issue if I get time, but thought I would report it here in any case.

Thanks for sharing a useful piece of software!

Gregrs

Traceback (most recent call last):
  File "./gitinspector.py", line 24, in <module>
    gitinspector.main()
  File "/Users/Grs/Downloads/gitinspector/gitinspector/gitinspector.py", line 206, in main
    run.process(repos)
  File "/Users/Grs/Downloads/gitinspector/gitinspector/gitinspector.py", line 83, in process
    outputable.output(ChangesOutput(summed_changes))
  File "/Users/Grs/Downloads/gitinspector/gitinspector/output/outputable.py", line 43, in output
    outputable.output_text()
  File "/Users/Grs/Downloads/gitinspector/gitinspector/output/changesoutput.py", line 134, in output_text
    authorinfo_list = self.changes.get_authorinfo_list()
  File "/Users/Grs/Downloads/gitinspector/gitinspector/changes.py", line 264, in get_authorinfo_list
    for i in self.commits:
AttributeError: 'Changes' object has no attribute 'commits'
adam-waldenberg commented 8 years ago

That's a regression that probably was introduced with the support for merged reports. I'll take a look at it.

Lilypond files won't be enabled by default. However, you can enable it by default in all your repos using git config.

adam-waldenberg commented 8 years ago

I think I found the culprit. This bug was most likely introduced with the commit ecc67a31 and is caused by the initialization of an empty Changes object (init is being skipped). Taking a look at it now.

gregrs-uk commented 8 years ago

Thanks Adam

adam-waldenberg commented 8 years ago

No problem. Thank you for the report. :)