From 1a4b332f01d2c924b0457b94919a83f2b66effdb Mon Sep 17 00:00:00 2001 From: Brian Harring Date: Tue, 23 Oct 2012 15:40:37 -0700 Subject: enforce an ordering in commits w/ the same timestamp --- rewrite-commit-dump.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rewrite-commit-dump.py b/rewrite-commit-dump.py index 148a9a3..ca8a9ae 100755 --- a/rewrite-commit-dump.py +++ b/rewrite-commit-dump.py @@ -196,7 +196,7 @@ def serialize_records(records, handle, target='refs/heads/master', progress=100) total = len(records) total_len = len(str(total)) progress_interval = max(1, total // progress) - for idx, record in enumerate(records, 1): + for idx, record in enumerate(sorted(records, key=lambda x:(x.timestamp,sorted(x.files),x.author,x.footerless_msg)), 1): if idx % progress_interval == 0: write('progress %s%%: %s of %i commits\n' % (str(int(100 * (float(idx)/total))).rjust(2), str(idx).rjust(total_len), total)) -- cgit v1.2.3-65-gdbad