Skip to content

Commit ce7b051

Browse files
committed
moves a hard-coded rule to a false positive
While having this exception as a hard-coded rule yields the correct credit, as a rule of thumb that is a last resort, generally for the use case in which Git does not even have the information about the author. When the author can be extracted, but the square brackets heuristic gives a false positive, we discard the false positive and let the rest of the logic do its thing.
1 parent 209c56d commit ce7b051

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

app/models/names_manager/false_positives.rb

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ def handle_false_positives(name)
3939
when "{ :ca => :'es-ES' }"
4040
when 'fixes 5f5e6d924973003c105feb711cefdb726f312768'
4141
when '79990505e5080804b53d81fec059136afa2237d7'
42+
when 'direct_upload_xls_in_chrome'
4243
when "schoenm\100earthlink.net sandra.metz\100duke.edu"
4344
name.split
4445
when '=?utf-8?q?Adam=20Cig=C3=A1nek?='

app/models/names_manager/hard_coded_authors.rb

-4
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,6 @@ def hard_coded_authors(commit)
9090
when '9668cc3bb03740b13477df0832332eec71563bc5'
9191
# Backport of the above commit.
9292
['Eileen M. Uchitelle', 'Aaron Patterson', 'Tsukuru Tanimichi']
93-
when '1d133e8a4725439e4a61d53ce913eba9dcab42d3'
94-
# This attribution was incorrectly given to "direct_upload_xls_in_chrome",
95-
# (the branch name) which was included in the commit messages in brackets.
96-
['Nick Weiland']
9793
else
9894
nil
9995
end

test/credits/false_positives_test.rb

+4
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,10 @@ class FalsePositivesTest < ActiveSupport::TestCase
165165
assert_contributor_names 'eade591', 'Prem Sichanugrist'
166166
end
167167

168+
test 'direct_upload_xls_in_chrome' do
169+
assert_contributor_names '1d133e8', 'Nick Weiland'
170+
end
171+
168172
test "schoenm\100earthlink.net sandra.metz\100duke.edu" do
169173
assert_contributor_names '242cd06', 'Michael Schoen', 'Sandi Metz'
170174
end

test/credits/hard_coded_authors_test.rb

-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ class SpecialCasedCommitsTest < ActiveSupport::TestCase
3131
assert_contributor_names '872e22c', 'Daniel Rikowski', 'Genadi Samokovarov'
3232
assert_contributor_names '9220935', 'Eileen M. Uchitelle', 'Aaron Patterson', 'Tsukuru Tanimichi'
3333
assert_contributor_names '9668cc3', 'Eileen M. Uchitelle', 'Aaron Patterson', 'Tsukuru Tanimichi'
34-
assert_contributor_names '1d133e8', 'Nick Weiland'
3534
end
3635
end
3736
end

0 commit comments

Comments
 (0)