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

Re: [PATCH 4/4] merge-ort: drop unused "opt" parameter from merge_check_renames_reusable()

From
Elijah Newren <newren@gmail.com>
Date
Sep 16, 2023, 03:09 UTC
Message-ID
<CABPp-BEi1CSXEE=-dDi_bhtSsGeVWtivfT-jQP+hjWdv4agq=Q@mail.gmail.com>
In-Reply-To
<20230914094004.GD2254894@coredump.intra.peff.net>
On Thu, Sep 14, 2023 at 2:40 AM Jeff King <peff@peff.net> wrote:
Show 6 quoted lines
>
> The merge_options parameter has never been used since the function was
> introduced in 64aceb6d73 (merge-ort: add code to check for whether
> cached renames can be reused, 2021-05-20). In theory some merge options
> might impact our decisions here, but that has never been the case so
> far.

Yeah, it was used in some preliminary versions of the code while I was developing the new algorithm, but there were lots of changes between when I started working on merge-ort and when it was finally ready to submit for review. I must have just overlooked that this parameter was no longer needed. Thanks for catching and cleaning up.

> Let's drop it to appease -Wunused-parameter; it would be easy to add
> back later if we need to (there is only one caller).
Yep, makes sense.
Show 30 quoted lines
> Signed-off-by: Jeff King <peff@peff.net>
> ---
>  merge-ort.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/merge-ort.c b/merge-ort.c
> index 20eefd9b5e..3953c9f745 100644
> --- a/merge-ort.c
> +++ b/merge-ort.c
> @@ -4880,8 +4880,7 @@ static void merge_start(struct merge_options *opt, struct merge_result *result)
>         trace2_region_leave("merge", "allocate/init", opt->repo);
>  }
>
> -static void merge_check_renames_reusable(struct merge_options *opt,
> -                                        struct merge_result *result,
> +static void merge_check_renames_reusable(struct merge_result *result,
>                                          struct tree *merge_base,
>                                          struct tree *side1,
>                                          struct tree *side2)
> @@ -5083,7 +5082,7 @@ void merge_incore_nonrecursive(struct merge_options *opt,
>
>         trace2_region_enter("merge", "merge_start", opt->repo);
>         assert(opt->ancestor != NULL);
> -       merge_check_renames_reusable(opt, result, merge_base, side1, side2);
> +       merge_check_renames_reusable(result, merge_base, side1, side2);
>         merge_start(opt, result);
>         /*
>          * Record the trees used in this merge, so if there's a next merge in
> --
> 2.42.0.628.g8a27295885
Previous: Jeff KingNext: Jeff King
Message 9 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.