GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — ApprovalTests.cpp/scripts/create-commit-message.sh at master · approvals/ApprovalTests.cpp

Expand file tree

/

create-commit-message.sh

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
executable file
·
52 lines (43 loc) · 1.46 KB
/

create-commit-message.sh

Copy path

File metadata and controls

executable file
·
52 lines (43 loc) · 1.46 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
# Create a commit message: <risk char> <intention char> <message>
#
# Usage: create-commit-message.sh RISK INTENTION MESSAGE
# See InternalDocuments/commit_notation.md for the names.
set -e
name=$(basename "$0")
fail() {
echo "$name: error: $1" >&2
exit 1
}
if [ $# -ne 3 ]; then
echo "$name: usage: $name risk intention message" >&2
exit 2
fi
risk=$1
intention=$2
message=$3
case "$risk" in
completely_safe) risk_char=. ;;
proven) risk_char=- ;;
single_item) risk_char=! ;;
other) risk_char=@ ;;
*) fail "unrecognized risk '$risk' (expected one of: completely_safe, proven, single_item, other)" ;;
esac
case "$intention" in
environment) intention_char=e ;;
test) intention_char=t ;;
refactor) intention_char=r ;;
feature) intention_char=F ;;
bug) intention_char=B ;;
documentation) intention_char=d ;;
*) fail "unrecognized intention '$intention' (expected one of: environment, test, refactor, feature, bug, documentation)" ;;
esac
# Development environment changes can't break production, whatever the testing.
if [ "$intention" = environment ] && [ "$risk" != completely_safe ]; then
fail "intention '$intention' can't break production, so risk must be completely_safe"
fi
# Trim leading and trailing whitespace.
message="${message#"${message%%[![:space:]]*}"}"
message="${message%"${message##*[![:space:]]}"}"
[ -n "$message" ] || fail "message is required"
echo "$risk_char $intention_char $message"
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.