From: Junio C Hamano <gitster@pobox.com>
To: Edward Thomson <ethomson@edwardthomson.com>
Cc: git@vger.kernel.org, johannes.schindelin@gmx.de,
"Phillip Wood" <phillip.wood123@gmail.com>,
"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Subject: Re: [PATCH v2 1/1] xdiff: provide indirection to git functions
Date: Fri, 25 Feb 2022 11:03:25 -0800 [thread overview]
Message-ID: <xmqq4k4mdb0i.fsf@gitster.g> (raw)
In-Reply-To: <20220217225408.GB7@edef91d97c94> (Edward Thomson's message of "Thu, 17 Feb 2022 22:54:08 +0000")
Edward Thomson <ethomson@edwardthomson.com> writes:
> 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.
Continuing the "what do they exactly do" line of thought, the above
is not quite in line with what I heard. They take all the files
including git-xdiff.h and they must modify git-xdiff.h to match
their environment.
In any case, ...
> diff --git a/xdiff/git-xdiff.h b/xdiff/git-xdiff.h
> new file mode 100644
> index 0000000000..664a7c1351
> --- /dev/null
> +++ b/xdiff/git-xdiff.h
> @@ -0,0 +1,16 @@
> +#ifndef GIT_XDIFF_H
> +#define GIT_XDIFF_H
... here is a good place to spell the expectation out, i.e. that
they are expected to change this file to match their system, and
that all the things they see below here (including the inclusion of
git-compat-util.h) is specific to git-core they are expected to rip
out and replace.
> +
> +#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)
> +
> +#define xdl_regex_t regex_t
> +#define xdl_regmatch_t regmatch_t
> +#define xdl_regexec_buf(p, b, s, n, m, f) regexec_buf(p, b, s, n, m, f)
> +
> +#define XDL_BUG(msg) BUG(msg)
> +
> +#endif
Thanks.
prev parent reply other threads:[~2022-02-25 19:03 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
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 [this message]
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqq4k4mdb0i.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=avarab@gmail.com \
--cc=ethomson@edwardthomson.com \
--cc=git@vger.kernel.org \
--cc=johannes.schindelin@gmx.de \
--cc=phillip.wood123@gmail.com \
/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.
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 NNTP newsgroup(s).