Diff
Modified: trunk/Websites/perf.webkit.org/ChangeLog (247769 => 247770)
--- trunk/Websites/perf.webkit.org/ChangeLog 2019-07-24 17:10:19 UTC (rev 247769)
+++ trunk/Websites/perf.webkit.org/ChangeLog 2019-07-24 17:10:28 UTC (rev 247770)
@@ -1,3 +1,19 @@
+2019-07-23 Dewei Zhu <[email protected]>
+
+ Use 12 digits to show a git commit.
+ https://bugs.webkit.org/show_bug.cgi?id=200067
+
+ Reviewed by Ryosuke Niwa.
+
+ Use 12 digits to show a git commit to reasonably descrease commit prefix collision probability
+ for repository with large amount of commits.
+
+ * public/v3/models/commit-log.js: Increase digits from 8 to 12 for git SHA.
+ (CommitLog.prototype.label):
+ (CommitLog.prototype.diff):
+ * unit-tests/commit-log-tests.js: Updated unit tests.
+ * unit-tests/commit-set-tests.js: Updated unit tests.
+
2019-07-03 Dewei Zhu <[email protected]>
Test freshness page should expose revision information for latest build on tooltip.
Modified: trunk/Websites/perf.webkit.org/public/v3/models/commit-log.js (247769 => 247770)
--- trunk/Websites/perf.webkit.org/public/v3/models/commit-log.js 2019-07-24 17:10:19 UTC (rev 247769)
+++ trunk/Websites/perf.webkit.org/public/v3/models/commit-log.js 2019-07-24 17:10:28 UTC (rev 247770)
@@ -54,7 +54,7 @@
if (parseInt(revision) == revision) // e.g. r12345
return 'r' + revision;
if (revision.length == 40) // e.g. git hash
- return revision.substring(0, 8);
+ return revision.substring(0, 12);
return revision;
}
title() { return this._repository.name() + ' at ' + this.label(); }
@@ -74,7 +74,7 @@
if (parseInt(from) == from)// e.g. r12345.
label = `r${from}-r${this.revision()}`;
else if (to.length == 40) // e.g. git hash
- label = `${from.substring(0, 8)}..${to.substring(0, 8)}`;
+ label = `${from.substring(0, 12)}..${to.substring(0, 12)}`;
else
label = `${from} - ${to}`;
Modified: trunk/Websites/perf.webkit.org/unit-tests/commit-log-tests.js (247769 => 247770)
--- trunk/Websites/perf.webkit.org/unit-tests/commit-log-tests.js 2019-07-24 17:10:19 UTC (rev 247769)
+++ trunk/Websites/perf.webkit.org/unit-tests/commit-log-tests.js 2019-07-24 17:10:28 UTC (rev 247770)
@@ -148,7 +148,7 @@
});
it('should truncate a Git hash at 8th character', function () {
- assert.equal(gitWebKitCommit().label(), '6f8b0dbb');
+ assert.equal(gitWebKitCommit().label(), '6f8b0dbbda95');
});
it('should not modify OS X version', function () {
@@ -162,7 +162,7 @@
});
it('should truncate a Git hash at 8th character', function () {
- assert.equal(gitWebKitCommit().title(), 'WebKit at 6f8b0dbb');
+ assert.equal(gitWebKitCommit().title(), 'WebKit at 6f8b0dbbda95');
});
it('should not modify OS X version', function () {
@@ -188,7 +188,7 @@
});
assert.deepEqual(gitWebKitCommit().diff(), {
- label: '6f8b0dbb',
+ label: '6f8b0dbbda95',
url: 'http://trac.webkit.org/changeset/6f8b0dbbda95a440503b88db1dd03dad3a7b07fb',
repository: MockModels.webkit,
});
@@ -210,7 +210,7 @@
it('should truncate a Git hash at 8th character', function () {
assert.deepEqual(gitWebKitCommit().diff(oldGitWebKitCommit()), {
- label: 'ffda14e6..6f8b0dbb',
+ label: 'ffda14e6db07..6f8b0dbbda95',
url: '',
repository: MockModels.webkit
});
Modified: trunk/Websites/perf.webkit.org/unit-tests/commit-set-tests.js (247769 => 247770)
--- trunk/Websites/perf.webkit.org/unit-tests/commit-set-tests.js 2019-07-24 17:10:19 UTC (rev 247769)
+++ trunk/Websites/perf.webkit.org/unit-tests/commit-set-tests.js 2019-07-24 17:10:28 UTC (rev 247770)
@@ -410,8 +410,8 @@
it('should describe commit difference', () => {
assert.equal(CommitSet.diff(oneCommitSet(), commitSetWithAnotherWebKitCommit()), 'WebKit: webkit-commit-0 - webkit-commit-1');
assert.equal(CommitSet.diff(commitSetWithSVNCommit(), anotherCommitSetWithSVNCommit()), 'WebKit: r12345-r45678');
- assert.equal(CommitSet.diff(commitSetWithGitCommit(), anotherCommitSetWithGitCommit()), 'WebKit-Git: 13a0590d..2f8dd332');
- assert.equal(CommitSet.diff(commitSetWithTwoCommits(), anotherCommitSetWithTwoCommits()), 'WebKit: r12345-r45678 WebKit-Git: 13a0590d..2f8dd332');
+ assert.equal(CommitSet.diff(commitSetWithGitCommit(), anotherCommitSetWithGitCommit()), 'WebKit-Git: 13a0590d34f2..2f8dd3321d4f');
+ assert.equal(CommitSet.diff(commitSetWithTwoCommits(), anotherCommitSetWithTwoCommits()), 'WebKit: r12345-r45678 WebKit-Git: 13a0590d34f2..2f8dd3321d4f');
});
it('should describe commit root and patch difference', () => {