Re: [PATCH 0/2] Avoid passing global comment_line_char repeatedly
- From
- Dragan Simic <dsimic@manjaro.org>
- Date
- Oct 30, 2023, 05:36 UTC
- Message-ID
- <cb82440280c7112a0c1599ba4b6c90b6@manjaro.org>
- In-Reply-To
- <20231030051034.2295242-1-gitster@pobox.com>
On 2023-10-30 06:10, Junio C Hamano wrote:
Show 13 quoted lines
> Two strbuf functions used to produce commented lines take the > comment_line_char as their parameter, but in practice, all callers > feed the global variable comment_line_char from environment.[ch]. > > Dropping the parameter from the callchain will make the interface > less flexible, and less error prone. If we choose to change the > implementation of the customizable comment line character (e.g., we > may want to stop referencing the global variable and instead use a > getter function), we will have fewer places we need to modify. > > Junio C Hamano (2): > strbuf_commented_addf(): drop the comment_line_char parameter > strbuf_add_commented_lines(): drop the comment_line_char parameter
This series looks good to me. It removes unnecessary complexity that provided pretty much no value.
Show 13 quoted lines
> add-patch.c | 8 ++++---- > builtin/branch.c | 2 +- > builtin/merge.c | 8 ++++---- > builtin/notes.c | 9 ++++----- > builtin/stripspace.c | 2 +- > builtin/tag.c | 4 ++-- > fmt-merge-msg.c | 9 +++------ > rebase-interactive.c | 8 ++++---- > sequencer.c | 14 ++++++-------- > strbuf.c | 9 +++++---- > strbuf.h | 7 +++---- > wt-status.c | 6 +++--- > 12 files changed, 40 insertions(+), 46 deletions(-)