Skip to content

git: Commit messages too long, allow configuring #1115

Open

Description

@hseg

The automatic commit messages emitted by the git integration get pretty long -- by default, they're some variation on f"Did op foo on {describe(doc)}", which with the default document-description-format of {doc[title]} - {doc[author]} becomes pretty long.
In contrast, git conventions are to have commit subjects be capped at 50 chars, and commit bodies be wrapped at 72 chars.
For that purpose, a better template would be eg

{op} {format(ref-format, doc)}

{% for field in commit-fields %}
{{field | wordwrap(72)}}
{% endfor %}

An alternative workaround is to pass --edit to the calls to git commit, which would allow editing the commit message before the call.
A further alternative is to absorb the git commit failures, and then just papis git commit to write the commit message yourself.
Or I could disable commit message standards for that repo, but I'd like to keep things neat.

BTW, note that the fact that the commit message is controlled by document-description-format is not documented, and I needed to hunt it down in the code.

Activity

  1. alexfikl commented on Dec 31, 2025

    @alexfikl
    Collaborator

    That sounds like a good idea, we should have some format specific for the git commit messages, since they're generally different to other "show user the operation being performed" log messages.

    Or I could disable commit message standards for that repo, but I'd like to keep things neat.

    I'm not sure what standards you have, but employing something like conventional commits is probably a bit out of scope. Also, for the default python formatter, it will be difficult to ensure it stays to a fixed number of chars without an additional config variable or something.

  2. hseg commented on Dec 31, 2025

    @hseg
    ContributorAuthor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions