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

[PATCH 3/4] merge-ort: drop unused parameters from detect_and_process_renames()

From
Jeff King <peff@peff.net>
Date
Sep 14, 2023, 09:39 UTC
Message-ID
<20230914093958.GC2254894@coredump.intra.peff.net>
In-Reply-To
<20230914093409.GA2254811@coredump.intra.peff.net>

This function takes three trees representing the merge base and both sides of the merge, but never looks at any of them. This is due to f78cf97617 (merge-ort: call diffcore_rename() directly, 2021-02-14). Prior to that commit, we passed pairs of trees to diff_tree_oid(). But after that commit, we collect a custom diff_queue for each pair in the merge_options struct, and just run diffcore_rename() on the result. So the function does not need to know about the original trees at all anymore.

Signed-off-by: Jeff King <peff@peff.net>
---
 merge-ort.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/merge-ort.c b/merge-ort.c
index 31c663b297..20eefd9b5e 100644
--- a/merge-ort.c
+++ b/merge-ort.c
@@ -3324,10 +3324,7 @@ static int collect_renames(struct merge_options *opt,
 	return clean;
 }
 
-static int detect_and_process_renames(struct merge_options *opt,
-				      struct tree *merge_base,
-				      struct tree *side1,
-				      struct tree *side2)
+static int detect_and_process_renames(struct merge_options *opt)
 {
 	struct diff_queue_struct combined = { 0 };
 	struct rename_info *renames = &opt->priv->renames;
@@ -4964,8 +4961,7 @@ static void merge_ort_nonrecursive_internal(struct merge_options *opt,
 	trace2_region_leave("merge", "collect_merge_info", opt->repo);
 
 	trace2_region_enter("merge", "renames", opt->repo);
-	result->clean = detect_and_process_renames(opt, merge_base,
-						   side1, side2);
+	result->clean = detect_and_process_renames(opt);
 	trace2_region_leave("merge", "renames", opt->repo);
 	if (opt->priv->renames.redo_after_renames == 2) {
 		trace2_region_enter("merge", "reset_maps", opt->repo);
-- 
2.42.0.628.g8a27295885
Previous: Jeff KingNext: Elijah Newren
Message 6 of 15 in “merge-ort unused parameter cleanups”
  1. 0/4 merge-ort unused parameter cleanupsJeff King, Sep 14, 2023
  2. 1/4 merge-ort: drop custom err() functionJeff King, Sep 14, 2023
  3. Elijah NewrenSep 16, 2023
  4. Jeff KingSep 16, 2023
  5. 2/4 merge-ort: stop passing "opt" to read_oid_strbuf()Jeff King, Sep 14, 2023
  6. 3/4 merge-ort: drop unused parameters from detect_and_process_renames()Jeff King, Sep 14, 2023
  7. Elijah NewrenSep 16, 2023
  8. 4/4 merge-ort: drop unused "opt" parameter from merge_check_renames_reusable()Jeff King, Sep 14, 2023
  9. Elijah NewrenSep 16, 2023
  10. Jeff KingSep 16, 2023
  11. Elijah NewrenSep 16, 2023
  12. 5/4 merge-ort: lowercase a few error messagesJeff King, Sep 16, 2023
  13. Jeff KingSep 16, 2023
  14. Junio C HamanoSep 16, 2023
  15. Jeff KingSep 16, 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.