hledger
hledger copied to clipboard
[WIP] Change inheriting valued tags to override
Resolves #1950
Old behaviour of inheriting tags with values was that tags added to, for instance, a posting, would be added to the tags, possibly overriding the tags of the transaction. Or, in other words, the transaction tags were added to the posting tags, as there was no sense of overriding a tag.
The new behaviour is that tags are now overridden when a lower level element re-uses that tag name. For instance, when defining a transaction with tag t:v and posting with tag t:v2, only t:v2 remains on the posting, overriding the transaction tag. The same thing is also changed for the relation between parent accounts and accounts. Although I am less sure whether that would be desired behaviour, as parent accounts might say more about child accounts than transactions do about their postings.
Perhaps it would be desirable to add an option for additive tags over overriding tags, as it may well be useful at times to add to tags in the parent?
Here's my related comment on the parent issue #1950, suggesting things to help move this forward: https://github.com/simonmichael/hledger/issues/1950#issuecomment-1382899511