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

chezmoi: templates/COMMIT_MESSAGE.tmpl: not found #615

Closed
3 of 4 tasks
kortsi opened this issue Mar 4, 2020 · 4 comments
Closed
3 of 4 tasks

chezmoi: templates/COMMIT_MESSAGE.tmpl: not found #615

kortsi opened this issue Mar 4, 2020 · 4 comments
Labels
bug Something isn't working

Comments

@kortsi
Copy link

kortsi commented Mar 4, 2020

After refreshing the chezmoi snap on Ubuntu to 1.7.15 autoCommit fails. This used to work with an earlier version (don't know exactly which version number). I know autoCommit is an experimental feature, but it would be nice to know where I should put the AUTOCOMMIT_MESSAGE.tmpl to hopefully make it work again. I can't find any documentation about it.

What exactly are you trying to do?

Running:

chezmoi add <anything>

With autoCommit = true in chezmoi.toml produces:

chezmoi: templates/COMMIT_MESSAGE.tmpl: not found

I am unable to find any documentation on where to put a COMMIT_MESSAGE.tmpl file.

What have you tried so far?

Where else have you checked for solutions?

Output of any commands you've tried with --verbose

$ chezmoi add README.chezmoi
( cd /home/mkortela/.local/share/chezmoi && /usr/bin/git add . )
chezmoi: templates/COMMIT_MESSAGE.tmpl: not found

Output of chezmoi doctor

     ok: version 1.7.15, commit a7b560750eb7002286515d494c5d6592e0c053da, built at 2020-02-26T08:06:37Z
     ok: runtime.GOOS linux, runtime.GOARCH amd64
     ok: /home/mkortela/.local/share/chezmoi (source directory, perm 700)
     ok: /home/mkortela (destination directory, perm 755)
     ok: /home/mkortela/.config/chezmoi/chezmoi.toml (configuration file)
     ok: /bin/bash (shell)
     ok: /usr/bin/vim (editor)
     ok: /usr/bin/vimdiff (merge command)
     ok: /usr/bin/git (source VCS command, version 2.20.1)
     ok: /usr/bin/gpg (GnuPG, version 2.2.12)
warning: op (1Password CLI, not found)
warning: bw (Bitwarden CLI, not found)
warning: gopass (gopass CLI, not found)
warning: keepassxc-cli (KeePassXC CLI, not found)
warning: lpass (LastPass CLI, not found)
warning: pass (pass CLI, not found)
warning: vault (Vault CLI, not found)

Additional context

I am using Ubuntu (18.04 and 19.10) with chezmoi snap.

$ cat ~/.config/chezmoi/chezmoi.toml 
[sourceVCS]
    autoCommit = true
    autoPush = true
@kortsi kortsi added the support Support request label Mar 4, 2020
@twpayne twpayne added bug Something isn't working and removed support Support request labels Mar 4, 2020
@twpayne
Copy link
Owner

twpayne commented Mar 4, 2020

Thank you very much reporting this. I inadvertently broke it in 40d92cc when I missed updating a path. This should now be fixed and I'll tag a new version so you get it with snap.

I would be very happy to hear your experiences of autoCommit and autoPush. Are they working for you? Have you encountered any problems (apart from this one of course!)?

@twpayne
Copy link
Owner

twpayne commented Mar 4, 2020

BTW the explanation for this message

chezmoi: templates/COMMIT_MESSAGE.tmpl: not found

is:

  • chezmoi runs git status to get the status after git adding a change.
  • chezmoi parses the output of git status.
  • it then generates the commit message by feeding the parsed output to a template.
  • COMMIT_MESSAGE.tmpl is that template.
  • normally the template is embedded in the chezmoi binary (so chemzoi can be distributed as a single binary, without extra files) and is looked up by its path.
  • I forgot to update that path when moving things around.

So, this is not something you could have fixed by adding a file yourself. chezmoi was failing to find its own data.

@twpayne
Copy link
Owner

twpayne commented Mar 4, 2020

Fixed with #617.

@twpayne twpayne closed this as completed Mar 4, 2020
@kortsi
Copy link
Author

kortsi commented Mar 5, 2020

The fix worked, thank you so much!

I have been very happy with autoCommit and autoPush. Chezmoi makes life much easier and autoCommit/autoPush just make it a bit more seamless. This is the only problem I have encountered with it so far. I have only been using Chezmoi only for a few months now, though.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants