{"thread":{"id":"7851","subject":"[PATCH 2/2] Fine-tune relative-date output.","startedAt":"2007-04-26T05:23:00Z","lastAt":"2007-04-26T05:23:00Z","messageCount":1,"participants":["Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"40487","messageId":"11775649803059-git-send-email-junkio@cox.net","threadId":"7851","inReplyTo":null,"subject":"[PATCH 2/2] Fine-tune relative-date output.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-04-26T05:23:00Z","receivedAt":"2007-04-26T05:23:00Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"I've always found relative-date less useful than it could be, as\nit switched to coarser unit a bit too quickly, so this attempts\nto fine tune it to my liking.\n\nFor example, earlier we said \"3 weeks ago\" if it is between 18\ndays and 24 days; now we do not say \"weeks\" if it is less than a\nmonth old.\n\n                        Earlier         Updated\n\n   X minutes ago        < 90 minutes    < 3 hours\n   X hours ago          < 36 hours      < 3 days\n   X days ago           < 2 weeks       < 1 month\n   X weeks ago          < 10 weeks      < 10 weeks\n   X months ago         < 1 year        < 2 1/2 years\n\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n---\n\n * I will not strongly insist doing this, but the current\n   setting is so annoying that I seldom use --relative-date,\n   except when I look at reflog entries that are no older than a\n   day.\n\n   We probably could have --relative-date=90,36,14,70,360 (or\n   .git/config equivalent) to further fine tune this, but I\n   personally did not feel it is worth it.\n\n date.c |   10 +++++-----\n 1 files changed, 5 insertions(+), 5 deletions(-)\n\ndiff --git a/date.c b/date.c\nindex a9b59a2..d2ea995 100644\n--- a/date.c\n+++ b/date.c\n@@ -99,19 +99,19 @@ const char *show_date(unsigned long time, int tz, enum date_mode mode)\n \t\t}\n \t\t/* Turn it into minutes */\n \t\tdiff = (diff + 30) / 60;\n-\t\tif (diff < 90) {\n+\t\tif (diff < 180) {\n \t\t\tsnprintf(timebuf, sizeof(timebuf), \"%lu minutes ago\", diff);\n \t\t\treturn timebuf;\n \t\t}\n \t\t/* Turn it into hours */\n \t\tdiff = (diff + 30) / 60;\n-\t\tif (diff < 36) {\n+\t\tif (diff < 72) {\n \t\t\tsnprintf(timebuf, sizeof(timebuf), \"%lu hours ago\", diff);\n \t\t\treturn timebuf;\n \t\t}\n \t\t/* We deal with number of days from here on */\n \t\tdiff = (diff + 12) / 24;\n-\t\tif (diff < 14) {\n+\t\tif (diff < 35) {\n \t\t\tsnprintf(timebuf, sizeof(timebuf), \"%lu days ago\", diff);\n \t\t\treturn timebuf;\n \t\t}\n@@ -120,8 +120,8 @@ const char *show_date(unsigned long time, int tz, enum date_mode mode)\n \t\t\tsnprintf(timebuf, sizeof(timebuf), \"%lu weeks ago\", (diff + 3) / 7);\n \t\t\treturn timebuf;\n \t\t}\n-\t\t/* Say months for the past 12 months or so */\n-\t\tif (diff < 360) {\n+\t\t/* Say months for the past 30 months or so */\n+\t\tif (diff < 900) {\n \t\t\tsnprintf(timebuf, sizeof(timebuf), \"%lu months ago\", (diff + 15) / 30);\n \t\t\treturn timebuf;\n \t\t}\n-- \n1.5.2.rc0.719.gb3626\n"}]}