summaryrefslogtreecommitdiff
path: root/git-hooks
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@gmx.de>2020-05-07 21:24:45 +0200
committerOswald Buddenhagen <oswald.buddenhagen@gmx.de>2020-05-08 12:36:17 +0000
commitd6bae99c46f827a907dc3bd067bf19967cd725f8 (patch)
tree33d4cc30e82e87a599afcfed4b91a0a56f4002c9 /git-hooks
parent8f06a5036a5baba82b01ad696923ea1e9eadb303 (diff)
downloadqtrepotools-d6bae99c46f827a907dc3bd067bf19967cd725f8.tar.gz
rework creation of stable output for the autotest
instead of using tied hashes, just sort by line number. that's more thorough, cheaper, and less convoluted - so much that we can do it unconditionally. amends 1ae5efe70. Change-Id: Ieb5a6fc26379597cd30475b5725bed06205cb9c6 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'git-hooks')
-rwxr-xr-xgit-hooks/sanitize-commit10
1 files changed, 1 insertions, 9 deletions
diff --git a/git-hooks/sanitize-commit b/git-hooks/sanitize-commit
index ebe620f..20f1491 100755
--- a/git-hooks/sanitize-commit
+++ b/git-hooks/sanitize-commit
@@ -59,11 +59,6 @@ my $summary;
# Hash (by file) of hashes (by line) of lists (reports) of lists (msg, extra)
my %complaints;
my %footnotes;
-my $stable = defined($cfg{stable_hash});
-
-if ($stable) {
- require Tie::IxHash;
-}
sub printerr()
{
@@ -84,9 +79,6 @@ sub do_complain($$$;$@)
$msg = "Hint: ".$msg;
}
my $fn = $line < 0 ? "" : $file;
- if ($stable && !defined($complaints{$fn})) {
- tie %{$complaints{$fn}}, 'Tie::IxHash';
- }
push @{$complaints{$fn}{$line}}, [ $msg, @extra ];
}
@@ -928,7 +920,7 @@ if ($gerrit_rest) {
if (length($fn) && ($fn ne "~~~~~")) {
$file = ($fn eq "!!!!!") ? "/COMMIT_MSG" : $fn;
my @comments = ();
- foreach my $ln (keys %{$complaints{$fn}}) {
+ foreach my $ln (sort { $a <=> $b } keys %{$complaints{$fn}}) {
my @texts;
push @texts, @$_ foreach (@{$complaints{$fn}{$ln}});
my %comment;