Re: [PATCH 02/14] format-patch: add --interdiff option to embed diff in cover letter
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Jul 23, 2018, 16:02 UTC
- Message-ID
- <CACsJy8C8RK6HkfoEYJGZg=sgtJS0WksHD3=7Souw3jYebRo=Sg@mail.gmail.com>
- In-Reply-To
- <20180722095717.17912-3-sunshine@sunshineco.com>
On Sun, Jul 22, 2018 at 11:57 AM Eric Sunshine <sunshine@sunshineco.com> wrote:
Show 23 quoted lines
> diff --git a/interdiff.c b/interdiff.c
> new file mode 100644
> index 0000000000..d0fac10c7c
> --- /dev/null
> +++ b/interdiff.c
> @@ -0,0 +1,17 @@
> +#include "cache.h"
> +#include "commit.h"
> +#include "revision.h"
> +#include "interdiff.h"
> +
> +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);
> + diffcore_std(&opts);
> + diff_flush(&opts);
> +}Is it worth adding a new file just for a single function? I haven't read the rest of the series, but the cover letter's diffstat suggests this is it. Is interdiff intended to become a lot more complicated in the future? If not maybe just add this function in diff-lib.c
-- Duy