git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
7dedceb4725ea13f24a67e67b4022beab3c272af blob 3779 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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
 
#!/bin/sh

test_description='ancestor culling and limiting by parent number'

. ./test-lib.sh

check_revlist () {
	rev_list_args="$1" &&
	shift &&
	git rev-parse "$@" >expect &&
	git rev-list $rev_list_args --all >actual &&
	test_cmp expect actual
}

test_expect_success setup '

	touch file &&
	git add file &&

	test_commit one &&

	test_tick=$(($test_tick - 2400)) &&

	test_commit two &&
	test_commit three &&
	test_commit four &&

	git log --pretty=oneline --abbrev-commit
'

test_expect_success 'one is ancestor of others and should not be shown' '

	git rev-list one --not four >result &&
	test_must_be_empty result

'

test_expect_success 'setup roots, merges and octopuses' '

	git checkout --orphan newroot &&
	test_commit five &&
	git checkout -b sidebranch two &&
	test_commit six &&
	git checkout -b anotherbranch three &&
	test_commit seven &&
	git checkout -b yetanotherbranch four &&
	test_commit eight &&
	git checkout main &&
	test_tick &&
	git merge --allow-unrelated-histories -m normalmerge newroot &&
	git tag normalmerge &&
	test_tick &&
	git merge -m tripus sidebranch anotherbranch &&
	git tag tripus &&
	git checkout -b tetrabranch normalmerge &&
	test_tick &&
	git merge -m tetrapus sidebranch anotherbranch yetanotherbranch &&
	git tag tetrapus &&
	git checkout main
'

test_expect_success 'rev-list roots' '

	check_revlist "--max-parents=0" one five
'

test_expect_success 'rev-list no merges' '

	check_revlist "--max-parents=1" one eight seven six five four three two &&
	check_revlist "--no-merges" one eight seven six five four three two
'

test_expect_success 'rev-list no octopuses' '

	check_revlist "--max-parents=2" one normalmerge eight seven six five four three two
'

test_expect_success 'rev-list no roots' '

	check_revlist "--min-parents=1" tetrapus tripus normalmerge eight seven six four three two
'

test_expect_success 'rev-list merges' '

	check_revlist "--min-parents=2" tetrapus tripus normalmerge &&
	check_revlist "--merges" tetrapus tripus normalmerge
'

test_expect_success 'rev-list octopus' '

	check_revlist "--min-parents=3" tetrapus tripus
'

test_expect_success 'rev-list ordinary commits' '

	check_revlist "--min-parents=1 --max-parents=1" eight seven six four three two
'

test_expect_success 'rev-list --merges --no-merges yields empty set' '

	check_revlist "--min-parents=2 --no-merges" &&
	check_revlist "--merges --no-merges" &&
	check_revlist "--no-merges --merges"
'

test_expect_success 'rev-list override and infinities' '

	check_revlist "--min-parents=2 --max-parents=1 --max-parents=3" tripus normalmerge &&
	check_revlist "--min-parents=1 --min-parents=2 --max-parents=7" tetrapus tripus normalmerge &&
	check_revlist "--min-parents=2 --max-parents=8" tetrapus tripus normalmerge &&
	check_revlist "--min-parents=2 --max-parents=-1" tetrapus tripus normalmerge &&
	check_revlist "--min-parents=2 --no-max-parents" tetrapus tripus normalmerge &&
	check_revlist "--max-parents=0 --min-parents=1 --no-min-parents" one five
'

test_expect_success 'dodecapus' '

	roots= &&
	for i in 1 2 3 4 5 6 7 8 9 10 11
	do
		git checkout -b root$i five &&
		test_commit $i &&
		roots="$roots root$i" ||
		return
	done &&
	git checkout main &&
	test_tick &&
	git merge -m dodecapus $roots &&
	git tag dodecapus &&

	check_revlist "--min-parents=4" dodecapus tetrapus &&
	check_revlist "--min-parents=8" dodecapus &&
	check_revlist "--min-parents=12" dodecapus &&
	check_revlist "--min-parents=13" &&
	check_revlist "--min-parents=4 --max-parents=11" tetrapus
'

test_expect_success 'ancestors with the same commit time' '

	test_tick_keep=$test_tick &&
	for i in 1 2 3 4 5 6 7 8; do
		test_tick=$test_tick_keep
		test_commit t$i
	done &&
	git rev-list t1^! --not t$i >result &&
	test_must_be_empty result
'

test_done
debug log:

solving 7dedceb472 ...
found 7dedceb472 in https://public-inbox.org/git/dc8011e4bfec33ebbb9953ee45c4c2efd40ddae7.1605221039.git.gitgitgadget@gmail.com/ ||
	https://public-inbox.org/git/27d7994933c4b3c1f3142ff0d72edd30f6556400.1605629548.git.gitgitgadget@gmail.com/
found 916d9692bc in git.git.git
preparing index
index prepared:
100755 916d9692bc05fdc87b28b7dbd4afdb173dd1d244	t/t6009-rev-list-parent.sh

applying [1/2] https://public-inbox.org/git/dc8011e4bfec33ebbb9953ee45c4c2efd40ddae7.1605221039.git.gitgitgadget@gmail.com/
diff --git a/t/t6009-rev-list-parent.sh b/t/t6009-rev-list-parent.sh
index 916d9692bc..7dedceb472 100755

Checking patch t/t6009-rev-list-parent.sh...
Applied patch t/t6009-rev-list-parent.sh cleanly.

skipping https://public-inbox.org/git/27d7994933c4b3c1f3142ff0d72edd30f6556400.1605629548.git.gitgitgadget@gmail.com/ for 7dedceb472
index at:
100755 7dedceb4725ea13f24a67e67b4022beab3c272af	t/t6009-rev-list-parent.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 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