From e72350ae75b87722fa5211308d2d48b171711a6d Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Tue, 6 Dec 2022 08:15:06 -1000 Subject: [PATCH] ;doc: tags: discuss multi-values/overriding (#1950) --- hledger/hledger.m4.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/hledger/hledger.m4.md b/hledger/hledger.m4.md index 910b15a8d..1cd4a428a 100644 --- a/hledger/hledger.m4.md +++ b/hledger/hledger.m4.md @@ -2360,7 +2360,7 @@ So in the example above, Tags can have a value, which is the text after the colon, until the next comma or end of line, with surrounding whitespace stripped. -Note this means that hledger tag values may not contain commas. +Note this means that hledger tag values can not contain commas. For example, in this posting: ```journal expenses:food $10 ; foo, tag1: value 1 , tag2:value 2, bar tag3: , baz @@ -2370,6 +2370,16 @@ For example, in this posting: - `tag2`'s value is "value 2" - `tag3`'s value is "" (the empty string) +Note that tags are multi-valued. When a tag name is seen again with a new value, +the new value is added, rather than overriding the previous value. +Currently this is true for all same-tag situations, ie: + +- Same tag on multiple transactions +- Posting inheriting the same tag from its transaction or account +- Transaction acquiring the same tag from one or more of its postings + +To list all of a tag's values: `hledger tags --values TAGNAME` + ## Postings A posting is an addition of some amount to, or removal of some amount from, an account.