From: Elijah Newren <newren@gmail.com>
To: Jeff King <peff@peff.net>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: [PATCH 2/6] log-tree: drop unused commit param in remerge_diff()
Date: Fri, 19 Aug 2022 16:05:06 -0700 [thread overview]
Message-ID: <CABPp-BHvscxV+vVL-Tew2H4h8V_3bZpD0Qz9uEMwrV=X3zrYSg@mail.gmail.com> (raw)
In-Reply-To: <Yv9O2RK7ahmw5ge7@coredump.intra.peff.net>
On Fri, Aug 19, 2022 at 1:50 AM Jeff King <peff@peff.net> wrote:
>
> This function has never used its "commit" parameter since it was added
> in db757e8b8d (show, log: provide a --remerge-diff capability,
> 2022-02-02).
>
> This makes sense; we already have separate parameters for the parents
> (which lets us redo the merge) and the oid of the result tree (which we
> can then diff against the remerge result).
>
> Let's drop the unused parameter in the name of clarity.
>
> Signed-off-by: Jeff King <peff@peff.net>
> ---
> log-tree.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/log-tree.c b/log-tree.c
> index d0ac0a6327..82d9b5f650 100644
> --- a/log-tree.c
> +++ b/log-tree.c
> @@ -956,8 +956,7 @@ static void cleanup_additional_headers(struct diff_options *o)
>
> static int do_remerge_diff(struct rev_info *opt,
> struct commit_list *parents,
> - struct object_id *oid,
> - struct commit *commit)
> + struct object_id *oid)
> {
> struct merge_options o;
> struct commit_list *bases;
> @@ -1052,7 +1051,7 @@ static int log_tree_diff(struct rev_info *opt, struct commit *commit, struct log
> "for octopus merges.\n");
> return 1;
> }
> - return do_remerge_diff(opt, parents, oid, commit);
> + return do_remerge_diff(opt, parents, oid);
> }
> if (opt->combine_merges)
> return do_diff_combined(opt, commit);
> --
> 2.37.2.928.g0821088f4a
Yeah, looks like I could have just used commit instead of parents and
oid, but since the calling code had those handy, I added them directly
and forgot to remove commit.
Patch looks good.
next prev parent reply other threads:[~2022-08-19 23:05 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-19 8:48 [PATCH 0/6] unused function parameter potpourri Jeff King
2022-08-19 8:49 ` [PATCH 1/6] xdiff: drop unused mmfile parameters from xdl_do_histogram_diff() Jeff King
2022-08-19 13:32 ` Phillip Wood
2022-08-20 6:58 ` Jeff King
2022-08-20 7:36 ` [PATCH 7/6] xdiff: drop unused mmfile parameters from xdl_do_patience_diff() Jeff King
2022-08-26 13:15 ` Phillip Wood
2022-08-19 8:50 ` [PATCH 2/6] log-tree: drop unused commit param in remerge_diff() Jeff King
2022-08-19 23:05 ` Elijah Newren [this message]
2022-08-20 7:04 ` Jeff King
2022-08-19 8:50 ` [PATCH 3/6] match_pathname(): drop unused "flags" parameter Jeff King
2022-08-19 8:51 ` [PATCH 4/6] verify_one_sparse(): drop unused repository parameter Jeff King
2022-08-19 19:04 ` Derrick Stolee
2022-08-20 7:01 ` Jeff King
2022-08-20 8:48 ` René Scharfe
2022-08-20 9:02 ` [PATCH v2 " Jeff King
2022-08-19 8:54 ` [PATCH 5/6] reftable: drop unused parameter from reader_seek_linear() Jeff King
2022-08-19 19:06 ` Derrick Stolee
2022-08-22 7:46 ` Han-Wen Nienhuys
2022-08-19 8:55 ` [PATCH 6/6] reflog: assert PARSE_OPT_NONEG in parse-options callbacks Jeff King
2022-08-19 19:08 ` [PATCH 0/6] unused function parameter potpourri Derrick Stolee
2022-08-19 23:07 ` Elijah Newren
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CABPp-BHvscxV+vVL-Tew2H4h8V_3bZpD0Qz9uEMwrV=X3zrYSg@mail.gmail.com' \
--to=newren@gmail.com \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).