diff options
| author | Junio C Hamano <gitster@pobox.com> | 2026-02-09 12:09:10 -0800 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2026-02-09 12:09:10 -0800 |
| commit | 6a3c66d72e8e74fb649d8b764e8295d94b8570a9 (patch) | |
| tree | ebc2c8f0d95950edefafc190194f595d43c82753 | |
| parent | 35e17b2526135163963465878861502e496becc2 (diff) | |
| parent | 8466efa4bd92b970f7a37159404aef33296d9d46 (diff) | |
| download | git-6a3c66d72e8e74fb649d8b764e8295d94b8570a9.tar.xz | |
Merge branch 'ty/perf-3400-optim'
Improve set-up time of a perf test.
* ty/perf-3400-optim:
t/perf/p3400: speed up setup using fast-import
| -rwxr-xr-x | t/perf/p3400-rebase.sh | 53 |
1 files changed, 38 insertions, 15 deletions
diff --git a/t/perf/p3400-rebase.sh b/t/perf/p3400-rebase.sh index e6b0277729..56dc3e1d31 100755 --- a/t/perf/p3400-rebase.sh +++ b/t/perf/p3400-rebase.sh @@ -9,21 +9,44 @@ test_expect_success 'setup rebasing on top of a lot of changes' ' git checkout -f -B base && git checkout -B to-rebase && git checkout -B upstream && - for i in $(test_seq 100) - do - # simulate huge diffs - echo change$i >unrelated-file$i && - test_seq 1000 >>unrelated-file$i && - git add unrelated-file$i && - test_tick && - git commit -m commit$i unrelated-file$i && - echo change$i >unrelated-file$i && - test_seq 1000 | sort -nr >>unrelated-file$i && - git add unrelated-file$i && - test_tick && - git commit -m commit$i-reverse unrelated-file$i || - return 1 - done && + test_seq 1000 >content_fwd && + sort -nr content_fwd >content_rev && + ( + for i in $(test_seq 100) + do + test_tick && + echo "commit refs/heads/upstream" && + echo "committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE" && + echo "data <<EOF" && + echo "commit$i" && + echo "EOF" && + + if test "$i" = 1; then + echo "from refs/heads/upstream^0" + fi && + + echo "M 100644 inline unrelated-file$i" && + echo "data <<EOF" && + echo "change$i" && + cat content_fwd && + echo "EOF" && + + echo "commit refs/heads/upstream" && + echo "committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE" && + echo "data <<EOF" && + echo "commit$i-reverse" && + echo "EOF" && + echo "M 100644 inline unrelated-file$i" && + echo "data <<EOF" && + echo "change$i" && + cat content_rev && + echo "EOF" || exit 1 + done + ) >fast_import_stream && + + git fast-import <fast_import_stream && + git repack -a -d && + git checkout -f upstream && git checkout to-rebase && test_commit our-patch interesting-file ' |
