Re: [PATCH v5 4/6] pretty: allow caller to disable indentation
- From
Toon Claes <toon@iotcl.com>
- Date
- Jul 17, 2025, 16:31 UTC
- Message-ID
- <87wm86ixtf.fsf@iotcl.com>
- In-Reply-To
- <xmqqbjpkcey4.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> writes:
Show 13 quoted lines
> Toon Claes <toon@iotcl.com> 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 <toon@iotcl.com> >> >> # 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...
Show 10 quoted lines
>> >> Signed-off-by: Toon Claes <toon@iotcl.com> >> --- > > 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