Skip to content

Avoid passing global comment_line_char repeatedly

Junio C Hamano git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2strbuf_commented_addf(): drop the comment_line_char parameteradd-patch.c builtin/branch.c builtin/merge.c +6 more+19 -180 replies
2/2strbuf_add_commented_lines(): drop the comment_line_char parameterbuiltin/notes.c builtin/stripspace.c fmt-merge-msg.c +5 more+21 -280 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] Avoid passing global comment_line_char repeatedly

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(-)
Signature · 1 line
2.42.0-526-g3130c155df