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

Feature Request: Add configuration item to prefix or suffix the default commit message #1930

Open
adrydale opened this issue Jan 3, 2023 · 1 comment

Comments

@adrydale
Copy link

adrydale commented Jan 3, 2023

Current behavior

Reference template

When files are edited with Gollum, a commit is created. By default, the commit messages are:

  • "Created {{page_name}} ({{format}})"
  • "Updated {{page_name}} ({{format}})"

Requested behavior

I would like to be able to add in either a prefix or suffix to the default commit message.

Example:

  • "{{commit_prefix}} Created {{page_name}} ({{format}}) {{commit_suffix}}"
  • "{{commit_prefix}} Updated {{page_name}} ({{format}}) {{commit_suffix}}"

The end result would be something like Created example.md via Gollum or Gollum - Updated example.md

The commit_prefix and/or commit_suffix options could be configuration items in the config.rb file.

Use case would be to identify commits made by Gollum for reasons such as automatic git pushes of commits by Gollum when in a shared location and for better audit logging. This can be done manually on each file save or a custom template but it would be nice to have a default behavior for it.

@benjaminwil
Copy link
Member

I think this is an interesting idea and I'd welcome any pull requests adding this.

I think instead of a prefix and suffix we should make the whole "created" and "updated" strings configurable, with support for a short list of variables like page_name and format. This would make the feature more valuable to people who don't speak English or prefer another language and want to keep their git history in their preferred language.

Here is what I think the configuration could look like (pseudo code):

config.default_created_commit_message = "Somebody created {{page_name}} {{format}}"
config.default_updated_commit_message = "{{page_name}} has been updated {{format}} haha example text"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants