Factor out generation of commit list

The links are there but they don’t work. Since they all lead to the same
page, we’ll have to parse that ?sha= and, depending on its presence,
either show the commit list or details of a specific commit.

Before we do that, though, it makes sense to move the commit listing
functionality into a separate function.