Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prefs: option to automatically load template commit #1013

merged 5 commits into from Nov 19, 2019


Copy link

vnepveu commented Nov 17, 2019

  • Add cola.commit.autotemplate constant in preferences
  • Add checkbox in both "All repositories" and "Current repository"
  • Load commit template if needed when opening new repository

Closes #735

vnepveu added 4 commits Nov 11, 2019
- Add AUTOTEMPLATE constant to models/
- Set autotemplate to False in Defaults class

Signed-off-by: Victor Nepveu <>
- Add checkbox to automatically load commit template
- Update autotemplate variable if a change is detected

Signed-off-by: Victor Nepveu <>
- Replace self.new_commitmsg with template commit message when
reinitializing the commit message editor if AUTOTEMPLATE is True

Signed-off-by: Victor Nepveu <>
- If AUTOTEMPLATE is True, load the commit template
  when opening a new repository
- Fix line length in widgets/

Signed-off-by: Victor Nepveu <>
@@ -9,6 +9,7 @@
from ..cmd import Command

AUTOTEMPLATE = "cola.commit.autotemplate"

This comment has been minimized.

Copy link

davvid Nov 19, 2019


Single quotes for consistency, please. This seems reasonable. One small note -- everywhere else we use just a single flat namespace for config values. e.g. cola.autoloadcommittemplate is more in-line with the rest of the config keys we use. In documentation we spell it as cola.autoloadCommitTemplate which helps the readability.

Please make sure this feature is documented in doc/git-cola.rst in the CONFIGURATION VARIABLES section.

This comment has been minimized.

Copy link

vnepveu Nov 19, 2019

Author Contributor
Suggested change
AUTOTEMPLATE = "cola.commit.autotemplate"
AUTOTEMPLATE = "cola.autoloadcommittemplate"

I used this format because of your comment (see #735 (comment))

This comment has been minimized.

Copy link

davvid Nov 19, 2019


Ah, sorry for not remembering. Thanks for the updates.

Copy link

davvid left a comment

Documentation, please.

- Change name to further consistency
- Change double quotes to single quotes
- Document the variable
davvid added a commit that referenced this pull request Nov 19, 2019
Signed-off-by: David Aguilar <>
davvid added a commit that referenced this pull request Nov 19, 2019
* vnepveu/issue735:
  Modify and document AUTOTEMPLATE variable
  preferences: load template when opening repo
  preferences: replace commit message with template
  preferences: automatically load commit template
  preferences: add autotemplate variable

Signed-off-by: David Aguilar <>
@davvid davvid merged commit 850f91e into git-cola:master Nov 19, 2019
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
bmwiedemann pushed a commit to bmwiedemann/openSUSE that referenced this pull request Nov 28, 2019
by user dimstar_suse
- Update to 3.6
- Usability, bells and whistles
* The remote editor is much faster since it no longer queries
  remotes, and uses the cached information instead.
* Commit message templates can now be loaded automatically by setting
  ``git config cola.autoloadcommittemplate true``.
* The UI layout can now be reset back to its initial state by selecting
  the "Reset Layout" action.  This reverts the layout to the same state
  as when the app first launched.
* Files can now be ignored in either the project's `.gitignore`, or in the
  repository's priv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.