Open cujomalainey opened 2 years ago
I "solved" it for plain text (for HTML continues to crash) like this:
--- <gitinspector/changes.py>
+++ <gitinspector/changes.py>
def get_authorinfo_list(self):
if not self.authors:
for i in self.commits:
- Changes.modify_authorinfo(self.authors, i.author, i)
+ Changes.modify_authorinfo(self.authors, i.author if hasattr(i, 'author') else "x", i)
return self.authors
Good catch - By authorless I'm assuming we are talking about an empty author string ? That's actually not permited by git. If you run git fsck
on such a repo you should get errors. Question is what the correct behavior is here. We could certainly insert a "No Author" user into the result, but it's probably also a good idea to inform users about it and not condone invalid use of git.
I'm having this issue as well on a private (work) repository, and I do not have any authorless commits in the repository.
I'm not familiar with the codebase, but I attempted some debugging.
I found some invalid strings passed to the Commit
constructor (1 file changed, 1 insertion(+), 1 deletion(-)
).
When I removed the or i is lines[-1]
from here, the error went away.
I added a print statement of i
when i is lines[-1]
, and I had a lot of empty lines + the invalid strings I mentioned before.
This is where I'm stuck for now, but I hope that my experiments can help someone find the actual bug.
I'm having this issue as well on a private (work) repository, and I do not have any authorless commits in the repository.
I'm not familiar with the codebase, but I attempted some debugging.
I found some invalid strings passed to the
Commit
constructor (1 file changed, 1 insertion(+), 1 deletion(-)
).When I removed the
or i is lines[-1]
from here, the error went away.I added a print statement of
i
wheni is lines[-1]
, and I had a lot of empty lines + the invalid strings I mentioned before.This is where I'm stuck for now, but I hope that my experiments can help someone find the actual bug.
If you don't have any authorless commits, then this mandates further investigation I would say.
I just ran into the exact same issue with a class I am teaching.
The error I'm getting:
Exception in thread Thread-1:
Traceback (most recent call last):
File "C:\Python27\lib\threading.py", line 801, in __bootstrap_inner
self.run()
File "C:\Users\xxx\gitinspector\changes.py", line 151, in run
bisect.insort(commits, commit)
File "C:\Users\xxx\gitinspector\changes.py", line 82, in __lt__
return self.timestamp.__lt__(other.timestamp) # only used for sorting; we just consider the timestamp.
AttributeError: 'Commit' object has no attribute 'timestamp'
Following @dirtcrusher's suggestions and deleting or i is lines[-1]
from here allows everything to run.
I've tried some other Python 3.x versions and am getting the same result.
The line of code in question was introduce in the second commit of the project here.
Tool was run on https://github.com/zephyrproject-rtos/zephyr