git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] mingw: use modern strftime implementation if possible

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 8, 2020, 19:14 UTC
Message-ID
<xmqqblo1pz7b.fsf@gitster.c.googlers.com>
In-Reply-To
<pull.753.git.git.1586368729890.gitgitgadget@gmail.com>

"Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com> writes:

Show 30 quoted lines
> From: =?UTF-8?q?Matthias=20A=C3=9Fhauer?= <mha1993@live.de>
>
> Microsoft introduced a new "Universal C Runtime Library" (UCRT) with
> Visual Studio 2015. The UCRT comes with a new strftime() implementation
> that supports more date formats. We link git against the older
> "Microsoft Visual C Runtime Library" (MSVCRT), so to use the UCRT
> strftime() we need to load it from ucrtbase.dll using
> DECLARE_PROC_ADDR()/INIT_PROC_ADDR().
>
> Most supported Windows systems should have recieved the UCRT via Windows
> update, but in some cases only MSVCRT might be available. In that case
> we fall back to using that implementation.
>
> With this change, it is possible to use e.g. the `%g` and `%V` date
> format specifiers, e.g.
>
> 	git show -s --format=%cd --date=format:‘%g.%V’ HEAD
>
> Without this change, the user would see this error message on Windows:
>
> 	fatal: invalid strftime format: '‘%g.%V’'
>
> This fixes https://github.com/git-for-windows/git/issues/2495
>
> Signed-off-by: Matthias Aßhauer <mha1993@live.de>
> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> ---
>     Use a modern strftime() on Windows when available
>     
>     This is another contribution that came in via Git for Windows.

Sure. It would be very surprising if contribution to compat/mingw.c came in via Git on Macintosh ;-)

Will apply, together with the other one.  Thanks.
Previous: Johannes Schindelin via GitGitGadgetNext: Johannes Schindelin
Message 2 of 3 in “mingw: use modern strftime implementation if possible”
  1. mingw: use modern strftime implementation if possibleJohannes Schindelin via GitGitGadget, Apr 8, 2020
  2. Junio C HamanoApr 8, 2020
  3. Johannes SchindelinApr 10, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.