How it works...

The get_git_changeset_timestamp() function takes the absolute_path directory as a parameter and calls the git log shell command with the parameters to show the Unix timestamp of the HEAD revision in the directory. We pass BASE_DIR to the function, as we are sure that it is under version control. The timestamp is parsed, converted to a string consisting of the year, month, day, hour, minutes, and seconds returned, and is then included in the definition of the STATIC_URL.