Subject: Re: bug#64069: 30.0.50; Mistyped shy group regexps

From: Dmitry Gutov <[email-masked]>
Date: Thu, 15 Jun 2023 04:45:45 +0300

Hi Basil,

On 14/06/2023 19:43, Basil Contovounesios wrote:
> - Dmitry to review the change in vc-git
> - Paul for any comments on the time handling in vc-git-annotate-time
> 
> In vc-git-annotate-time, the mistyped group added in [1] throws off the
> match string indices that are later passed to encode-time: by my reading
> the hour argument by chance continues to be specified correctly, but the
> minutes argument receives the number of hours, the seconds argument the
> number of minutes, and the timezone argument the number of seconds.
> 
> [1]: Display shorter dates in Git annotate output
> 576fba5f58d 2015-05-17 02:47:17 +0300
> https://git.sv.gnu.org/cgit/emacs.git/commit/?id=576fba5f58d
> 
> Even after correcting the shy group, the timezone parsing doesn't seem
> right to me: encode-time expects a UTC offset in seconds, but is passed
> e.g. (string-to-number "+0100")=100s instead of the expected 1hr=3600s.

Thank you for the effort, but I think most of this nuance could be 
simplified away.

When you say "encode-time ... is passed ... +0100", what is your testing 
scenario?

IIUC, the change in commit 576fba5f58d removed the complex dates from 
the output (which we parse), replacing them with the simple yyyy-mm-dd 
format (that's what --date=short does). Seems like I tried (8 years ago) 
to retain the compatibility with the previous output in case we'll make 
the format configurable someday, but that still hasn't happened. So we 
could do away with the 'if' condition and simplify the regexp accordingly.