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

Re: [PATCH] show_date(): fix relative dates

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jan 21, 2007, 01:34 UTC
Message-ID
<Pine.LNX.4.63.0701210219400.22628@wbgn013.biozentrum.uni-wuerzburg.de>
In-Reply-To
<7v3b656vq5.fsf@assigned-by-dhcp.cox.net>
Hi,
On Sat, 20 Jan 2007, Junio C Hamano wrote:
> I noticed this and have a different solution in the show-branch
> --reflog code (it does not pass tz).

Actually, you do pass tz, but with a fixed value of 0. But this is only a workaround.

The thing is, if you pass the same timestamp with a different timezone, absolute (non-relative) date will show the same time, i.e. 22:24 +0000 is the same as 23:24 +0100.

Now I expect the same of relative mode, only that the timezone does not matter for relative mode _at all_.

As you can see in my patch for --walk-reflogs (to honour --relative-date), it can make sense to pass make the choice whether to show a relative or an absolute date a runtime option (where you don't want to set tz to 0 depending on relativa_date).

I guess nobody realized that "git log --relative-date" does not work correctly (for all commits which were not committed in tz +0000), is due to its narrowspread use, or that it is not all that obviously wrong.

However, I was very surprised when "git log --walk-reflogs --relative-date" showed me "in the future" for my last commits.

If you don't want to think it through, please just verify my reasoning by compiling the script I gave with the patch both before and after applying the patch. The absolute dates _and_ the relative dates should be all the same, but the relative date with non-zero timezone is displayed as "in the future" withouth the patch.

Ciao, Dscho

Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 4 in “show_date(): fix relative dates”
  1. show_date(): fix relative datesJohannes Schindelin, Jan 20, 2007
  2. Junio C HamanoJan 21, 2007
  3. Johannes SchindelinJan 21, 2007
  4. Junio C HamanoJan 21, 2007

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.