Sometimes I want to copy a feature from one project to another. I can pretty easily move the code by making a patch, cherry-picking some commits, or, in case the target project is too different from the source project, just viewing the commits and making similar changes in the target project.
However, there are sometimes changes that don’t appear in the git history because they take place outside of the codebase, for example, on the command line (like running a bunch of images through pngcrush), or on a website (like using an online CSS to SASS converter).
I have started documenting these in a file called
devlog.txt at the root of each project. Then, when I go back and look at a commit, the diff shows some new lines in the devlog that are related to the code changes and otherwise would have been lost.
Here’s an example devlog.txt:
# add sass (cd assets && npm install node-sass sass-loader --save-dev) # convert css to sass https://css2sass.herokuapp.com # downgrade sass-loader to 7.3.1 due to breaking changes in 8.0 (cd assets && npm install firstname.lastname@example.org --save-dev) # test that sass works (cd assets && node node_modules/webpack/bin/webpack.js --mode development) # install bulma (cd assets && npm install bulma)
And when I
git show a commit, I see what commands I ran in addition to the code changes:
--- a/devlog.txt +++ b/devlog.txt @@ -2,4 +2,10 @@ # convert css to sass https://css2sass.herokuapp.com +# downgrade sass-loader to 7.3.1 due to breaking changes in 8.0 +(cd assets && npm install email@example.com --save-dev) + +# test that sass works +(cd assets && node node_modules/webpack/bin/webpack.js --mode development)