Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You can add a small script to your project that you tell people to run the first time after cloning. Then with that script you can setup everything you want. Such as symlinks to git hooks also stored in the repo (so that they stay up to date), or set up the merge tool that you want.


Our team had started a practice of "devbox setup" scripts in each repo a few years ago. They're invaluable. Instead of following pages of instructions in various state of decay, running just one script puts you into the ready state in a few seconds. Any questions about why something is not working has only one answer: run the setup script.

Highly recommend this.


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 $@


Drop "done" files indicating a large step is done.


Symlinked hook is nice but its not a clean cross platform solution. We're a Unity shop so we support Windows, Mac and Linux devs (or like to try).

I just can't help but feel like if this is the common pattern, then it should be built into one of these tools in a more consistent way.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: