-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcommit.sh
More file actions
executable file
·53 lines (37 loc) · 1.4 KB
/
Copy pathcommit.sh
File metadata and controls
executable file
·53 lines (37 loc) · 1.4 KB
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
#!/bin/bash
set -euo pipefail
CMD="crystal"
if ! command -v crystal >/dev/null 2>&1; then
CMD="CrystalCode"
fi
if ! command -v "$CMD" >/dev/null 2>&1; then
echo "Error: neither 'crystal' nor 'CrystalCode' was found in PATH" >&2
exit 127
fi
BASE_MSG="Generate commit messages and commit the current change. Do not modify file contents. Do not build or test. Do not push. Do not ask questions.
Do not run any command other than git status, git diff, git log, git add, and git commit. Do not run commit.sh: it starts another copy of this same task and loops.
If staged and unstaged edits belong to the same change, stage the rest and make one commit."
FORMAT_MSG="Commit message format is mandatory. Use Conventional Commits.
Write each subject on one line, in this form:
<type>: <summary>
Use a lowercase type and exactly one space after the colon. Allowed types:
- feat
- fix
- docs
- chore
- refactor
- test
- perf
- build
- ci
- revert
Write the summary in plain English, in the imperative mood. Do not end it with a period. Do not use emoji. Keep the subject at 72 characters or fewer.
If one commit is not enough, create multiple commits, each with a compliant subject.\n\n\n"
TASK="$BASE_MSG
\n
$FORMAT_MSG"
for arg in "$@"; do
TASK+=$'\n'"$arg"
done
#printf '[%s]\n'
"$CMD" run --workspace . --approval review --work --show-thinking --external-tools off --workspace-trust off --duration 600 "$TASK"