I bumped into a quirk with Git encryption filter: for some reason, git diff --stat and family doesn't call textconv if the decrypted file in repo is empty. It compares the decrypted empty file with encrypted file in repo, which results in a permanent phantom diff.
Which would be a minor quirk, but git diff --shortstat is what my zsh prompt calls to get summary, which means my shell thinks there are some changes and my prompt is red, which is personally annoying.
Liquidprompt is quite popular and it's likely that other similar status tools for shells, editors and such are confused.
All the empty files (so far) were values.yaml in Helm directories. This PR lets yaml.Marshal write {} into the values file, which makes the files not empty and fixes the diff.
Drive-by fix: one unrelated test was failing for me because of a symlink in $TMPDIR (AFAIK a normal thing in MacOS), fixed that too.
Labels
bug-fix
Test Plan
Ran plural build in my repository, ran make test
Checklist
[x] If required, I have updated the Plural documentation accordingly.
[x] I have added tests to cover my changes.
[x] I have added a meaningful title and summary to convey the impact of this PR to a user.
[ ] I have added relevant labels to this PR to help with categorization for release notes.
Summary
I bumped into a quirk with Git encryption filter: for some reason,
git diff --stat
and family doesn't calltextconv
if the decrypted file in repo is empty. It compares the decrypted empty file with encrypted file in repo, which results in a permanent phantom diff.Which would be a minor quirk, but
git diff --shortstat
is what my zsh prompt calls to get summary, which means my shell thinks there are some changes and my prompt is red, which is personally annoying.Liquidprompt is quite popular and it's likely that other similar status tools for shells, editors and such are confused.
All the empty files (so far) were
values.yaml
in Helm directories. This PR letsyaml.Marshal
write{}
into the values file, which makes the files not empty and fixes the diff.Drive-by fix: one unrelated test was failing for me because of a symlink in
$TMPDIR
(AFAIK a normal thing in MacOS), fixed that too.Labels
bug-fix
Test Plan
Ran
plural build
in my repository, ranmake test
Checklist