Skip to content

Unnecessary use of 'Commit' objects in views #191

@skeating

Description

@skeating

There are several places in code where we use something like
entity.repo.get_commit(version.sha))
and pass the resulting commit object to an html view. Here it used to extract information about the commit - author/date/numfiles etc but there is no need for actual commit object. Since every commit records some information in the repocache surely it would be better to extend the information stored (some is there - some is not) so that there is no need to grab the actual commit.

What particularly confuses me is that the commit object gets passed to the url functions which seem to then create url based on tag if it exists or a reduced version of the sha. I haven't worked out the logic of this - but that also seems overkill for creating a url. The appropriate string is what is needed.

Note: I am talking only about views since these do not actually use anything other than attributes of the Commit. I realise other things may need the whole thing.

Disclaimer: I might be missing something crucial :-)

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions