Re: [PATCH v4 15/28] format_trailer_info(): avoid double-printing the separator
- From
- Linus Arver <linusa@google.com>
- Date
- Feb 13, 2024, 17:21 UTC
- Message-ID
- <owlyr0hgb7qg.fsf@fine.c.googlers.com>
- In-Reply-To
- <CAP8UFD3u+QDx2LqpO2ZpeHQszwjMAsQ90qqbE7Om=t1vPRQ==w@mail.gmail.com>
Christian Couder <christian.couder@gmail.com> writes:
Show 16 quoted lines
> On Tue, Feb 6, 2024 at 6:12 AM Linus Arver via GitGitGadget > <gitgitgadget@gmail.com> wrote: >> >> From: Linus Arver <linusa@google.com> >> >> Do not hardcode the printing of ": " as the separator and space (which >> can result in double-printing these characters); instead only >> print the separator and space if we cannot find any recognized separator >> somewhere in the key (yes, keys may have a trailing separator in it --- >> we will eventually fix this design but not now). Do so by copying the >> code out of print_tok_val(), and deleting the same function. >> >> The test suite passes again with this change. > > I think it should be clearer above that this fixes a bug that was > introduced earlier in the series.
Ack, will add something like
This double printing is from a bug introduced earlier when we
started using format_trailer_info() everywhere.to this patch's description, but also add explicit language in "trailer: begin formatting unification" to say that the change is introducing temporary bugs (and that this is why the tests break).
> Also I wonder why it was not possible to modify format_trailer_info() > like it is done in this patch before using it to replace > format_trailers().
The artificial organization apparent in this patch was deliberate, in order to make it painfully obvious exactly what was being replaced and how. See https://lore.kernel.org/git/xmqqjzno13ev.fsf@gitster.g/