You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
prompt=f"""You need to generate a git commit message based on the following diff:
74
-
## Good git messages examples
75
-
- feat: Add type annotation to generate_commit_message function
76
-
- fix: Fix bug in generate_commit_message function
77
-
- docs: Update README.md
78
-
- feat: first commit
79
-
- style: Format code using black
80
-
- refactor: Refactor generate_commit_message function
81
-
- ci: Add GitHub Actions workflow for Python package release
82
-
- build: Update setup.py and add tests folder
83
-
67
+
prompt=f"""
68
+
# Git Commit Message Generator
69
+
You are a professional software developer tasked with generating standardized git commit messages based on given git diff content. Your job is to analyze the diff, understand the changes made, and produce a concise, informative commit message following the Conventional Commits specification.
70
+
71
+
## Input
72
+
You will receive a git diff output showing the differences between the current working directory and the last commit.
73
+
74
+
## Guidelines
75
+
Generate a conventional git commit message adhering to the following format and guidelines:
76
+
77
+
1. Start with a type prefix, followed by a colon and space. Common types include:
78
+
- feat: A new feature
79
+
- fix: A bug fix
80
+
- docs: Documentation only changes
81
+
- style: Changes that do not affect the meaning of the code
82
+
- refactor: A code change that neither fixes a bug nor adds a feature
83
+
- perf: A code change that improves performance
84
+
- test: Adding missing tests or correcting existing tests
85
+
- chore: Changes to the build process or auxiliary tools and libraries
86
+
2. After the type, provide a short, imperative summary of the change (not capitalized, no period at the end).
87
+
3. The entire first line (type + summary) should be no more than 50 characters.
88
+
4. After the first line, leave one blank line.
89
+
5. The body of the commit message should provide detailed explanations of the changes, wrapped at 72 characters.
90
+
6. Use markdown lists to organize multiple points if necessary.
91
+
7. Include any of the following information when applicable:
92
+
- Motivation for the change
93
+
- Contrast with previous behavior
94
+
- Side effects or other unintuitive consequences of the change
95
+
96
+
## Analysis Steps
97
+
1. Carefully read the git diff output, identifying changed files and specific code modifications.
98
+
2. Determine the primary purpose of the changes (e.g., adding a feature, fixing a bug, refactoring code, updating dependencies).
99
+
3. Analyze the scope and impact of the changes, determining if they affect multiple components or functionalities.
100
+
4. Consider how these changes impact the overall project or system functionality and performance.
101
+
102
+
## Notes
103
+
- Maintain a professional and objective tone, avoiding emotional or unnecessary descriptions.
104
+
- Ensure the commit message clearly communicates the purpose and impact of the changes.
105
+
- If the diff contains multiple unrelated changes, suggest splitting them into separate commits.
106
+
107
+
## Examples
108
+
- Good Example
109
+
110
+
```
111
+
feat: implement user registration
112
+
113
+
- Add registration form component
114
+
- Create API endpoint for user creation
115
+
- Implement email verification process
116
+
117
+
This feature allows new users to create accounts and verifies
118
+
their email addresses before activation. It includes proper
119
+
input validation and error handling.
120
+
```
121
+
reason: contain relevant detail of the changes, no just one line
122
+
123
+
- Bad Example
124
+
125
+
```
126
+
feat: add user registration
127
+
```
128
+
reason: only one line, need more detail based on guidelines
129
+
130
+
Please generate a conventional commit message based on the provided git diff, following the above guidelines.
131
+
132
+
## Provided Git Diff
84
133
\n{diff}
85
134
"""# noqa
86
135
87
-
ifnotfeedback:
88
-
# TODO optimize feedback logic
136
+
iffeedbackisnotNone:
89
137
prompt+=f"""
90
138
This is original git commit message, it's not good enough, please reflect the
0 commit comments