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

[PATCH] Fix '--relative-date'

From
Johan Sageryd <j416@1616.se>
Date
Oct 3, 2009, 04:20 UTC
Message-ID
<1254543618-3772-1-git-send-email-j416@1616.se>
This fixes '--relative-date' so that it does not give '0 year, 12 months', for the interval 360 <= diff < 365.
Signed-off-by: Johan Sageryd <j416@1616.se>
---
 date.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/date.c b/date.c
index e9ee4aa..5d05ef6 100644
--- a/date.c
+++ b/date.c
@@ -123,7 +123,7 @@ const char *show_date_relative(unsigned long time, int tz,
 		return timebuf;
 	}
 	/* Say months for the past 12 months or so */
-	if (diff < 360) {
+	if (diff < 365) {
 		snprintf(timebuf, timebuf_size, "%lu months ago", (diff + 15) / 30);
 		return timebuf;
 	}
-- 
1.6.4.4
Next: Jeff King
Message 1 of 3 in “Fix '--relative-date'”
  1. Fix '--relative-date'Johan Sageryd, Oct 3, 2009
  2. Jeff KingOct 3, 2009
  3. Johan SagerydOct 3, 2009

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.