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

[PATCH 6/6] fast-export: drop unused parameter from anonymize_commit_message()

From
Jeff King <peff@peff.net>
Date
Mar 22, 2023, 17:43 UTC
Message-ID
<20230322174322.GD11424@coredump.intra.peff.net>
In-Reply-To
<20230322173636.GA5643@coredump.intra.peff.net>

As the comment above the function indicates, we do not bother actually storing commit messages in our anonymization map. But we still take the message as a parameter, and just ignore it. Let's stop doing that, which will make -Wunused-parameter happier.

Signed-off-by: Jeff King <peff@peff.net>
---
 builtin/fast-export.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/builtin/fast-export.c b/builtin/fast-export.c
index 12adf75964c..f3cc5486861 100644
--- a/builtin/fast-export.c
+++ b/builtin/fast-export.c
@@ -556,7 +556,7 @@ static const char *anonymize_refname(const char *refname)
  * We do not even bother to cache commit messages, as they are unlikely
  * to be repeated verbatim, and it is not that interesting when they are.
  */
-static char *anonymize_commit_message(const char *old)
+static char *anonymize_commit_message(void)
 {
 	static int counter;
 	return xstrfmt("subject %d\n\nbody\n", counter++);
@@ -683,7 +683,7 @@ static void handle_commit(struct commit *commit, struct rev_info *rev,
 
 	mark_next_object(&commit->object);
 	if (anonymize) {
-		reencoded = anonymize_commit_message(message);
+		reencoded = anonymize_commit_message();
 	} else if (encoding) {
 		switch(reencode_mode) {
 		case REENCODE_YES:
-- 
2.40.0.595.g9b96b494d8c
Previous: Jeff KingNext: Derrick Stolee
Message 7 of 9 in “minor cleanups to fast-export --anonymize”
  1. 0/6 minor cleanups to fast-export --anonymizeJeff King, Mar 22, 2023
  2. 1/6 fast-export: drop const when storing anonymized valuesJeff King, Mar 22, 2023
  3. 2/6 fast-export: simplify initialization of anonymized hashmapsJeff King, Mar 22, 2023
  4. 3/6 fast-export: factor out anonymized_entry creationJeff King, Mar 22, 2023
  5. 4/6 fast-export: de-obfuscate --anonymize-map handlingJeff King, Mar 22, 2023
  6. 5/6 fast-export: drop data parameter from anonymous generatorsJeff King, Mar 22, 2023
  7. 6/6 fast-export: drop unused parameter from anonymize_commit_message()Jeff King, Mar 22, 2023
  8. Derrick StoleeMar 24, 2023
  9. Junio C HamanoMar 24, 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.