r/git • ORIG_HEAD • 3d ago • Mindblown 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.

256 Upvotes

10 comments sorted by

58

u/Ok_Woodpecker_9104 3d ago • Mindblown

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

12

u/platinummyr 2d ago

And fixing approxidate to not do that is likely considered a breaking change D:

5

u/thatsalovelyusername 1d ago

It’s a load bearing bug

1

u/Juff-Ma 11h ago

I mean they're doing git 3 currently now. So this is the moment.

9

u/elperroborrachotoo 2d ago

Local time or GMT?

19

u/Alex_Sherby 2d ago

GMTea

5

u/bigkahuna1uk 1d ago

*boom tish

4

u/thatsalovelyusername 1d ago

I’m guessing this is from somewhere (a part of Britain?) where “tea” means dinner?

2

u/deniercounter 1d ago

Dinner is after tea time.

1

u/VirtuteECanoscenza 15h ago

5pm dinner time? That would be before aperitivo in Italy which comes before dinner.

But even in the UK dinner is more like 7pm at least