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

Lines/Keys added to a system file are not removed #100

Closed
elbowz opened this issue Mar 15, 2024 · 3 comments
Closed

Lines/Keys added to a system file are not removed #100

elbowz opened this issue Mar 15, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@elbowz
Copy link

elbowz commented Mar 15, 2024

Describe the bug

Lines/Keys present in a system file but not in the source one (ie. src.ini), are not removed after a chezmoi apply

To Reproduce

% cat dot_config/modify_private_test_chmm
#!/usr/bin/env chezmoi_modify_manager

source auto

transform regex ".*" ".*" kde-shortcut
% cat dot_config/private_test_chmm.src.ini
[Test0]
key01=value1
key02=value2
key03=value3
% cat ~/.config/test_chmm
[Test0]
key01=value1
key02=value2
key03=value3
line_added_to_delete
% chezmoi apply -vn
% chezmoi diff

Nothing is printed about "line_added_to_delete".

Expected behavior

--- a/home/muttley/.config/test_chmm
+++ b/tmp/chezmoi-diff3590156634/.config/test_chmm
@@ -2,5 +2,4 @@
 key01=value1
 key02=value2
 key03=value3
-line_added_to_delete

The issue is the transform present in modify_private_test_chmm, removing it, all works.

@elbowz elbowz added the bug Something isn't working label Mar 15, 2024
@VorpalBlade
Copy link
Owner

That does indeed seem like a bug. My gut feeling is that it is related to the transform somehow.

@elbowz
Copy link
Author

elbowz commented Mar 15, 2024

That does indeed seem like a bug. My gut feeling is that it is related to the transform somehow.

Absolutely:

The issue is the transform present in modify_private_test_chmm, removing it, all works.

@VorpalBlade
Copy link
Owner

A new release will be available soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants