git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / Atom feed
424fe4fc29be40ff0a6edd9baa1ffebaf4ce4518 blob 2960 bytes (raw)

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
 
#!/bin/sh

test_description='test bloom.c'
. ./test-lib.sh

test_expect_success 'get bloom filters for commit with no changes' '
	git init &&
	git commit --allow-empty -m "c0" &&
	cat >expect <<-\EOF &&
	Filter_Length:0
	Filter_Data:
	EOF
	test-tool bloom get_filter_for_commit "$(git rev-parse HEAD)" >actual &&
	test_cmp expect actual
'

test_expect_success 'get bloom filter for commit with 10 changes' '
	rm actual &&
	rm expect &&
	mkdir smallDir &&
	for i in $(test_seq 0 9)
	do
		echo $i >smallDir/$i
	done &&
	git add smallDir &&
	git commit -m "commit with 10 changes" &&
	cat >expect <<-\EOF &&
	Filter_Length:4
	Filter_Data:508928809087080a|8a7648210804001|4089824400951000|841ab310098051a8|
	EOF
	test-tool bloom get_filter_for_commit "$(git rev-parse HEAD)" >actual &&
	test_cmp expect actual
'

test_expect_success EXPENSIVE 'get bloom filter for commit with 513 changes' '
	rm actual &&
	rm expect &&
	mkdir bigDir &&
	for i in $(test_seq 0 512)
	do
		echo $i >bigDir/$i
	done &&
	git add bigDir &&
	git commit -m "commit with 513 changes" &&
	cat >expect <<-\EOF &&
	Filter_Length:0
	Filter_Data:
	EOF
	test-tool bloom get_filter_for_commit "$(git rev-parse HEAD)" >actual &&
	test_cmp expect actual
'

test_expect_success 'compute bloom key for empty string' '
	cat >expect <<-\EOF &&
	Hashes:5615800c|5b966560|61174ab4|66983008|6c19155c|7199fab0|771ae004|
	Filter_Length:1
	Filter_Data:11000110001110|
	EOF
	test-tool bloom generate_filter "" >actual &&
	test_cmp expect actual
'

test_expect_success 'compute bloom key for whitespace' '
	cat >expect <<-\EOF &&
	Hashes:1bf014e6|8a91b50b|f9335530|67d4f555|d676957a|4518359f|b3b9d5c4|
	Filter_Length:1
	Filter_Data:401004080200810|
	EOF
	test-tool bloom generate_filter " " >actual &&
	test_cmp expect actual
'

test_expect_success 'compute bloom key for a root level folder' '
	cat >expect <<-\EOF &&
	Hashes:1a21016f|fff1c06d|e5c27f6b|cb933e69|b163fd67|9734bc65|7d057b63|
	Filter_Length:1
	Filter_Data:aaa800000000|
	EOF
	test-tool bloom generate_filter "A" >actual &&
	test_cmp expect actual
'

test_expect_success 'compute bloom key for a root level file' '
	cat >expect <<-\EOF &&
	Hashes:e2d51107|30970605|7e58fb03|cc1af001|19dce4ff|679ed9fd|b560cefb|
	Filter_Length:1
	Filter_Data:a8000000000000aa|
	EOF
	test-tool bloom generate_filter "file.txt" >actual &&
	test_cmp expect actual
'

test_expect_success 'compute bloom key for a deep folder' '
	cat >expect <<-\EOF &&
	Hashes:864cf838|27f055cd|c993b362|6b3710f7|0cda6e8c|ae7dcc21|502129b6|
	Filter_Length:1
	Filter_Data:1c0000600003000|
	EOF
	test-tool bloom generate_filter "A/B/C/D/E" >actual &&
	test_cmp expect actual
'

test_expect_success 'compute bloom key for a deep file' '
	cat >expect <<-\EOF &&
	Hashes:07cdf850|4af629c7|8e1e5b3e|d1468cb5|146ebe2c|5796efa3|9abf211a|
	Filter_Length:1
	Filter_Data:4020100804010080|
	EOF
	test-tool bloom generate_filter "A/B/C/D/E/file.txt" >actual &&
	test_cmp expect actual
'

test_done
debug log:

solving 424fe4fc29 ...
found 424fe4fc29 in https://public-inbox.org/git/02b16d94227470059dcee2781e29ae7ae010f602.1580943390.git.gitgitgadget@gmail.com/

applying [1/1] https://public-inbox.org/git/02b16d94227470059dcee2781e29ae7ae010f602.1580943390.git.gitgitgadget@gmail.com/
diff --git a/t/t0095-bloom.sh b/t/t0095-bloom.sh
new file mode 100755
index 0000000000..424fe4fc29

Checking patch t/t0095-bloom.sh...
Applied patch t/t0095-bloom.sh cleanly.

index at:
100755 424fe4fc29be40ff0a6edd9baa1ffebaf4ce4518	t/t0095-bloom.sh

git@vger.kernel.org list mirror (unofficial, one of many)

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://public-inbox.org/git
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 git git/ https://public-inbox.org/git \
		git@vger.kernel.org
	public-inbox-index git

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.version-control.git
	nntp://ou63pmih66umazou.onion/inbox.comp.version-control.git
	nntp://czquwvybam4bgbro.onion/inbox.comp.version-control.git
	nntp://hjrcffqmbrq6wope.onion/inbox.comp.version-control.git
	nntp://news.gmane.io/gmane.comp.version-control.git
 note: .onion URLs require Tor: https://www.torproject.org/

code repositories for the project(s) associated with this inbox:

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

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git