How would you include the current commit id in a Git project's files?
git
Solution
Add it to your automated deploy system.
If your deploy isn't automated, then automate it and add it there. Then you have removed a step.
Make it a more useful "this was deployed on x date at y time from z repository". The hash of the commit doesn't really mean a whole lot to non-developers.
Problem
I've got an open source static JavaScript + HTML application that's deployed in about three different places right now, one on my local machine, one on an internal server, and one on a stable external server. I'd like to be able to tell immediately which version is deployed in which place, and I'd like bug reporters to have easy access to the version that they're reporting the bug on. Ideally I'd like, as part of the commit process, for a file to be written with the hash of the commit. Of course, from what I know of Git this is impossible, as including the calculated hash as part of a file in a commit would change the calculated hash of that commit. On the other hand, I could incorporate building this as part of a build process. I don't currently have a build process though, and I'd like to avoid adding a step if possible. What's the cleanest way to do this?