From: Eric Sunshine Date: Sun, 22 Jul 2018 10:31:56 GMT Subject: Re: [PATCH 02/14] format-patch: add --interdiff option to embed diff in cover letter Message-ID: In-Reply-To: <20180722095717.17912-3-sunshine@sunshineco.com> On Sun, Jul 22, 2018 at 5:57 AM Eric Sunshine wrote: > Add an --interdiff option to automate this process. The argument to > --interdiff specifies the tip of the previous attempt against which to > generate the interdiff. > > Signed-off-by: Eric Sunshine > --- > diff --git a/interdiff.c b/interdiff.c > @@ -0,0 +1,17 @@ > +void show_interdiff(struct rev_info *rev) > +{ > + struct diff_options opts; > + > + memcpy(&opts, &rev->diffopt, sizeof(opts)); > + opts.output_format = DIFF_FORMAT_PATCH; > + diff_setup_done(&opts); > + > + diff_tree_oid(rev->idiff_oid1, rev->idiff_oid2, "", &opts); Passing a 'rev_info' to this function is overkill. It actually only needs the two OID's and a 'diff_options'. I'll make the change if I need to reroll for some other reason, otherwise I'll do it as a follow-up patch.