unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
blob 00ee1702b663ac5a9c22d2ed8fe515f5af64da5a 1438 bytes (raw)
name: performance-test/T08-git-remote.sh 	 # note: path name is non-authoritative(*)

 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
 
#!/usr/bin/env bash

test_description='git-remote-notmuch'

. $(dirname "$0")/perf-test-lib.sh || exit 1

add_tags() {
    local dir=$1
    local denom=$2
    local olddir=$(pwd)

    cd $dir
    find . -name tags -type f |
	while read -r path; do
	      if [ $(($RANDOM % $denom)) -eq 0 ]; then
		  echo $RANDOM >> $path
	      fi
	done

    cd $olddir
}

time_start

time_run 'clone --bare' "git clone --quiet --bare -b master notmuch::default default.git"
time_run 'clone' "git clone --quiet -b master notmuch:// repo"

time_run "push (no changes)" "git -C repo push --quiet origin master"

add_tags repo 10
git -C repo add -u
git -C repo commit --quiet -m'add tags to 10% of messages'
time_run "push (10% changed)" "git -C repo push --quiet origin master"

add_tags repo 4
git -C repo add -u
git -C repo commit --quiet -m'add tags to 25% of messages'
time_run "push (25% changed)" "git -C repo push --quiet origin master"

add_tags repo 2
git -C repo add -u
git -C repo commit --quiet -m'add tags to 50% of messages'
time_run "push (50% changed)" "git -C repo push --quiet origin master"

hash=$(git -C repo hash-object --stdin -w < /dev/null)
# replace all files with empty files
git -C repo ls-tree -r HEAD | sed "s/blob [^\t]*/blob $hash/" \
       | git -C repo update-index --index-info
git -C repo commit --quiet -m'zero tags' 2>>log.txt 1>&2

time_run "push (rem. all tags)" "git -C repo push --quiet origin master"

time_done

debug log:

solving 00ee1702 ...
found 00ee1702 in https://yhetil.org/notmuch/20240908113937.286108-5-david@tethera.net/
found df03d978 in https://yhetil.org/notmuch/20240908113937.286108-4-david@tethera.net/

applying [1/2] https://yhetil.org/notmuch/20240908113937.286108-4-david@tethera.net/
diff --git a/performance-test/T08-git-remote.sh b/performance-test/T08-git-remote.sh
new file mode 100755
index 00000000..df03d978


applying [2/2] https://yhetil.org/notmuch/20240908113937.286108-5-david@tethera.net/
diff --git a/performance-test/T08-git-remote.sh b/performance-test/T08-git-remote.sh
index df03d978..00ee1702 100755

Checking patch performance-test/T08-git-remote.sh...
Applied patch performance-test/T08-git-remote.sh cleanly.
Checking patch performance-test/T08-git-remote.sh...
Applied patch performance-test/T08-git-remote.sh cleanly.

index at:
100755 00ee1702b663ac5a9c22d2ed8fe515f5af64da5a	performance-test/T08-git-remote.sh

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).