twpayne / chezmoi

Manage your dotfiles across multiple diverse machines, securely.
https://www.chezmoi.io/
MIT License
12.9k stars 478 forks source link

Allow usage of chezmoi template variables in commitMessageTemplate defined in chezmoi.toml #3329

Closed lgersman closed 10 months ago

lgersman commented 10 months ago

Is your feature request related to a problem? Please describe.

I would like to use the chezmoi template variables like {{ .chezmoi.hostname }} (and probably some more) in my commitMessageTemplate defined in chezmoi.toml

Example:

[git]
  autoPush = true
  autoCommit = true
  commitMessageTemplate="host {{ .chezmoi.hostname }}"

In the current version (chezmoi version v2.40.4) this yields an error :

chezmoi: template: commit_message:1:16: executing "commit_message" at <.chezmoi.hostname>: can't evaluate field chezmoi in type *git.Status
twpayne commented 10 months ago

This is already fixed in #3322.