@@ -22,6 +22,9 @@ package App::Porting::updateAUTHORS;
22
22
mailmap_file=s
23
23
24
24
verbose+
25
+ exclude_missing|exclude
26
+ exclude_contrib=s@
27
+ exclude_me
25
28
26
29
from_commit|from=s
27
30
to_commit|to=s
@@ -32,8 +35,10 @@ sub main {
32
35
my %opts = (
33
36
authors_file => " AUTHORS" ,
34
37
mailmap_file => " .mailmap" ,
38
+ exclude_file => " Porting/exclude_contrib.txt" ,
35
39
from => " " ,
36
40
to => " " ,
41
+ exclude_contrib => [],
37
42
);
38
43
39
44
# # Parse options and print usage if there is a syntax error,
@@ -58,6 +63,17 @@ sub main {
58
63
pod2usage(1) if $opts {help };
59
64
pod2usage(-verbose => 2) if $opts {man };
60
65
66
+ if (delete $opts {exclude_me }) {
67
+ my ($author_full )= Porting::updateAUTHORS-> current_author_name_email(" full" );
68
+ my ($committer_full )= Porting::updateAUTHORS-> current_committer_name_email(" full" );
69
+
70
+ push @{$opts {exclude_contrib }}, $author_full
71
+ if $author_full ;
72
+ push @{$opts {exclude_contrib }}, $committer_full
73
+ if $committer_full and (!$author_full or
74
+ $committer_full ne $author_full );
75
+ }
76
+
61
77
my $self = Porting::updateAUTHORS-> new(%opts );
62
78
63
79
my $changed = $self -> read_and_update();
@@ -73,7 +89,7 @@ sub main {
73
89
=head1 NAME
74
90
75
91
F<Porting/updateAUTHORS.pl> - Automatically update F<AUTHORS> and F<.mailmap>
76
- based on commit data.
92
+ and F<Porting/exclude_contrib.txt> based on commit data.
77
93
78
94
=head1 SYNOPSIS
79
95
@@ -96,6 +112,15 @@ =head1 SYNOPSIS
96
112
--authors-file=FILE override default of 'AUTHORS'
97
113
--mailmap-file=FILE override default of '.mailmap'
98
114
115
+ Action Modifiers
116
+ --exclude-missing Add new names to the exclude file so they never
117
+ appear in AUTHORS or .mailmap.
118
+
119
+ Details Changes
120
+ Update canonical name or email in AUTHORS and .mailmap properly.
121
+ --exclude-contrib NAME_AND_EMAIL
122
+ --exclude-me
123
+
99
124
=head1 OPTIONS
100
125
101
126
=over 4
@@ -126,6 +151,60 @@ =head1 OPTIONS
126
151
Override the default location of the mailmap file, which is by default
127
152
the F<.mailmap> file in the current directory.
128
153
154
+ =item C<--exclude-file=FILE >
155
+
156
+ =item C<--exclude_file=FILE >
157
+
158
+ Override the default location of the exclude file, which is by default
159
+ the F<Porting/exclude_contrib.txt> file reachable from the current
160
+ directory.
161
+
162
+ =item C<--exclude-contrib=NAME_AND_EMAIL >
163
+
164
+ =item C<--exclude_contrib=NAME_AND_EMAIL >
165
+
166
+ Exclude a specific name/email combination from our contributor datasets.
167
+ Can be repeated multiple times on the command line to remove multiple
168
+ items at once. If the contributor details correspond to a canonical
169
+ identity of a contributor (one that is in the AUTHORS file or on the
170
+ left in the .mailmap file) then ALL records, including those linked to
171
+ that identity in .mailmap will be marked for exclusion. This is similar
172
+ to C<--exclude-missing > but it only affects the specifically named
173
+ users. Note that the format for NAME_AND_EMAIL is similar to that of the
174
+ .mailmap file, email addresses and C< @github > style identifiers should
175
+ be wrapped in angle brackets like this: C<< <@github> >>, users with no
176
+ email in the AUTHORS file should use C<< <unknown> >>.
177
+
178
+ For example:
179
+
180
+ Porting/updateAUTHORS.pl --exclude-contrib="Joe B <[email protected] >"
181
+
182
+ Would remove all references to "Joe B" from F<AUTHORS> and F<.mailmap>
183
+ and add the required entires to F<Porting/exclude_contrib.txt> such that
184
+ the contributor would never be automatically added back, and would be
185
+ automatically removed should someone read them manually.
186
+
187
+ =item C<--exclude-missing >
188
+
189
+ =item C<--exclude_missing >
190
+
191
+ =item C<--exclude >
192
+
193
+ Normally when the tool is run it *adds* missing data only. If this
194
+ option is set then the reverse will happen, any author data missing will
195
+ be marked as intentionally missing in such a way that future "normal"
196
+ runs of the script ignore the author(s) that were excluded.
197
+
198
+ The exclude data is stored in F<Porting/exclude_contrib.txt> as a SHA256
199
+ digest (in base 64) of the user name and email being excluded so that
200
+ the list itself doesnt contain the contributor details in plain text.
201
+
202
+ The general idea is that if you want to remove someone from F<AUTHORS>
203
+ and F<.mailmap> you delete their details manually, and then run this
204
+ tool with the C<--exclude > option. It is probably a good idea to run it
205
+ first without any arguments to make sure you dont exclude something or
206
+ someone you did not intend to.
207
+
129
208
=back
130
209
131
210
=head1 DESCRIPTION
0 commit comments