git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / Atom feed
26c800e60be2a230a96008c2592f2838e8385820 blob 1496 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
 
#!/bin/sh
#
# Copyright (c) 2006 Josh England
#

test_description='Test the post-merge hook.'
. ./test-lib.sh

test_expect_success setup '
	echo Data for commit0. >a &&
	git update-index --add a &&
	tree0=$(git write-tree) &&
	commit0=$(echo setup | git commit-tree $tree0) &&
	echo Changed data for commit1. >a &&
	git update-index a &&
	tree1=$(git write-tree) &&
	commit1=$(echo modify | git commit-tree $tree1 -p $commit0) &&
	git update-ref refs/heads/main $commit0 &&
	git clone ./. clone1 &&
	GIT_DIR=clone1/.git git update-index --add a &&
	git clone ./. clone2 &&
	GIT_DIR=clone2/.git git update-index --add a
'

for clone in 1 2; do
	cat >clone${clone}/.git/hooks/post-merge <<'EOF'
#!/bin/sh
echo $@ >> $GIT_DIR/post-merge.args
EOF
	chmod u+x clone${clone}/.git/hooks/post-merge
done

test_expect_success 'post-merge does not run for up-to-date ' '
	GIT_DIR=clone1/.git git merge $commit0 &&
	! test -f clone1/.git/post-merge.args
'

test_expect_success 'post-merge runs as expected ' '
	GIT_DIR=clone1/.git git merge $commit1 &&
	test -e clone1/.git/post-merge.args
'

test_expect_success 'post-merge from normal merge receives the right argument ' '
	grep 0 clone1/.git/post-merge.args
'

test_expect_success 'post-merge from squash merge runs as expected ' '
	GIT_DIR=clone2/.git git merge --squash $commit1 &&
	test -e clone2/.git/post-merge.args
'

test_expect_success 'post-merge from squash merge receives the right argument ' '
	grep 1 clone2/.git/post-merge.args
'

test_done
debug log:

solving 26c800e60b ...
found 26c800e60b in https://public-inbox.org/git/55b6c04fc0ed3bbdf7e94b955d94227260fe1330.1605221039.git.gitgitgadget@gmail.com/ ||
	https://public-inbox.org/git/be29e0789259b6b4ac51bdd7432fce5cf7204bbd.1605629548.git.gitgitgadget@gmail.com/
found 4aeea8f5b7 in https://80x24.org/mirrors/git.git
preparing index
index prepared:
100755 4aeea8f5b7ef0644c5944f13dd37544c6f9c00cc	t/t5402-post-merge-hook.sh

applying [1/2] https://public-inbox.org/git/55b6c04fc0ed3bbdf7e94b955d94227260fe1330.1605221039.git.gitgitgadget@gmail.com/
diff --git a/t/t5402-post-merge-hook.sh b/t/t5402-post-merge-hook.sh
index 4aeea8f5b7..26c800e60b 100755

Checking patch t/t5402-post-merge-hook.sh...
Applied patch t/t5402-post-merge-hook.sh cleanly.

skipping https://public-inbox.org/git/be29e0789259b6b4ac51bdd7432fce5cf7204bbd.1605629548.git.gitgitgadget@gmail.com/ for 26c800e60b
index at:
100755 26c800e60be2a230a96008c2592f2838e8385820	t/t5402-post-merge-hook.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