Skip to main content

Commit Editor

PyPI Python License CI

An opinionated, terminal-based text editor for git commit messages, built with Textual.

  • Title length warning: Characters beyond position 50 on the first line are highlighted in red
  • Auto-wrap body text: Lines in the commit body (line 3+) are automatically wrapped at 72 characters (except for long strings that can't be wrapped, such as URLs)
  • White space: Trailing white space is automatically stripped when a file is saved; an empty newline is inserted at the end of the file if not present.
  • Signed-off-by toggle: Quickly add or remove a Signed-off-by trailer with a keyboard shortcut
  • Issue ID validation: Optionally enforce that commit titles start with an issue ID (e.g. PROJ-123:)
  • Status bar: Shows current cursor position (line/column) and title length with warnings

Installation

# Using uv
uv tool install commit-editor

# Using pip
pip install commit-editor

Requirements

  • Python 3.11 or later
  • Git (for Signed-off-by functionality)

Usage

Configure commit-editor as your default git commit message editor:

git config --global core.editor commit-editor

When you run git commit, the editor will open automatically.

commit-editor can also be used as a standalone tool with:

commit-editor path/to/file.txt

Keyboard Shortcuts

Shortcut Action
Ctrl+S Save the file
Ctrl+Q Quit
Ctrl+O Toggle Signed-off-by trailer

Additional key bindings are noted in the Textual TextArea documentation.

Configuration

Issue ID Validation

You can require commit titles to start with an issue ID by setting a regex pattern:

# Per-repository
git config commit-editor.issue-pattern 'PROJ-\d+'

# Global
git config --global commit-editor.issue-pattern 'PROJ-\d+'

The pattern is matched against the start of the title and must be followed by a colon (:). For example, with the pattern PROJ-\d+:

  • valid: PROJ-123: fix login bug
  • invalid: fix login bug

Commit Message Format

This editor enforces the widely-accepted git commit message conventions:

  1. Title (line 1): Should be 50 characters or less; characters beyond 50 are highlighted in red as a warning.
  2. Blank line (line 2): Separates the title from the body.
  3. Body (line 3+): Should wrap at 72 characters; long lines are wrapped automatically as you type.

Future Improvements

  • Color theme support

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

commit_editor-0.7.0.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

commit_editor-0.7.0-py3-none-any.whl (12.6 kB view details)

Uploaded Python 3

File details

Details for the file commit_editor-0.7.0.tar.gz.

File metadata

  • Download URL: commit_editor-0.7.0.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for commit_editor-0.7.0.tar.gz
Algorithm Hash digest
SHA256 fa8b312f4d1ba31d1571ec1fa303c3f9723a1136824a3823268d24a403e42de9
MD5 8d6eabcefb38a7763471814c7efef266
BLAKE2b-256 c69ee5842b055e0941aff861efec315482ae05febbc7f3aacca72e14978a0cbf

See more details on using hashes here.

Provenance

The following attestation bundles were made for commit_editor-0.7.0.tar.gz:

Publisher: publish.yml on mprpic/commit-editor

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file commit_editor-0.7.0-py3-none-any.whl.

File metadata

  • Download URL: commit_editor-0.7.0-py3-none-any.whl
  • Upload date:
  • Size: 12.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for commit_editor-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 03f7845e7d7355bc2d6b634332bc499b53f9e883a40ec683e932c689cd57a7c1
MD5 7cb008ee15cd86c7ba4dd1e8009fa7f1
BLAKE2b-256 f7bc4d1227daeef71731e2525d86320e41470bfba18a00fb647762ecba993da6

See more details on using hashes here.

Provenance

The following attestation bundles were made for commit_editor-0.7.0-py3-none-any.whl:

Publisher: publish.yml on mprpic/commit-editor

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.7.0 This release

2 files

0.6.0

2 files

0.5.0

2 files

0.4.0

2 files

0.3.0

2 files

0.2.0

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page