diff options
| author | David Bremner <david@tethera.net> | 2026-01-25 07:56:38 +0900 |
|---|---|---|
| committer | David Bremner <david@tethera.net> | 2026-02-16 07:24:18 +0900 |
| commit | c4c0843d8fed39d4d7da6be493248f75d0c0d706 (patch) | |
| tree | fccc1200f62566d47a358369be153fffc570545d /performance-test | |
| parent | cfc4af0e2bdf8f82ad14342baa6578d4dd366cd9 (diff) | |
cli/git-remote: add export command
Two (sub)features are stubbed out in this initial implementation:
deleting messages (as opposed to tags), and missing messages. There
are two corresponding tests marked as broken in T860-git-remote.sh.
A third test passes with the stub, which is maybe not ideal, but at
least it acts as a regression test.
Diffstat (limited to 'performance-test')
| -rwxr-xr-x | performance-test/M07-git-remote.sh | 4 | ||||
| -rwxr-xr-x | performance-test/T08-git-remote.sh | 41 |
2 files changed, 45 insertions, 0 deletions
diff --git a/performance-test/M07-git-remote.sh b/performance-test/M07-git-remote.sh index 57b9ab32..24b43f67 100755 --- a/performance-test/M07-git-remote.sh +++ b/performance-test/M07-git-remote.sh @@ -6,6 +6,7 @@ test_description='git remote helper' mkdir repo export GIT_DIR=`pwd`/repo +MAKE_EXPORT_PY=$NOTMUCH_SRCDIR/test/make-export.py memory_start @@ -13,4 +14,7 @@ echo "import refs/heads/master" > import.in memory_run "import" "git-remote-notmuch origin notmuch:// >import.out <import.in" +python3 $MAKE_EXPORT_PY > export.in +memory_run "export" "git-remote-notmuch origin notmuch:// >export.out <export.in" + memory_done diff --git a/performance-test/T08-git-remote.sh b/performance-test/T08-git-remote.sh index df03d978..00ee1702 100755 --- a/performance-test/T08-git-remote.sh +++ b/performance-test/T08-git-remote.sh @@ -4,9 +4,50 @@ 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 |
