Subject: [PATCH 0/8] pretty: minor bugfixing, some refactorings

From: Martin Ågren <[email-masked]>
Date: Wed, 19 Mar 2025 08:23:33 +0100

Hi,

I've been going through pretty.c with an eye to pulling apart parsing of
placeholders and formatting of strings. These are some initial cleanups
I've accumulated in the process. I think they should be valuable on
their own, even if I eventually abandon the bigger project.

Martin Ågren (8):
  pretty: tighten function signature to not take `void *`
  pretty: simplify if-else to reduce code duplication

Two more or less simple cleanups.

  pretty: collect padding-related fields in separate struct
  pretty: fix parsing of half-valid "%<" and "%>" placeholders
  pretty: after padding, reset padding info

Fix a bug or two in parsing and handling of padding placeholders.

  pretty: refactor parsing of line-wrapping "%w" placeholder
  pretty: refactor parsing of magic
  pretty: refactor parsing of decoration options

Further splitting without any intended changes in behavior. These
refactorings aren't followed by any patch that actually benefits from
them. Still, I do think these end up making the code a tiny bit easier
to understand by way of having smaller functions and collecting related
pieces of data into smaller structs.

Unless the original authors are (TTBOMK) no longer around, I'm cc-ing
them on the individual patches and on this cover letter.

Martin

 pretty.c                      | 300 +++++++++++++++++++++-------------
 t/t4205-log-pretty-formats.sh |  15 ++
 2 files changed, 197 insertions(+), 118 deletions(-)

-- 
2.49.0.472.ge94155a9ec