Closed lgersman closed 10 months ago
You can do this with a more extensive commitMessageTemplate
string or the new (as yet unreleased) commitMessageTemplateFile
specification. You would need to add your custom message at the top and copy the default commit message template into your template.
@twpayne I wonder if it might be possible to have something like {{ includeTemplate "chezmoi:COMMIT_MESSAGE.tmpl" }}
work?
You can do this with a more extensive
commitMessageTemplate
string or the new (as yet unreleased)commitMessageTemplateFile
specification. You would need to add your custom message at the top and copy the default commit message template into your template.
Exactly. Please wait for commitMessageTemplateFile
and copy the default commit message template.
@twpayne I wonder if it might be possible to have something like
{{ includeTemplate "chezmoi:COMMIT_MESSAGE.tmpl" }}
work?
I think that something like this makes sense when chezmoi has multiple built-in templates. Right now, this is not the case and copying the standard template instead makes sense.
@twpayne I wonder if it might be possible to have something like
{{ includeTemplate "chezmoi:COMMIT_MESSAGE.tmpl" }}
work?I think that something like this makes sense when chezmoi has multiple built-in templates. Right now, this is not the case and copying the standard template instead makes sense.
Not that the COMMIT_MESSAGE.tmpl
file has changed recently, but includeTemplate "chezmoi:COMMIT_MESSAGE.tmpl"
support would make it so that if it were updated, people would get the benefit on upgrade without having to learn that COMMIT_MESSAGE.tmpl
has been updated upstream.
There's an added complication that with #3322 the structure of the data passed to COMMIT_MESSAGE.tmpl
changed from passing just the git status as .
to passing a full set of chezmoi template variables in .chezmoi
with the status in .chezmoi.status
and a bunch of field renames for consistency. Effectively, #3322 makes the data passed to COMMIT_MESSAGE.tmpl
part of chezmoi's API (relevant XKCD.
Fixed by #3322. Please re-open if you have further questions.
Is your feature request related to a problem? Please describe.
I can customize the commit message using
but in this case i am missing the changes made by the commit
Example:
I would like to define a commit message template containg a custom template string BUT would also like to have the changes (the default chezmoi commitMessageTemplate) noted in the message.
Just like this:
Example:
I am aware of the fact that I can even use
chezmoi git -- log --stat
to see both commit message and changed files usinggit
(BTW: Why doeschezmoi git log --stat
not work ?`).Describe the solution you'd like
Provide a template variable containing the default commit message generated by chezmoi
Thank's for creating such a great software !