Re:Highlights from Git 2.28
by sixstringtheory on Monday July 27, 2020 @05:40PM
(#23969715)
I love having idempotent makefile tasks that can do this kind of thing.
And as far as "pages of instructions in various states of decay," couldn't agree more that those aren't a good solution. I usually observe those instructions containing lots of terminal commands. I'd rather have those in an executable format, with commenting if explanation is needed. Then it's (usually, hopefully) pretty obvious where something breaks, instead of rotting instructions nobody can say 100% what is or isn't current.
How do you make sure your makefile tasks are idempotent?
A simple way is to use output files to indicate if a command has been run.
Example:
git-setup.out: touch $@
Highly recommend this.