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

--follow and --recursive add seem to conflict #3772

Open
Uroc327 opened this issue May 22, 2024 · 1 comment
Open

--follow and --recursive add seem to conflict #3772

Uroc327 opened this issue May 22, 2024 · 1 comment
Labels
bug Something isn't working patience Patience required, there is no date for this being fixed

Comments

@Uroc327
Copy link

Uroc327 commented May 22, 2024

Describe the bug

Issuing chezmoi add --follow --recursive abc (the --recursive is there for redundancy) when .abc is a symlink pointing to a directory, only the directory but not it's contents are added the chezmoi.

To reproduce

mkdir -p test
touch test/a
touch test/b
touch test/c
ln -s test abc
chezmoi add --follow --recursive abc
chezmoi managed
# observe that abc/a, abc/b, abc/c, are missing and only abc is managed

Expected behavior

All files a, b, and c should be managed.

@twpayne
Copy link
Owner

twpayne commented Jun 24, 2024

As a quick update on this, I did some investigation in this branch. This is definitely a bug in chezmoi, but due to chezmoi's current implementation it's really hard to fix. chezmoi stats the symlink (abc in the example you give) in multiple different places and needs to treat it as a directory for --follow but as a path component for --recursive.

@twpayne twpayne added the patience Patience required, there is no date for this being fixed label Aug 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working patience Patience required, there is no date for this being fixed
Projects
None yet
Development

No branches or pull requests

2 participants