ka-promote: normalise git-format-patch trailers (-- \n<version>\n) when concatenating
#31
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
ka-promote ohmconcatenates per-include.patchfiles into a singlecumulative.patchand assumes each input is well-formed forpatch(1)to parse in series. Discovered during ohm pkgrel=4/5 builds (PR #28): whether a patch needs a trailing-- \n<version>\n\nsentinel depends on its position in the concatenation:patch(1)knows where the patch ends and the nextFrom <sha>header begins.patch(1)reads it at EOF as the start of a malformed new patch and errors out (malformed patch at line N: 2.54.0).This means source patches in
patches/...series-dirs have to be position-aware, which is brittle: adding a new include at the end offleet/<host>.yamlrequires editing the trailer of the patch that used to be last.Reproducer
In
fleet/ohm.yamlduring the pkgrel=4 → pkgrel=5 work:84734ba).Proposed fix
Make
ka-promote'swrite_cumulative()normalise trailers automatically:This way source patches in
patches/...can be in either shape; the cumulative is always well-formed forpatch(1)regardless of include ordering.Acceptance
fleet/<host>.yamldoes not require editing any patch source file's trailer.patches/arch/arm64/xor-neon-...-style) continue to work.ka-promote --validate-against <clean-checkout>continues to pass on ohm.Companion
Once this lands, the brittle commit history on PR #28 (multiple trailer flip-flops as the cumulative shape changed) can be linted away in a one-shot reformat of source patches to a canonical form. Tracked here separately from the migration to keep PR #28 focused on shipping.