You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
yq loses comments around merge‑tags when used in an ireduce pipeline #2516
When a YAML document that contains merge‑tags << is processed with the irreduce operator, comments that precede the merge‑key are removed from the output.
In contrast, a simple yq '.' file.yaml (or yq '. * {}' file.yaml) preserves all comments in the file. Thus the issue appears only when a merge‑key is part of an irreduce operation.
The merge‑operator should behave like a normal node for the purposes of comment preservation. The output of the ireduce pipeline should be identical to the input, except that the mapping merge has been applied.
❌ Actual Behaviour
Comments that precede a merge‑key are dropped.
The comment that appears on the same line as the key (v1) is moved to the key line.
Comments that follow a key (e.g., v:) are preserved.
changed the title [-]`yq` loses comments around merge‑tags when used in an `irreduce` pipeline[/-][+]`yq` loses comments around merge‑tags when used in an `ireduce` pipeline[/+]on Nov 18, 2025
Activity
[-]`yq` loses comments around merge‑tags when used in an `irreduce` pipeline[/-][+]`yq` loses comments around merge‑tags when used in an `ireduce` pipeline[/+]