From: David Turner <dturner@twopensource•com>
To: Ramsay Jones <ramsay@ramsayjones•plus.com>
Cc: Junio C Hamano <gitster@pobox•com>,
GIT Mailing-list <git@vger•kernel.org>
Subject: Re: [RFC PATCH] lmdb: restrict the visibility of some symbols
Date: Mon, 22 Feb 2016 15:56:48 -0500 [thread overview]
Message-ID: <1456174608.7528.99.camel@twopensource.com> (raw)
In-Reply-To: <56CB3A48.2070904@ramsayjones.plus.com>
Instead of directly applying this patch, I rearranged the code a bit,
but hopefully now have reduced the non-static surface area. Thanks for
the suggestions.
On Mon, 2016-02-22 at 16:41 +0000, Ramsay Jones wrote:
> Signed-off-by: Ramsay Jones <ramsay@ramsayjones•plus.com>
> ---
>
> Hi David,
>
> If you need to re-roll your 'dt/refs-backend-lmdb' branch, please
> consider squashing something like this into the relevant patches.
> Note that I marked this as RFC, because I haven't got lmdb
> installed, so I can't actually test it! ;-)
>
> So, I've just eyeballed it and, hopefully, it will actually work.
>
> Let me know.
>
> Thanks!
>
> ATB,
> Ramsay Jones
>
> refs.c | 2 +-
> refs.h | 5 -----
> refs/refs-internal.h | 3 +++
> test-refs-lmdb-backend.c | 5 +++--
> 4 files changed, 7 insertions(+), 8 deletions(-)
>
> diff --git a/refs.c b/refs.c
> index 56960b5..337f110 100644
> --- a/refs.c
> +++ b/refs.c
> @@ -22,7 +22,7 @@ static struct ref_storage_be *refs_backends = NULL;
>
> const char *ref_storage_backend = "files";
>
> -void register_ref_storage_backend(struct ref_storage_be *be)
> +static void register_ref_storage_backend(struct ref_storage_be *be)
> {
> be->next = refs_backends;
> refs_backends = be;
> diff --git a/refs.h b/refs.h
> index ad6d097..9cc3a37 100644
> --- a/refs.h
> +++ b/refs.h
> @@ -515,9 +515,6 @@ extern int reflog_expire(const char *refname,
> const unsigned char *sha1,
> */
> int ref_storage_backend_config(const char *var, const char *value,
> void *ptr);
>
> -struct ref_storage_be;
> -
> -extern struct ref_storage_be refs_be_lmdb;
> /*
> * Switch to an alternate ref storage backend.
> */
> @@ -525,8 +522,6 @@ int set_ref_storage_backend(const char *name);
>
> int ref_storage_backend_exists(const char *name);
>
> -void register_ref_storage_backend(struct ref_storage_be *be);
> -
> void register_ref_storage_backends(void);
>
> #endif /* REFS_H */
> diff --git a/refs/refs-internal.h b/refs/refs-internal.h
> index 0337d2e..ced6af4 100644
> --- a/refs/refs-internal.h
> +++ b/refs/refs-internal.h
> @@ -308,5 +308,8 @@ struct ref_storage_be {
> };
>
> extern struct ref_storage_be refs_be_files;
> +#ifdef USE_LIBLMDB
> +extern struct ref_storage_be refs_be_lmdb;
> +#endif
>
> #endif /* REFS_REFS_INTERNAL_H */
> diff --git a/test-refs-lmdb-backend.c b/test-refs-lmdb-backend.c
> index 5cf61e6..9703e5a 100644
> --- a/test-refs-lmdb-backend.c
> +++ b/test-refs-lmdb-backend.c
> @@ -43,8 +43,9 @@ int main(int argc, const char **argv)
>
> git_config(git_default_config, NULL);
>
> - register_ref_storage_backend(&refs_be_lmdb);
> - set_ref_storage_backend("lmdb");
> + register_ref_storage_backends();
> + if (!set_ref_storage_backend("lmdb"))
> + die("could not set lmdb reference backend");
>
> if (clear_reflog) {
> test_refdb_raw_delete_reflog(argv[0]);
prev parent reply other threads:[~2016-02-22 20:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-22 16:41 [RFC PATCH] lmdb: restrict the visibility of some symbols Ramsay Jones
2016-02-22 20:56 ` David Turner [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=1456174608.7528.99.camel@twopensource.com \
--to=dturner@twopensource$(echo .)com \
--cc=git@vger$(echo .)kernel.org \
--cc=gitster@pobox$(echo .)com \
--cc=ramsay@ramsayjones$(echo .)plus.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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