On Mon, Nov 29, 2021 at 03:37:47PM +0200, Nir Soffer wrote:
> > > > if (!$date && -d $filename) {
> > > > local $ENV{GIT_DIR} = $filename;
> > > > - $_ = `git show -O/dev/null -s --format=%ci`;
> > > > - $date = $1 if /^(\d+-\d+-\d+)\s/;
> > > > + $date = `git show -O/dev/null -s --format=%cs`;
> > > > }
> > > > if (!$date) {
> > > > my ($day, $month, $year) = (gmtime($ENV{SOURCE_DATE_EPOCH} ||
time))[3,4,5];
> > >
> > > This is fine. Same patch should go into nbdkit too.
> >
> > Actually this caused a problem and I had to revert the commits in
> > nbdkit & libnbd. See:
> >
> >
https://gitlab.com/nbdkit/nbdkit/-/commit/750ad5972bb082d188f17f8f71ef1ec...
>
> Sorry, I tested the generated man pages with "man /path/to/manpage" and
> they looked correct.
>
> I think this should work:
>
> - $_ = `git show -O/dev/null -s --format=%ci`;
> + $_ = `git show -O/dev/null -s --format=%cs`;
%cs is correct, but what you missed was that --format=%cs outputs
'yyyy-mm-dd\n', and the \n hurts. Reading 'git format --help', that
is short for --format=tformat:%cs, but we need --format=format:%cs
(that is, we do not want the trailing newline). I've reinstated your
patch as bdcf0765 on nbdkit, and will shortly follow up on libnbd.