Subject: Re: [PATCH v5 4/6] pretty: allow caller to disable indentation

From: Toon Claes <[email-masked]>
Date: Thu, 17 Jul 2025 18:31:08 +0200

Junio C Hamano <[email-masked]> writes:

> Toon Claes <[email-masked]> writes:
>
>> Most pretty formats indent the commit message with 4 spaces. Add field
>> `no_indent` to `struct pretty_print_context` to suppress this
>> indentation.
>>
>> Signed-off-by: Toon Claes <[email-masked]>
>>
>> # Conflicts:
>> #	pretty.h
>
> Careful.  There is no need to rush your patches to send a version
> that hasn't been proof-read.

Whoops, I missed that. No idea how that happened. I have
`core.commentchar` set to `;`, because I used to write markdown headings
in my commit messages (with leading `#`). But even then, this should not
happen. I'm curious if I'm able to figure out what went wrong...

>>
>> Signed-off-by: Toon Claes <[email-masked]>
>> ---
>
> I doubt that this is what you want in this series anyway, though.
> You use this for "-z --extended", which presumably is about giving
> the output that is as faithful as possible to the original, but if
> you look at pretty_print_commit(), it does a LOT MORE than just
> indent the log by 4 spaces.  I suspect you would rather want to
> avoid even calling pretty_print_commit() in such a code path.

That's a good point. Before I submitted this version I was thinking to
have it support `--format` and `--pretty`, but that was even more
complex than what we have here. Indeed, we probably don't need
pretty_print_commit(). 

-- 
Cheers,
Toon