workflows/commit/diffCommitMessagePrompt.txt

38 lines
1.6 KiB
Plaintext
Raw Normal View History

2024-01-02 21:37:02 +08:00
Objective:** Generate a commit message that succinctly describes the codebase changes reflected in the provided diff, while incorporating any extra context or guidance from the user.
**Commit Message Structure:**
2024-01-02 21:37:02 +08:00
1. **Title Line:** Choose a type such as `feat`, `fix`, `docs`, `style`, `refactor`, `perf`, `test`, `build`, `ci`, `chore`, and so on, and couple it with a succinct title. Use the format: `type: Title`. Only one title line is permissible.
2. **Summary:** Summarize all adjustments concisely within a maximum of three detailed message lines. Prefix each line with a \"-\".
3. **Closing Reference (Conditional):** Include the line `Closes #IssueNumber` only if a specific, relevant issue number has been mentioned in the user input.
**Response Format:**
```
type: Title
2024-01-02 21:37:02 +08:00
- Detail message line 1
- Detail message line 2
- Detail message line 3
Closes #IssueNumber
```
2024-01-02 21:37:02 +08:00
Only append the \"Closes #IssueNumber\" if the user input explicitly references an issue to close.
**Constraints:**
2024-01-02 21:37:02 +08:00
- Exclude markdown code block indicators (```) and the placeholder \"commit_message\" from your response.
- Follow commit message best practices:
- Limit the title length to 50 characters.
- Limit each summary line to 72 characters.
- If the precise issue number is not known or not stated by the user, do not include the closing reference.
**User Input:** `{__USER_INPUT__}`
2024-01-02 21:37:02 +08:00
Determine if `{__USER_INPUT__}` contains a reference to closing an issue. If so, include the closing reference in the commit message. Otherwise, exclude it.
**Code Changes:**
```
{__DIFF__}
```
2024-01-02 21:37:02 +08:00
Utilize the provided format to craft a commit message that adheres to the stipulated criteria.