Thread (28 messages) 28 messages, 3 authors, 9d ago

Re: [PATCH v5 0/4] approxidate: tweak special date formats

From: Junio C Hamano <hidden>
Date: 2026-05-21 13:33:22

Tuomas Ahola [off-list ref] writes:
-static void date_today(struct tm *tm, struct tm *now, int *num UNUSED)
+static void date_today(struct tm *tm, struct tm *now, int *num)
 {
 	if (tm->tm_hour == now->tm_hour &&
 	    tm->tm_min == now->tm_min &&
 	    tm->tm_sec == now->tm_sec)
 		date_time(tm, 0);
+	*num = 0;
 	tm->tm_mday = -1;
 	update_tm(tm, now, 0);
 }
Hmph, what is this change about?  Does the lack of this clearing
break some test?

In any case, will queue.  It seems that we are getting to the point
of diminishing returns and better off declaring victory soonish?
quoted hunk ↗ jump to hunk
diff --git a/t/t0006-date.sh b/t/t0006-date.sh
index b187b1bfc4..9a76b84ed9 100755
--- a/t/t0006-date.sh
+++ b/t/t0006-date.sh
@@ -212,13 +212,14 @@ check_approxidate 'noon today' '2009-08-30 12:00:00'
 check_approxidate 'today at noon' '2009-08-30 12:00:00' '-12 hours'
 check_approxidate 'noon today' '2009-09-01 12:00:00' '+36 hours'
 check_approxidate 'noon yesterday' '2009-08-29 12:00:00'
+check_approxidate 'noon yesterday' '2009-08-29 12:00:00' '-12 hours'
 check_approxidate 'last Friday at noon' '2009-08-28 12:00:00'
 check_approxidate 'last Friday at noon' '2009-08-28 12:00:00' '-12 hours'
-check_approxidate 'noon yesterday' '2009-08-29 12:00:00' '-12 hours'
 check_approxidate 'tea last saturday' '2009-08-29 17:00:00'
 check_approxidate 'tea last saturday' '2009-08-29 17:00:00' '-12 hours'
 check_approxidate 'January 5th noon pm' '2009-01-05 12:00:00'
 check_approxidate 'January 5th noon pm' '2009-01-05 12:00:00' '-12 hours'
+check_approxidate 'January 5th today pm' '2009-01-30 12:00:00'
 check_approxidate '10am noon' '2009-08-29 12:00:00'
 check_approxidate 'January 5th yesterday' '2009-01-29 19:20:00'
 check_approxidate 'January 5th yesterday' '2008-12-31 19:20:00' '+2 days'
base-commit: 94f057755b7941b321fd11fec1b2e3ca5313a4e0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help