r/git
•
u/sunshine-and-sorrow
ORIG_HEAD
•
1d ago
•
1
Git easter egg: tea is a valid date keyword meaning 5pm
Found this amusing. 21 years ago, a function named date_tea was added to date.c, which means you can run something like git diff HEAD@{tea}, git log --since=tea, etc.
204
Upvotes
49
u/Ok_Woodpecker_9104 1d ago •
the fun part is it picks the last 5pm that already happened. run it before 5 and HEAD@{tea} is yesterday at 5. noon, midnight and yesterday sit in the same little table in date.c, next to never which is 1970
the bad part is approxidate almost never errors, git log --since=banana just means now, so a typo in a date gives you an empty log and no warning
8
u/elperroborrachotoo 23h ago
Local time or GMT?
2
u/thatsalovelyusername 9h ago
I’m guessing this is from somewhere (a part of Britain?) where “tea” means dinner?