Re: [PATCH 06/14] format-patch: allow --interdiff to apply to a lone-patch
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Jul 23, 2018, 16:22 UTC
- Message-ID
- <CACsJy8Aw6R8-3kDfhCqunXziajCg9O_1WrEYc4rfKa+-=m1D5g@mail.gmail.com>
- In-Reply-To
- <20180722095717.17912-7-sunshine@sunshineco.com>
On Sun, Jul 22, 2018 at 11:58 AM Eric Sunshine <sunshine@sunshineco.com> wrote:
Show 18 quoted lines
> diff --git a/log-tree.c b/log-tree.c
> index 9d38f1cf79..56513fa83d 100644
> --- a/log-tree.c
> +++ b/log-tree.c
> @@ -14,6 +14,7 @@
> #include "sequencer.h"
> #include "line-log.h"
> #include "help.h"
> +#include "interdiff.h"
>
> static struct decoration name_decoration = { "object names" };
> static int decoration_loaded;
> @@ -736,6 +737,19 @@ void show_log(struct rev_info *opt)
>
> strbuf_release(&msgbuf);
> free(ctx.notes_message);
> +
> + if (cmit_fmt_is_mail(ctx.fmt) && opt->idiff_oid1) {OK putting idiff stuff in rev_info is probably the right choice. But we all three fields prefixed with idiff_, maybe you could just add a new struct "idiff_options" to contain them and add a pointer to that struct in rev_info. Then "opt->idiff" is enough to know if idiff is requested instead of relying on idiff_oid1 (seems too random).
Show 12 quoted lines
> + struct diff_queue_struct dq; > + > + memcpy(&dq, &diff_queued_diff, sizeof(diff_queued_diff)); > + DIFF_QUEUE_CLEAR(&diff_queued_diff); > + > + next_commentary_block(opt, NULL); > + fprintf_ln(opt->diffopt.file, "%s", opt->idiff_title); > + show_interdiff(opt, 2); > + > + memcpy(&diff_queued_diff, &dq, sizeof(diff_queued_diff)); > + } > }
-- Duy