Using git log for file modification dates

2017-04-12

So remember that other post where I complained about Linux not providing file creation dates? Since I have all of my posts checked out in git, it turns out that I can use git to retrieve the creation dates! Here's the command:

git log --follow --format=%ad -- post_filename

This outputs a list of dates when the file was added or modified. I have Python grab the earliest and latest and then parse the strings. It's simple, and I don't have to implement my own tracker for metadata!