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

Re: [PATCH 0/2] Simplify "commented" API functions

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 12, 2024, 21:57 UTC
Message-ID
<xmqq8qvw357v.fsf@gitster.g>
In-Reply-To
<20240912205301.1809355-1-gitster@pobox.com>
Junio C Hamano <gitster@pobox.com> writes:
Show 5 quoted lines
> [earlier] https://lore.kernel.org/git/xmqq7cn4g3nx.fsf@gitster.g/
>
> Junio C Hamano (2):
>   strbuf: retire strbuf_commented_addf()
>   strbuf: retire strbuf_commented_lines()

This of course has a semantic conflict with the change that hides not just "the_repository" and functions that implicitly use that variable but other unrelated globals from environment.h behind a compatibility macro.

A trivial merge-fix to be used to annotate the merge to make it an evil merge whose result compiles looks like this:

    merge-fix/jc/strbuf-commented-something
diff --git a/strbuf.c b/strbuf.c
index 05a6dc944b..cb972b07f7 100644
--- a/strbuf.c
+++ b/strbuf.c
@@ -7,6 +7,14 @@
 #include "utf8.h"
 #include "date.h"
 
+/*
+ * We do not need the_repository at all, but the comment_line_str is
+ * hidden behind USE_THE_REPOSITORY_VARIABLE CPP macro.  We could
+ * #define it before including "envirnoment.h".  Or we can make an
+ * external declaration ourselves here.
+ */
+extern const char *comment_line_str;
+
 int starts_with(const char *str, const char *prefix)
 {
 	for (; ; str++, prefix++)
Previous: Kristoffer HaugsbakkNext: Patrick Steinhardt
Message 5 of 7 in “Simplify "commented" API functions”
  1. 0/2 Simplify "commented" API functionsJunio C Hamano, Sep 12, 2024
  2. 1/2 strbuf: retire strbuf_commented_addf()Junio C Hamano, Sep 12, 2024
  3. 2/2 strbuf: retire strbuf_commented_lines()Junio C Hamano, Sep 12, 2024
  4. Kristoffer HaugsbakkOct 29, 2024
  5. Junio C HamanoSep 12, 2024
  6. Patrick SteinhardtSep 13, 2024
  7. Junio C HamanoSep 13, 2024

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.