Weblate breaks when the latest commit in its Git repo has an empty commit message
As a symptom, we get messages like the following in the our administrative list:
File "/usr/local/share/weblate/weblate/trans/models/component.py" in get_last_remote_commit
696. self.repository.last_remote_revision
File "/usr/local/share/weblate/weblate/vcs/base.py" in get_revision_info
295. result = self._get_revision_info(revision)
File "/usr/local/share/weblate/weblate/vcs/git.py" in _get_revision_info
225. result['summary'] = message[0]
Exception Type: IndexError at /projects/tails/sidebar/pt/
Exception Value: list index out of range
It seems the code assumes that there'll be a non-empty message in the topmost commit of the Git repository. And it looks like the logic is still the same in Weblate's current master branch.
Turns out that edits to the website made through Ikiwiki can often have empty commit messages, as the the commit message will be whatever the editing person adds to Ikiwiki's "Optional description of this change" field -- and that field is blank by default.
I think we have to:
- Report this to upstream -- it'd maybe be good to consistently reproduce it first (for example using their Docker image and the provided docker-compose.yml file).
- Find a short-term workaround for our use case. This can be either in the Ikiwiki or the Weblate level, or maybe both. A simple workaround that would mitigate most of the problems (i guess) would be to add a default edit message to Ikiwiki (like "Edited through Ikiwiki" or something like this).