git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: phillip.wood@dunelm.org.uk
Cc: "Edward Thomson" <ethomson@edwardthomson.com>,
	git@vger.kernel.org, "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
	gitster@pobox.com
Subject: Re: [PATCH v2 1/1] xdiff: provide indirection to git functions
Date: Fri, 25 Feb 2022 16:41:57 +0100 (CET)	[thread overview]
Message-ID: <nycvar.QRO.7.76.6.2202251639590.11118@tvgsbejvaqbjf.bet> (raw)
In-Reply-To: <e73c6746-9f8d-7e23-3764-18d01307278b@gmail.com>

Hi,

On Tue, 22 Feb 2022, Phillip Wood wrote:

> On 17/02/2022 22:54, Edward Thomson wrote:
> > Provide an indirection layer into the git-specific functionality and
> > utilities in `git-xdiff.h`, prefixing those types and functions with
> > `xdl_` (and `XDL_` for macros).  This allows other projects that use
> > git's xdiff implementation to keep up-to-date; they can now take all the
> > files _except_ `git-xdiff.h`, which they have customized for their own
> > environment.
>
> The changes since V1 look good,

Indeed. This is the range-diff:

-- snip --
1:  52c8f141cbe1 ! 1:  e05e9b5e2f27 xdiff: provide indirection to git functions
    @@ xdiff/git-xdiff.h (new)
     +#ifndef GIT_XDIFF_H
     +#define GIT_XDIFF_H
     +
    ++#include "git-compat-util.h"
    ++
     +#define xdl_malloc(x) xmalloc(x)
     +#define xdl_free(ptr) free(ptr)
     +#define xdl_realloc(ptr,x) xrealloc(ptr,x)
    @@ xdiff/xdiffi.c: static void xdl_mark_ignorable_lines(xdchange_t *xscr, xdfenv_t

      ## xdiff/xinclude.h ##
     @@
    + #if !defined(XINCLUDE_H)
      #define XINCLUDE_H

    - #include "git-compat-util.h"
    +-#include "git-compat-util.h"
     +#include "git-xdiff.h"
      #include "xmacros.h"
      #include "xdiff.h"
      #include "xtypes.h"
    -@@
    - #include "xdiffi.h"
    - #include "xemit.h"
    +
    + ## xdiff/xmerge.c ##
    +@@ xdiff/xmerge.c: static int xdl_cleanup_merge(xdmerge_t *c)
    + 		if (c->mode == 0)
    + 			count++;
    + 		next_c = c->next;
    +-		free(c);
    ++		xdl_free(c);
    + 	}
    + 	return count;
    + }
    +@@ xdiff/xmerge.c: static void xdl_merge_two_conflicts(xdmerge_t *m)
    + 	m->chg1 = next_m->i1 + next_m->chg1 - m->i1;
    + 	m->chg2 = next_m->i2 + next_m->chg2 - m->i2;
    + 	m->next = next_m->next;
    +-	free(next_m);
    ++	xdl_free(next_m);
    + }

    --
    - #endif /* #if !defined(XINCLUDE_H) */
    + /*
-- snap --

My ACK from
https://lore.kernel.org/git/nycvar.QRO.7.76.6.2202171644090.348@tvgsbejvaqbjf.bet/
still holds. Junio could you please add it before merging it down to
`next`?

Thanks,
Dscho

  reply	other threads:[~2022-02-25 15:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-17 22:52 [PATCH v2 0/1] xdiff: provide indirection to git functions Edward Thomson
2022-02-17 22:54 ` [PATCH v2 1/1] " Edward Thomson
2022-02-22 11:14   ` Phillip Wood
2022-02-25 15:41     ` Johannes Schindelin [this message]
2022-02-25 18:24       ` Junio C Hamano
2022-02-25 18:38         ` Edward Thomson
2022-02-25 18:58           ` Junio C Hamano
2022-02-25 19:03   ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=nycvar.QRO.7.76.6.2202251639590.11118@tvgsbejvaqbjf.bet \
    --to=johannes.schindelin@gmx.de \
    --cc=avarab@gmail.com \
    --cc=ethomson@edwardthomson.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=phillip.wood@dunelm.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).