unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dmitry@gutov.dev>
To: Basil Contovounesios <contovob@tcd.ie>, 64069@debbugs.gnu.org
Cc: "Alan Mackenzie" <acm@muc.de>,
	"Mattias Engdegård" <mattias.engdegard@gmail.com>,
	"Paul Eggert" <eggert@cs.ucla.edu>
Subject: bug#64069: 30.0.50; Mistyped shy group regexps
Date: Thu, 15 Jun 2023 04:45:45 +0300	[thread overview]
Message-ID: <8d2a4d47-10d7-d16e-85d2-8009781a0dbc@gutov.dev> (raw)
In-Reply-To: <87v8fq570k.fsf@epfl.ch>

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.





  reply	other threads:[~2023-06-15  1:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-14 16:43 bug#64069: 30.0.50; Mistyped shy group regexps Basil Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-15  1:45 ` Dmitry Gutov [this message]
2023-06-15  7:39   ` Basil Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-15 12:14     ` Dmitry Gutov
2023-06-15 20:58 ` Alan Mackenzie
2023-06-17 13:26   ` Alan Mackenzie
2023-06-17 15:39     ` Basil Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8d2a4d47-10d7-d16e-85d2-8009781a0dbc@gutov.dev \
    --to=dmitry@gutov.dev \
    --cc=64069@debbugs.gnu.org \
    --cc=acm@muc.de \
    --cc=contovob@tcd.ie \
    --cc=eggert@cs.ucla.edu \
    --cc=mattias.engdegard@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).