Re: [PATCH 2/6] log-tree: drop unused commit param in remerge_diff()
- From
Jeff King <peff@peff.net>
- Date
- Aug 20, 2022, 07:04 UTC
- Message-ID
- <YwCHhUGZvcRP9OQ2@coredump.intra.peff.net>
- In-Reply-To
- <CABPp-BHvscxV+vVL-Tew2H4h8V_3bZpD0Qz9uEMwrV=X3zrYSg@mail.gmail.com>
On Fri, Aug 19, 2022 at 04:05:06PM -0700, Elijah Newren wrote:
Show 12 quoted lines
> > 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). > [...] > > 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.
That makes sense (the origin of these unused parameters are all mini-mysteries, so it's very satisfying to me to hear a plausible explanation).
I like using the broken-down parts as you ended up with. The sole caller does have a commit, but one doesn't _need_ to have a commit to do a remerge diff. You just need two tips and a proposed tree result. In theory we could have a plumbing command which takes those individually.
-Peff