Re: [PATCH 02/14] format-patch: add --interdiff option to embed diff in cover letter
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Jul 22, 2018, 10:31 UTC
- Message-ID
- <CAPig+cSuYUYSPTuKx08wcmQM-G12_-W2T4BS07fA=6grM1b8Gw@mail.gmail.com>
- In-Reply-To
- <20180722095717.17912-3-sunshine@sunshineco.com>
On Sun, Jul 22, 2018 at 5:57 AM Eric Sunshine <sunshine@sunshineco.com> wrote:
Show 17 quoted lines
> 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 <sunshine@sunshineco.com>
> ---
> 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.