git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2 2/2] sequencer: fix remaining hardcoded comment char

From
TGTony Tung via GitGitGadget <gitgitgadget@gmail.com>
Date
Oct 31, 2023, 05:09 UTC
Message-ID
<c9f4ff34dbdb7ba221e4203bb6551b80948dc71d.1698728953.git.gitgitgadget@gmail.com>
In-Reply-To
<pull.1603.v2.git.1698728952.gitgitgadget@gmail.com>
From: Tony Tung <tonytung@merly.org>
Signed-off-by: Tony Tung <tonytung@merly.org>
---
 sequencer.c | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)
diff --git a/sequencer.c b/sequencer.c
index 8c6666d5e43..bbadc3fb710 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -1893,8 +1893,14 @@ static void update_squash_message_for_fixup(struct strbuf *msg)
 	size_t orig_msg_len;
 	int i = 1;
 
-	strbuf_addf(&buf1, "# %s\n", _(first_commit_msg_str));
-	strbuf_addf(&buf2, "# %s\n", _(skip_first_commit_msg_str));
+	strbuf_commented_addf(&buf1,
+			      comment_line_char,
+			      "%s\n",
+			      _(first_commit_msg_str));
+	strbuf_commented_addf(&buf2,
+			      comment_line_char,
+			      "%s\n",
+			      _(skip_first_commit_msg_str));
 	s = start = orig_msg = strbuf_detach(msg, &orig_msg_len);
 	while (s) {
 		const char *next;
@@ -2269,8 +2275,9 @@ static int do_pick_commit(struct repository *r,
 		next = parent;
 		next_label = msg.parent_label;
 		if (opts->commit_use_reference) {
-			strbuf_addstr(&msgbuf,
-				"# *** SAY WHY WE ARE REVERTING ON THE TITLE LINE ***");
+			strbuf_commented_addf(&msgbuf,
+					      "%s",
+					      "*** SAY WHY WE ARE REVERTING ON THE TITLE LINE ***");
 		} else if (skip_prefix(msg.subject, "Revert \"", &orig_subject) &&
 			   /*
 			    * We don't touch pre-existing repeated reverts, because
@@ -6082,7 +6089,8 @@ static int add_decorations_to_list(const struct commit *commit,
 		/* If the branch is checked out, then leave a comment instead. */
 		if ((path = branch_checked_out(decoration->name))) {
 			item->command = TODO_COMMENT;
-			strbuf_commented_addf(ctx->buf, comment_line_char,
+			strbuf_commented_addf(ctx->buf,
+					      comment_line_char,
 					      "Ref %s checked out at '%s'\n",
 					      decoration->name, path);
 		} else {
-- 
gitgitgadget
Previous: Junio C HamanoNext: Phillip Wood
Message 13 of 18 in “sequencer: remove use of comment character”
  1. sequencer: remove use of comment characterTony Tung via GitGitGadget, Oct 30, 2023
  2. Junio C HamanoOct 30, 2023
  3. Elijah NewrenOct 30, 2023
  4. Junio C HamanoOct 30, 2023
  5. Tony TungOct 31, 2023
  6. Tony TungOct 31, 2023
  7. Junio C HamanoOct 31, 2023
  8. Elijah NewrenOct 31, 2023
  9. 0/2 sequencer: remove use of hardcoded comment charTony Tung via GitGitGadget, Oct 31, 2023
  10. 1/2 sequencer: remove use of comment characterTony Tung via GitGitGadget, Oct 31, 2023
  11. Phillip WoodOct 31, 2023
  12. Junio C HamanoNov 1, 2023
  13. 2/2 sequencer: fix remaining hardcoded comment charTony Tung via GitGitGadget, Oct 31, 2023
  14. Phillip WoodOct 31, 2023
  15. Elijah NewrenOct 31, 2023
  16. Phillip WoodOct 31, 2023
  17. Junio C HamanoNov 1, 2023
  18. Elijah NewrenNov 1, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.