From 9374e5e18217982a13e354d2812d34a831ee3558 Mon Sep 17 00:00:00 2001 From: Ciro Santilli Date: Tue, 4 Sep 2018 10:14:40 +0100 Subject: [PATCH] many-commits-octopus --- other-test-repos/many-commits-octopus.py | 64 ++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100755 other-test-repos/many-commits-octopus.py diff --git a/other-test-repos/many-commits-octopus.py b/other-test-repos/many-commits-octopus.py new file mode 100755 index 00000000..ccdf9b0 --- /dev/null +++ b/other-test-repos/many-commits-octopus.py @@ -0,0 +1,64 @@ +#!/usr/bin/env python3 + +import datetime +import subprocess +import time +import sys + +import util + +email = b'a@a.com' +name = b'' + +util.init() + +tree = util.create_tree_with_one_file() +commit = None +if len(sys.argv) > 1: + n = int(sys.argv[1]) +else: + n = 1000 +base_commit, _, _ = util.save_commit_object( + tree, + (commit,), + author_date_s=0, + author_email=email, + author_name=name, + committer_date_s=0, + committer_email=email, + committer_name=name, + message=b'', +) +parents = [] +for i in range(n): + now = int(time.time()) + commit, _, _ = util.save_commit_object( + tree, + (base_commit,), + author_date_s=i, + author_email=email, + author_name=name, + committer_date_s=0, + committer_email=email, + committer_name=name, + message=b'', + ) + parents.append(commit) + if i % 100000 == 0: + print(i) + print(datetime.datetime.now()) + subprocess.check_output(['git', 'repack']) + subprocess.check_output(['git', 'prune-packed']) + subprocess.check_output(['git', 'tag', str(i), commit]) +final_commit, _, _ = util.save_commit_object( + tree, + parents, + author_date_s=0, + author_email=email, + author_name=name, + committer_date_s=0, + committer_email=email, + committer_name=name, + message=b'', +) +util.create_master(final_commit)