twpayne/chezmoi

Chezmoi dont seem to read from my .chezmoiignore file

Closed this issue · 5 comments

What exactly are you trying to do?

I want to add a .chezmoiignore file and add files or extensions to be ignored by chezmoi.

What have you tried so far?

I've added .chezmoiignore to ~/.local/share/chezmoi, also tried to add it to differnet places, like where the file i want to exclude is.

The files i thought should be ignored is not ignored, and when i run chezmoi ignored it does not list anything.

Where else have you checked for solutions?

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

$ chezmoi --verbose $COMMAND

Output of chezmoi doctor

RESULT CHECK MESSAGE
ok version v2.47.3, commit 4f76edb, built at 2024-03-31T18:34:33Z, built by goreleaser
warning latest-version v2.47.4
ok os-arch linux/amd64 (Ubuntu 22.04.4 LTS (Jammy Jellyfish))
ok uname Linux 98-28123 5.15.146.1-microsoft-standard-WSL2 #1 SMP Thu Jan 11 04:09:03 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
ok go-version go1.22.1 (gc)
ok executable ~/bin/chezmoi
ok upgrade-method replace-executable
ok config-file no config file found
warning source-dir ~/.local/share/chezmoi is a git working tree (dirty)
ok suspicious-entries no suspicious entries
warning working-tree ~/.local/share/chezmoi is a git working tree (dirty)
ok dest-dir ~ is a directory
ok umask 022
ok cd-command found /usr/bin/zsh
ok cd-args /usr/bin/zsh
info diff-command not set
ok edit-command found /usr/local/bin/nvim
ok edit-args /usr/local/bin/nvim
ok git-command found /usr/bin/git, version 2.34.1
ok merge-command found /usr/bin/vimdiff
ok shell-command found /usr/bin/zsh
ok shell-args /usr/bin/zsh
info age-command age not found in $PATH
ok gpg-command found /usr/bin/gpg, version 2.2.27
info pinentry-command not set
info 1password-command op not found in $PATH
info bitwarden-command bw not found in $PATH
info bitwarden-secrets-command bws not found in $PATH
info dashlane-command dcli not found in $PATH
info doppler-command doppler not found in $PATH
info gopass-command gopass not found in $PATH
info keepassxc-command keepassxc-cli not found in $PATH
info keepassxc-db not set
info keeper-command keeper not found in $PATH
info lastpass-command lpass not found in $PATH
ok pass-command found /usr/bin/pass, version 1.7.4
info passhole-command ph not found in $PATH
info rbw-command rbw not found in $PATH
info vault-command vault not found in $PATH
info vlt-command vlt not found in $PATH
info secret-command not set

You need to provide more information. What exactly did you try?

If your dotfiles are in a public repo, pointing us to that will help us diagnose potential issues much faster. If not, an example of the .chezmoiignore file(s) you are using would be good to see.

Additionally, if you have set .chezmoiroot, your .chezmoiignore file needs to be in the root directory inside the working tree, not in your working tree. That is, if your working tree is ~/.local/share/chezmoi and you have .chezmoiroot set to home, then your ignore file would be at ~/.local/share/chezmoi/home/.chezmoiignore.

Your dot_config/nvim doesn't look right. Did you copy/install it from somewhere else (and if so, how?) or create it from scratch?

The dot_chezmoiignore file present in that directory will not work as expected, and indicates that you added it (or its containing directory) with chezmoi add.

I'm not sure how you ended up with many files with the executable_ attribute.

The entries in .chezmoiignore are target paths which are relative to the destination directory. Based on your current dot_config/nvim directory, you would probably need to add something like .config/nvim/lua/plugins/lazygit.lua to your .chezmoiignore.

I would recommend backing up dot_config/nvim somewhere and recreating it from scratch. You can do this either by creating the directories and files (complete with the required source state attributes) manually inside your source directory (default: ~/.local/share/chezmoi) and running chezmoi apply or by creating the files in your destination directory (default: ~) without any source state attributes and then running chezmoi add ~/.config/nvim.

Hey. Thanks for your replies. Im not sure i recall how i added it but i thinki did somthing like chezmoi add .config/neovim.
I also thought it was wierd with the naming prefix executable_,
I will try to recreate from scratch.

Ill close this and give that a try. Thanks again!