Skip to content

Commit 387d45f

Browse files
authored
Clarify use of SOURCE_DATE_EPOCH environment variable. (#421)
See #403. Signed-off-by: Henry Cox <[email protected]>
1 parent 8143e01 commit 387d45f

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

bin/genhtml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5471,12 +5471,19 @@ sub _computeAge
54715471
if ($then > $now) {
54725472
if (lcovutil::warn_once($lcovutil::ERROR_INCONSISTENT_DATA, $path)) {
54735473
# issue annotation warning at most once per file
5474+
# also attempt to clarify where the date comes from
54745475
my $data =
54755476
exists($ENV{SOURCE_DATE_EPOCH}) ?
5476-
"'SOURCE_DATE_EPOCH=$ENV{SOURCE_DATE_EPOCH}'" :
5477+
(
5478+
lcovutil::warn_once($lcovutil::ERROR_INCONSISTENT_DATA,
5479+
'SOURCE_DATE_EPOCH') ?
5480+
"computed from your 'SOURCE_DATE_EPOCH=$ENV{SOURCE_DATE_EPOCH}' environment variable - see 'man genhtml'"
5481+
:
5482+
"'SOURCE_DATE_EPOCH=$ENV{SOURCE_DATE_EPOCH}'") :
54775483
"'now'";
5484+
54785485
lcovutil::ignorable_error($lcovutil::ERROR_INCONSISTENT_DATA,
5479-
"File \"$path\": $data ($now) is older than annotate time '$when'"
5486+
"File \"$path\": '$now' ($data) is older than annotate time '$when'"
54805487
);
54815488
}
54825489
return 0;

man/genhtml.1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1947,7 +1947,8 @@ The
19471947
.B \-\-date\-bins
19481948
option is used to specify age boundaries (cutpoints) for date\-binning classification. Each
19491949
.I age
1950-
element is expected to be an integer number of days prior to today (or SOURCE_DATE_EPOCH, if specified). If not specified, the default is to use 4 age ranges: less than 7 days, 7 to 30 days, 30 to 180 days, and more than 180 days.
1950+
element is expected to be an integer number of days prior to today (or prior to your SOURCE_DATE_EPOCH environment variable, if set). If
1951+
.I \-\-date\-bins is not specified, the default is to use 4 age ranges: less than 7 days, 7 to 30 days, 30 to 180 days, and more than 180 days.
19511952
This option is equivalent to the
19521953
.I genhtml_date_bins
19531954
config file option. See man

0 commit comments

Comments
 (0)