- Fixing code the second time around, because programmers rarely write good code the first time
Noun: a change to made to the internal structure of software to make it easier to understand and cheaper to modify without changing its observable behavior
Noun: a change to made to the internal structure of software to make it easier to understand and cheaper to modify without changing its observable behavior
| grep shotgun docker-compose.development.yml | |
| if [ $? -eq 0 ] ; then | |
| perl -p -i -e "s/shotgun/unicorn/g" docker-compose.development.yml | |
| else | |
| perl -p -i -e "s/unicorn/shotgun/g" docker-compose.development.yml | |
| fi |
| CURRENT_BRANCH=$(git describe --contains --all HEAD) | |
| PREVIOUS_BRANCH=$(git for-each-ref --sort=committerdate refs/heads/ | tail -n 1 | cut -c 60-) | |
| TWO_BACK_BRANCH=$(git for-each-ref --sort=committerdate refs/heads/ | tail -n 2 | head -n 1 | cut -c 60-) | |
| if [[ $CURRENT_BRANCH == $PREVIOUS_BRANCH ]]; then | |
| GITCOMMAND="git checkout ${TWO_BACK_BRANCH}" | |
| else | |
| GITCOMMAND="git checkout ${PREVIOUS_BRANCH}" | |
| fi | |
| eval $GITCOMMAND |
superYour script should have the following features:
limit argument, so you can test on a small subsetoffset argument, so you can skip already processed rows