Subject: Re: What's cooking in git.git (Apr 2020, #02; Mon, 20)

From: Danh Doan <[email-masked]>
Date: Thu, 23 Apr 2020 20:39:37 +0700

On 2020-04-20 18:57:14-0700, Junio C Hamano <[email-masked]> wrote:
> * ds/blame-on-bloom (2020-04-16) 3 commits
>  - blame: use changed-path Bloom filters
>  - tests: write commit-graph with Bloom filters
>  - revision: complicated pathspecs disable filters
>  (this branch uses gs/commit-graph-path-filter.)
> 
>  "git blame" learns to take advantage of the "changed-paths" Bloom
>  filter stored in the commit-graph file.
> 
>  Will merge to 'next'.

Please apply this patch on top of ds/blame-on-bloom
to fix `make sparse`.

POSIX and (IIRC, C) requires final newline.

Feel free to fix up to current series
------------------8<-----------------------
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <[email-masked]>
Date: Thu, 23 Apr 2020 20:24:50 +0700
Subject: [PATCH] bloom: fix `make sparse` warning
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* We need a `final_new_line` to make our source code as text file, per
  POSIX and C specification.
* `bloom_filters` should be limited to interal linkage only

Feel free to fix up to current series

Signed-off-by: Đoàn Trần Công Danh <[email-masked]>
---
 bloom.c               | 4 ++--
 bloom.h               | 2 +-
 t/helper/test-bloom.c | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/bloom.c b/bloom.c
index dd9bab9bbd..ee025e0c61 100644
--- a/bloom.c
+++ b/bloom.c
@@ -9,7 +9,7 @@
 
 define_commit_slab(bloom_filter_slab, struct bloom_filter);
 
-struct bloom_filter_slab bloom_filters;
+static struct bloom_filter_slab bloom_filters;
 
 struct pathmap_hash_entry {
     struct hashmap_entry entry;
@@ -273,4 +273,4 @@ int bloom_filter_contains(const struct bloom_filter *filter,
 	}
 
 	return 1;
-}
\ No newline at end of file
+}
diff --git a/bloom.h b/bloom.h
index b935186425..e0e59e0754 100644
--- a/bloom.h
+++ b/bloom.h
@@ -87,4 +87,4 @@ int bloom_filter_contains(const struct bloom_filter *filter,
 			  const struct bloom_key *key,
 			  const struct bloom_filter_settings *settings);
 
-#endif
\ No newline at end of file
+#endif
diff --git a/t/helper/test-bloom.c b/t/helper/test-bloom.c
index ce412664ba..ce5a0af5ae 100644
--- a/t/helper/test-bloom.c
+++ b/t/helper/test-bloom.c
@@ -3,7 +3,7 @@
 #include "test-tool.h"
 #include "commit.h"
 
-struct bloom_filter_settings settings = DEFAULT_BLOOM_FILTER_SETTINGS;
+static struct bloom_filter_settings settings = DEFAULT_BLOOM_FILTER_SETTINGS;
 
 static void add_string_to_filter(const char *data, struct bloom_filter *filter) {
 		struct bloom_key key;
@@ -78,4 +78,4 @@ int cmd__bloom(int argc, const char **argv)
 	}
 
 	return 0;
-}
\ No newline at end of file
+}
-- 
2.26.2.384.g435bf60bd5
Danh