See how a minor change to your commit message style can make you a better programmer.
Format: <type>(<scope>): <subject>
<scope> is optional
| error_page 500 /500.html; | |
| location /500.html{ | |
| return 500 '{"error": {"status_code": 500,"status": "Internal Server Error"}}'; | |
| } | |
| error_page 502 /502.html; | |
| location /502.html{ | |
| return 502 '{"error": {"status_code": 502,"status": "Bad Gateway"}}'; | |
| } |
| #!/bin/bash | |
| # | |
| # Inspects branch name and checks if it contains a Jira ticket number (i.e. ABC-123). | |
| # If yes, commit message will be automatically prepended with [ABC-123]. | |
| # | |
| # Useful for looking through git history and relating a commit or group of commits | |
| # back to a user story. | |
| # |
I had an interesting use-case with a customer for which I provide consulting services: they needed multiple fields to be marked as "optional".
We will take a CRUD-ish example, for the sake of simplicity.
For example, in the following scenario, does a null $description mean "remove the description",
| #!/bin/bash | |
| # This way you can customize which branches should be skipped when | |
| # prepending commit message. | |
| if [ -z "$BRANCHES_TO_SKIP" ]; then | |
| BRANCHES_TO_SKIP=(master develop test) | |
| fi | |
| BRANCH_NAME=$(git symbolic-ref --short HEAD) | |
| BRANCH_NAME="${BRANCH_NAME##*/}" |