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

rs/strbuf-addftime-zZ, was Re: What's cooking in git.git (Jun 2017, #04; Tue, 13)

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jun 14, 2017, 10:57 UTC
Message-ID
<alpine.DEB.2.21.1.1706141245520.171564@virtualbox>
In-Reply-To
<xmqqshj34ldr.fsf@gitster.mtv.corp.google.com>
Hi Junio,
On Tue, 13 Jun 2017, Junio C Hamano wrote:
Show 10 quoted lines
> * rs/strbuf-addftime-zZ (2017-06-10) 2 commits
>  - date: use localtime() for "-local" time formats
>  - strbuf: let strbuf_addftime handle %z and %Z itself
> 
>  As there is no portable way to pass timezone information to
>  strftime, some output format from "git log" and friends are
>  impossible to produce.  Teach our own strbuf_addftime to replace %z
>  and %Z with caller-supplied values to help working around this.
> 
>  Will merge to 'next'.
Hold on. Have you tried to build this branch?
-- snip --
    CC date.o
date.c:63:36: error: unknown type name ‘timestamp_t’
 static struct tm *time_to_tm_local(timestamp_t time)
                                    ^
date.c: In function ‘show_date’:
date.c:211:8: error: implicit declaration of function ‘time_to_tm_local’
[-Werror=implicit-function-declaration]
   tm = time_to_tm_local(time);
        ^
date.c:211:6: error: assignment makes pointer from integer without a cast
[-Werror=int-conversion]
   tm = time_to_tm_local(time);
      ^
cc1: all warnings being treated as errors
-- snap --

I would expect this to be rebased *at least* to dddbad728c9 (timestamp_t: a new data type for timestamps, 2017-04-26).

But even then, it fails in t0006 on Windows with this error:

-- snip -- ++ eval 'diff -u "$@" ' +++ diff -u expect actual --- expect 2017-06-14 10:53:40.126136900 +0000 +++ actual 2017-06-14 10:53:40.171146800 +0000

@@ -1 +1 @@
-1466000000 +0200 -> 2016-06-15 14:13:20 +0000 (UTC)
+1466000000 +0200 -> 2016-06-15 14:13:20 UTC (UTC)
+ test_eval_ret_=1
+ want_trace
+ test t = t
+ test t = t
+ set +x
error: last command exited with $?=1
not ok 23 - show date (format-local:%Y-%m-%d %H:%M:%S %z (%Z):1466000000 +0200)
#
#                       echo "$time -> $expect" >expect &&
#                       (
#                               if test -n "$zone"
#                               then
#                                       TZ=$zone
#                                       export $TZ
#                               fi &&
#                               test-date show:"$format" "$time" >actual
#                       ) &&
#                       test_cmp expect actual
-- snap --

What gives?

Ciao,
Dscho
Previous: Torsten BögershausenNext: Jeff King
Message 6 of 13 in “What's cooking in git.git (Jun 2017, #04; Tue, 13)”
  1. Junio C HamanoJun 13, 2017
  2. Jonathan NiederJun 14, 2017
  3. Junio C HamanoJun 15, 2017
  4. Lars SchneiderJun 14, 2017
  5. Torsten BögershausenJun 14, 2017
  6. rs/strbuf-addftime-zZ, was Re: What's cooking in git.git (Jun 2017, #04; Tue, 13)Johannes Schindelin, Jun 14, 2017
  7. Jeff KingJun 14, 2017
  8. René ScharfeJun 14, 2017
  9. Johannes SchindelinJun 14, 2017
  10. René ScharfeJun 14, 2017
  11. Jeff KingJun 15, 2017
  12. René ScharfeJun 15, 2017
  13. Junio C HamanoJun 14, 2017

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.