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

--alias doesn't interact well with balance assertions and assignments #2121

Open
Xitian9 opened this issue Dec 1, 2023 · 1 comment
Open
Labels
A-BUG Something wrong, confusing or sub-standard in the software, docs, or user experience. docs Documentation-related. impact3 Affects just a few users. journal The journal file format, and its features. severity2 Minor to moderate usability/doc bug, reasonably easy to avoid or tolerate.

Comments

@Xitian9
Copy link
Collaborator

Xitian9 commented Dec 1, 2023

Occasionally one may want to use --alias to combine different accounts into one. However, if one does this, balance assertions may start to fail because the assertions meant for the original accounts no longer hold for the merged account names.

This issue can be worked around by using --ignore-assertions, so this is not a high priority, but it seems suboptimal. Perhaps account aliases should only be applied after parsing and verifying assertions.

A slightly larger issue arises in that balance assignments will give different values if aliases are applied. This is in some sense worse because the output of the journal will silently be different, rather than raising an ignorable error. However, some people may rely on this functionality to generate different output in different cases. That seems dangerous and probably shouldn't be allowed.

@Xitian9 Xitian9 added the A-BUG Something wrong, confusing or sub-standard in the software, docs, or user experience. label Dec 1, 2023
@simonmichael simonmichael added impact3 Affects just a few users. docs Documentation-related. journal The journal file format, and its features. severity2 Minor to moderate usability/doc bug, reasonably easy to avoid or tolerate. labels Dec 13, 2023
@simonmichael
Copy link
Owner

There is some discussion of account aliases' ability to break your journal starting at https://hledger.org/dev/hledger.html#aliases-can-generate-bad-account-names .

They are a powerful sharp tool and I'm not sure it's possible to keep everything working with arbitrary aliases. So I'm not sure this is a bug. I'd be glad to try out alternatives though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-BUG Something wrong, confusing or sub-standard in the software, docs, or user experience. docs Documentation-related. impact3 Affects just a few users. journal The journal file format, and its features. severity2 Minor to moderate usability/doc bug, reasonably easy to avoid or tolerate.
Projects
None yet
Development

No branches or pull requests

2 participants