git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/8] pretty: minor bugfixing, some refactorings
@ 2025-03-19  7:23 Martin Ågren
  2025-03-19  7:23 ` [PATCH 1/8] pretty: tighten function signature to not take `void *` Martin Ågren
                   ` (7 more replies)
  0 siblings, 8 replies; 22+ messages in thread
From: Martin Ågren @ 2025-03-19  7:23 UTC (permalink / raw)
  To: git
  Cc: Patrick Steinhardt, Jeff King, René Scharfe, Junio C Hamano,
	Andy Koppe

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


^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2025-03-24 10:10 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-19  7:23 [PATCH 0/8] pretty: minor bugfixing, some refactorings Martin Ågren
2025-03-19  7:23 ` [PATCH 1/8] pretty: tighten function signature to not take `void *` Martin Ågren
2025-03-20  9:18   ` Patrick Steinhardt
2025-03-19  7:23 ` [PATCH 2/8] pretty: simplify if-else to reduce code duplication Martin Ågren
2025-03-20  9:17   ` Patrick Steinhardt
2025-03-20 16:10     ` Martin Ågren
2025-03-24  3:50   ` Jeff King
2025-03-19  7:23 ` [PATCH 3/8] pretty: collect padding-related fields in separate struct Martin Ågren
2025-03-19  7:23 ` [PATCH 4/8] pretty: fix parsing of half-valid "%<" and "%>" placeholders Martin Ågren
2025-03-20  9:18   ` Patrick Steinhardt
2025-03-20 16:11     ` Martin Ågren
2025-03-24 10:10       ` Patrick Steinhardt
2025-03-19  7:23 ` [PATCH 5/8] pretty: after padding, reset padding info Martin Ågren
2025-03-20  9:18   ` Patrick Steinhardt
2025-03-20 16:11     ` Martin Ågren
2025-03-19  7:23 ` [PATCH 6/8] pretty: refactor parsing of line-wrapping "%w" placeholder Martin Ågren
2025-03-20  9:18   ` Patrick Steinhardt
2025-03-20 16:11     ` Martin Ågren
2025-03-19  7:23 ` [PATCH 7/8] pretty: refactor parsing of magic Martin Ågren
2025-03-20  9:18   ` Patrick Steinhardt
2025-03-20 16:12     ` Martin Ågren
2025-03-19  7:23 ` [PATCH 8/8] pretty: refactor parsing of decoration options Martin Ågren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).