Git development
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Luna Schwalbe <dev@luna.gl>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] doc: document and test `@` prefix for raw timestamps
Date: Tue, 02 Jun 2026 09:23:34 +0900	[thread overview]
Message-ID: <xmqqfr35zt6h.fsf@gitster.g> (raw)
In-Reply-To: <20260601213944.645731-2-dev@luna.gl> (Luna Schwalbe's message of "Mon, 1 Jun 2026 23:39:45 +0200")

Luna Schwalbe <dev@luna.gl> writes:

> diff --git a/Documentation/date-formats.adoc b/Documentation/date-formats.adoc
> index e24517c49..83f676585 100644
> --- a/Documentation/date-formats.adoc
> +++ b/Documentation/date-formats.adoc
> @@ -10,6 +10,12 @@ Git internal format::
>  	`<time-zone-offset>` is a positive or negative offset from UTC.
>  	For example CET (which is 1 hour ahead of UTC) is `+0100`.
>  
> +    It is safer to prepend the `<unix-timestamp>` with `@`
> +    (e.g., `@0 +0000`), which forces Git to interpret it as a raw
> +    timestamp. This is required for values less than 100,000,000
> +    (which have fewer than 9 digits) to avoid confusion with other
> +    date formats (like `YYYYMMDD`).

Does this "additional paragraph" format correctly, instead of
rendered as a literal block (typically typeset in typewriter font,
monospace)?  Don't you need to do something like what is done for
"ISO 8601::" that appears later in the same file?  I.e. lose the
four-space indent and replace the blank line before it with a single
'+' list continuation operator?

> +# pathologically small timestamps requiring `@` prefix
> +check_parse '@0 +0000' '1970-01-01 00:00:00 +0000'
> +check_parse '@99999999 +0000' '1973-03-03 09:46:39 +0000'
> +check_parse '99999999 +0000' bad

This is totally outside the scope of this topic, but we might want
to enhance the rule a bit to declare this is *not* ambigous.  As
there is no 99th month or 99th day, this cannot be in the YYYYMMDD
date format.

> +check_parse '@100000000 +0000' '1973-03-03 09:46:40 +0000'
> +check_parse '100000000 +0000' '1973-03-03 09:46:40 +0000'


  reply	other threads:[~2026-06-02  0:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-01 21:39 [PATCH] doc: document and test `@` prefix for raw timestamps Luna Schwalbe
2026-06-02  0:23 ` Junio C Hamano [this message]
2026-06-02  6:17   ` Jeff King
2026-06-02  8:15   ` Luna Schwalbe
2026-06-02  9:10     ` Junio C Hamano

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

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

  git send-email \
    --in-reply-to=xmqqfr35zt6h.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=dev@luna.gl \
    --cc=git@vger.kernel.org \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox