git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Avoid passing global comment_line_char repeatedly
@ 2023-10-30  5:10 Junio C Hamano
  2023-10-30  5:10 ` [PATCH 1/2] strbuf_commented_addf(): drop the comment_line_char parameter Junio C Hamano
                   ` (3 more replies)
  0 siblings, 4 replies; 21+ messages in thread
From: Junio C Hamano @ 2023-10-30  5:10 UTC (permalink / raw)
  To: git

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

 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(-)

-- 
2.42.0-526-g3130c155df


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

end of thread, other threads:[~2023-11-01  4:37 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-30  5:10 [PATCH 0/2] Avoid passing global comment_line_char repeatedly Junio C Hamano
2023-10-30  5:10 ` [PATCH 1/2] strbuf_commented_addf(): drop the comment_line_char parameter Junio C Hamano
2023-10-30  5:10 ` [PATCH 2/2] strbuf_add_commented_lines(): " Junio C Hamano
2023-10-30  5:36 ` [PATCH 0/2] Avoid passing global comment_line_char repeatedly Dragan Simic
2023-10-30  9:59 ` Phillip Wood
2023-10-30 20:22   ` [RFC PATCH 0/3] " Jonathan Tan
2023-10-30 20:22     ` [RFC PATCH 1/3] strbuf: make add_lines() public Jonathan Tan
2023-10-30 23:53       ` Junio C Hamano
2023-10-31  6:01         ` Junio C Hamano
2023-10-30 20:22     ` [RFC PATCH 2/3] strbuf_commented_addf(): drop the comment_line_char parameter Jonathan Tan
2023-10-31  5:19       ` Junio C Hamano
2023-10-31 22:24         ` Jonathan Tan
2023-10-31 23:54           ` Junio C Hamano
2023-10-30 20:22     ` [RFC PATCH 3/3] strbuf_add_commented_lines(): " Jonathan Tan
2023-10-31 22:28   ` [PATCH v2 0/4] Avoid passing global comment_line_char repeatedly Jonathan Tan
2023-10-31 22:28     ` [PATCH v2 1/4] strbuf_commented_addf(): drop the comment_line_char parameter Jonathan Tan
2023-10-31 22:28     ` [PATCH v2 2/4] strbuf_add_commented_lines(): " Jonathan Tan
2023-10-31 22:28     ` [PATCH v2 3/4] strbuf: make add_lines() public Jonathan Tan
2023-11-01  4:14       ` Junio C Hamano
2023-10-31 22:28     ` [PATCH v2 4/4] strbuf: move env-using functions to environment.c Jonathan Tan
2023-11-01  4:37       ` Junio C Hamano

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).