-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate-commit.sh
More file actions
executable file
·54 lines (48 loc) · 1.52 KB
/
Copy pathcreate-commit.sh
File metadata and controls
executable file
·54 lines (48 loc) · 1.52 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
51
52
53
54
#!/bin/bash
# Helper script for conventional commit messages
# Usage: ./create-commit.sh "type" "scope" "description"
# Example: ./create-commit.sh "feat" "parser" "add support for async functions"
set -e
if [ $# -lt 2 ]; then
echo "Usage: ./create-commit.sh <type> [scope] <description>"
echo ""
echo "Types:"
echo " feat - A new feature"
echo " fix - A bug fix"
echo " perf - Performance improvement"
echo " docs - Documentation changes"
echo " style - Code style changes"
echo " refactor - Code refactoring"
echo " test - Test changes"
echo " ci - CI/CD changes"
echo " chore - Build/dependencies/tooling"
echo ""
echo "Scopes:"
echo " parser, lsp, ast, diagnostics, formatter, completions, hover, definition, vscode, jetbrains"
echo ""
echo "Examples:"
echo " ./create-commit.sh feat parser 'add support for async functions'"
echo " ./create-commit.sh fix lsp 'prevent deadlock in symbol indexing'"
exit 1
fi
TYPE="$1"
# Determine if we have a scope
if [ $# -eq 2 ]; then
# No scope provided, description is the second argument
DESCRIPTION="$2"
MESSAGE="$TYPE: $DESCRIPTION"
else
# Scope provided
SCOPE="$2"
DESCRIPTION="$3"
MESSAGE="$TYPE($SCOPE): $DESCRIPTION"
fi
echo "Commit message:"
echo "$MESSAGE"
echo ""
echo "Stage changes with: git add <files>"
echo "Then commit with: git commit -m '$MESSAGE'"
echo ""
# Optional: Show what would be staged
echo "Current git status:"
git status --short