{"thread":{"id":"40978","subject":"[PATCH] refs: mark some symbols static","startedAt":"2015-12-12T14:33:19Z","lastAt":"2015-12-14T18:55:36Z","messageCount":2,"participants":["Ramsay Jones","David Turner"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"274316","messageId":"566C302F.8090103@ramsayjones.plus.com","threadId":"40978","inReplyTo":null,"subject":"[PATCH] refs: mark some symbols static","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsayjones.plus.com","sentAt":"2015-12-12T14:33:19Z","receivedAt":"2015-12-12T14:33:19Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\nSigned-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>\n---\n\nHi David,\n\nIf you need to re-roll your 'dt/refs-backend-lmdb' branch, could\nyou please squash the relevant parts of this patch into yours.\n\n[yes, I didn't reference the movement of the external declaration\nin the commit message! :-D ]\n\nThanks!\n\nATB,\nRamsay Jones\n\n refs.c               | 7 +++----\n refs/files-backend.c | 2 +-\n refs/refs-internal.h | 2 ++\n 3 files changed, 6 insertions(+), 5 deletions(-)\n\ndiff --git a/refs.c b/refs.c\nindex 0be7065..c0faa97 100644\n--- a/refs.c\n+++ b/refs.c\n@@ -9,7 +9,7 @@\n #include \"object.h\"\n #include \"tag.h\"\n \n-const char split_transaction_fail_warning[] =\n+static const char split_transaction_fail_warning[] =\n \t\"A ref transaction was split across two refs backends.  Part of the \"\n \t\"transaction succeeded, but then the update to the per-worktree refs \"\n \t\"failed.  Your repository may be in an inconsistent state.\";\n@@ -17,12 +17,11 @@ const char split_transaction_fail_warning[] =\n /*\n  * We always have a files backend and it is the default.\n  */\n-extern struct ref_be refs_be_files;\n-struct ref_be *the_refs_backend = &refs_be_files;\n+static struct ref_be *the_refs_backend = &refs_be_files;\n /*\n  * List of all available backends\n  */\n-struct ref_be *refs_backends = &refs_be_files;\n+static struct ref_be *refs_backends = &refs_be_files;\n \n const char *refs_backend_type;\n \ndiff --git a/refs/files-backend.c b/refs/files-backend.c\nindex 0efc507..e8181ae 100644\n--- a/refs/files-backend.c\n+++ b/refs/files-backend.c\n@@ -3280,7 +3280,7 @@ static int ref_present(const char *refname,\n \treturn string_list_has_string(affected_refnames, refname);\n }\n \n-void files_init_backend(void *data)\n+static void files_init_backend(void *data)\n {\n \t/* do nothing */\n }\ndiff --git a/refs/refs-internal.h b/refs/refs-internal.h\nindex 9c17fdf..8fb360d 100644\n--- a/refs/refs-internal.h\n+++ b/refs/refs-internal.h\n@@ -313,4 +313,6 @@ struct ref_be {\n \tfor_each_replace_ref_fn *for_each_replace_ref;\n };\n \n+extern struct ref_be refs_be_files;\n+\n #endif /* REFS_REFS_INTERNAL_H */\n-- \n2.6.0\n"},{"id":"274392","messageId":"1450119336.1678.9.camel@twopensource.com","threadId":"40978","inReplyTo":"566C302F.8090103@ramsayjones.plus.com","subject":"Re: [PATCH] refs: mark some symbols static","fromName":"David Turner","fromEmail":"dturner@twopensource.com","sentAt":"2015-12-14T18:55:36Z","receivedAt":"2015-12-14T18:55:36Z","isPatch":true,"sender":{"key":"novalis@novalis.org","avatar":"https://avatars.githubusercontent.com/u/77003?v=4"},"body":"Will do.\n\n\nOn Sat, 2015-12-12 at 14:33 +0000, Ramsay Jones wrote:\n> Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>\n> ---\n> \n> Hi David,\n> \n> If you need to re-roll your 'dt/refs-backend-lmdb' branch, could\n> you please squash the relevant parts of this patch into yours.\n> \n> [yes, I didn't reference the movement of the external declaration\n> in the commit message! :-D ]\n> \n> Thanks!\n> \n> ATB,\n> Ramsay Jones\n> \n>  refs.c               | 7 +++----\n>  refs/files-backend.c | 2 +-\n>  refs/refs-internal.h | 2 ++\n>  3 files changed, 6 insertions(+), 5 deletions(-)\n> \n> diff --git a/refs.c b/refs.c\n> index 0be7065..c0faa97 100644\n> --- a/refs.c\n> +++ b/refs.c\n> @@ -9,7 +9,7 @@\n>  #include \"object.h\"\n>  #include \"tag.h\"\n>  \n> -const char split_transaction_fail_warning[] =\n> +static const char split_transaction_fail_warning[] =\n>  \t\"A ref transaction was split across two refs backends.  Part of the \"\n>  \t\"transaction succeeded, but then the update to the per-worktree refs \"\n>  \t\"failed.  Your repository may be in an inconsistent state.\";\n> @@ -17,12 +17,11 @@ const char split_transaction_fail_warning[] =\n>  /*\n>   * We always have a files backend and it is the default.\n>   */\n> -extern struct ref_be refs_be_files;\n> -struct ref_be *the_refs_backend = &refs_be_files;\n> +static struct ref_be *the_refs_backend = &refs_be_files;\n>  /*\n>   * List of all available backends\n>   */\n> -struct ref_be *refs_backends = &refs_be_files;\n> +static struct ref_be *refs_backends = &refs_be_files;\n>  \n>  const char *refs_backend_type;\n>  \n> diff --git a/refs/files-backend.c b/refs/files-backend.c\n> index 0efc507..e8181ae 100644\n> --- a/refs/files-backend.c\n> +++ b/refs/files-backend.c\n> @@ -3280,7 +3280,7 @@ static int ref_present(const char *refname,\n>  \treturn string_list_has_string(affected_refnames, refname);\n>  }\n>  \n> -void files_init_backend(void *data)\n> +static void files_init_backend(void *data)\n>  {\n>  \t/* do nothing */\n>  }\n> diff --git a/refs/refs-internal.h b/refs/refs-internal.h\n> index 9c17fdf..8fb360d 100644\n> --- a/refs/refs-internal.h\n> +++ b/refs/refs-internal.h\n> @@ -313,4 +313,6 @@ struct ref_be {\n>  \tfor_each_replace_ref_fn *for_each_replace_ref;\n>  };\n>  \n> +extern struct ref_be refs_be_files;\n> +\n>  #endif /* REFS_REFS_INTERNAL_H */\n"}]}