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

How to ignore files containing # #4206

Closed
3 tasks done
Uroc327 opened this issue Jan 13, 2025 · 2 comments · Fixed by #4210
Closed
3 tasks done

How to ignore files containing # #4206

Uroc327 opened this issue Jan 13, 2025 · 2 comments · Fixed by #4210
Labels
enhancement New feature or request

Comments

@Uroc327
Copy link

Uroc327 commented Jan 13, 2025

What exactly are you trying to do?

I would like to ignore all files matching the pattern dir/**/*.org#.

What have you tried so far?

Adding the pattern as line to .chezmoiignore as well as adding dir/**/*.org{{- "#" -}} (inspired by quoting double curly braces) does not seem to work.

Where else have you checked for solutions?

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

$ chezmoi --verbose $COMMAND

Output of chezmoi doctor

$ chezmoi doctor
RESULT    CHECK                       MESSAGE
ok        version                     v2.57.0, commit v2.57.0, built at 2025-01-06, built by xbps
warning   latest-version              v2.58.0
ok        os-arch                     linux/amd64 (Void)
ok        uname                       Linux TUEILNT-MO-CR2 6.12.9_1 #1 SMP PREEMPT_DYNAMIC Fri Jan 10 00:53:27 UTC 2025 x86_64 GNU/Linux
ok        go-version                  go1.23.4 (gc)
ok        executable                  /usr/bin/chezmoi
ok        config-file                 ~/.config/chezmoi/chezmoi.toml, last modified 2025-01-13T00:33:17+01:00
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
ok        diff-command                found /usr/bin/delta
ok        edit-command                found /usr/bin/nvim
ok        edit-args                   /usr/bin/nvim
ok        git-command                 found /usr/bin/git, version 2.47.1
ok        merge-command               found /usr/bin/nvim
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.4.5
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
ok        keepassxc-command           found /usr/bin/keepassxc-cli, version 2.7.9
info      keepassxc-db                not set
info      keeper-command              keeper not found in $PATH
info      lastpass-command            lpass not found in $PATH
info      pass-command                pass not found in $PATH
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

Additional context

These files can be generated as temporaries by org-mode.

@Uroc327 Uroc327 added the support Support request label Jan 13, 2025
@KapJI
Copy link
Contributor

KapJI commented Jan 13, 2025

-}} this - removes new line char, merging two lines if this is not the last line.

But yeah, it doesn't seem to work anyway.

@twpayne
Copy link
Owner

twpayne commented Jan 14, 2025

This is not currently possible because chezmoi treats a # in .chezmoiignore file as the start of a comment.

#4210 fixes this to require the # to be either at the start of a line or have preceding whitespace to be considered the start of the comment.

Of course, this means that filenames starting with # or containing a space and a # cannot be ignored, but I think that's OK. Filenames containing weird characters are often problematic.

emacs is particularly unpleasant to other programs as it "cleverly" abuses conventions in many ways, e.g. creating broken symlinks on purpose, creating files with strange names, and creating temporary files in permanent locations.

@twpayne twpayne added enhancement New feature or request and removed support Support request labels Jan 14, 2025
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 22, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants