/Commit

Commit message editor

Primary LanguageJavaScriptGNU General Public License v3.0GPL-3.0

Commit

Commit is an editor that helps you write better Git and Mercurial commit messages.

screenshot

Download on Flathub

Installation

Setup flatpak then

flatpak install re.sonny.Commit
flatpak run re.sonny.Commit # Follow instructions
Distro Package Name/Link Maintainer
Arch Linux (aur) commit Mark Wagie

Usage

Commit will pop up automatically when you make a commit in one of your projects.

To save your commit message, press the Commit button or the Ctrl+Return key combination.

To abort and dismiss Commit, press the Cancel button or the Escape key.

Features

  • Highlights overflow of title when it exceeds 50 characters (customizable)
  • Inserts blank line between title and description
  • Spell checking
  • Comments are readonly and excluded from "Select All"
  • Displays project folder and branch in window header
  • Dark theme support: the overflow highlight is adjusted according to your theme
  • Supports git commit messages, merge messages, tag messages, add -p messages, and rebase -i messages
  • Supports Mercurial commit messages
  • Welcome window when launched from desktop (or without argument)

Tips and trick

Emojis

right-click ➞ Insert Emoji or use the shortcut Ctrl+. 🎉️ The Emoji picker works in any GNOME app 👣️

Open Commit in the center of the screen

On GNOME you can make all new windows open in the center using

gsettings set org.gnome.mutter center-new-windows true

See https://gitlab.gnome.org/GNOME/mutter/-/issues/246

or set and use the move-to-center keybinding

gsettings set org.gnome.desktop.wm.keybindings move-to-center "['<Super><Control><Shift>Space']"

Development

cd Commit
./re.sonny.Commit test/with-body/COMMIT_EDITMSG

Make changes and hit Ctrl+Shift+Q on the Commit window to restart it.

To pass the tests you have to install a few dependencies

# Install development dependencies
sudo dnf install --assumeyes npm flatpak make desktop-file-utils gjs gtk3-devel libhandy
npm install
flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak install --user --assumeyes --noninteractive flathub org.freedesktop.appstream-glib

# Run tests
make test

Flathub builds https://flathub.org/builds/#/apps/re.sonny.Commit

Maintainer

i18n
# To update the pot file
# xgettext -f po/POTFILES -o po/re.sonny.Commit.pot --no-wrap -cTRANSLATORS --from-code=UTF-8
# sed -i "s/Project-Id-Version: PACKAGE VERSION/Project-Id-Version: re.sonny.Commit/" po/re.sonny.Commit.pot
meson compile re.sonny.Commit-pot -C _build


# To create a translation
# msginit -i po/re.sonny.Commit.pot -o po/fr.po -l fr_FR.UTF-8
echo -n " fr" >> po/LINGUAS
meson compile re.sonny.Commit-update-po -C _build

# To update translations
# msgmerge -U po/*.po po/re.sonny.Commit.pot
meson compile re.sonny.Commit-update-po -C _build

See sonnyp#14 (comment)

Publish new version
  • meson compile re.sonny.Commit-update-po -C _build
  • Update version in meson.build
  • git tag
  • flathub

Building

host
cd Commit
meson --prefix $PWD/install build
ninja -C build install
Flatpak

Use GNOME Builder or

cd Commit
flatpak-builder --user --force-clean --repo=repo --install-deps-from=flathub flatpak re.sonny.Commit.json
flatpak --user remote-add --no-gpg-verify --if-not-exists Commit repo
flatpak --user install --reinstall --assumeyes Commit re.sonny.Commit

Credits

Commit is a fork of Gnomit wich was inspired by Komet.

Many thanks to its original author Aral balkan of Small Technology Foundation.

Contributors

Copyright

License

GPLv3 or later. Please see COPYING file.