|
| 1 | +--- |
| 2 | +description: Using git to commit current changes |
| 3 | +match: |
| 4 | + - commit |
| 5 | + - git commit |
| 6 | +--- |
| 7 | + |
| 8 | +Using git to commit current changes with the Commit Rule following these steps, and as fast as possible without any explanations. |
| 9 | + |
| 10 | +# Steps |
| 11 | + |
| 12 | +1. According to the staged changes existing or not, |
| 13 | + - If there are staged changes, read the staged changes using `git --no-pager diff --cached` |
| 14 | + - If there are not staged changes, read the changes in the current branch using `git --no-pager diff` |
| 15 | +2. According to the changes content, the changes may be committed with one or more commits. |
| 16 | +3. For each commit, generate a commit message using the Commit Rule. |
| 17 | +4. Commit the changes with the generated commit message. |
| 18 | + |
| 19 | +# Commit Rule |
| 20 | + |
| 21 | +Follow the commit message format: `<gitmoji> <scope?> <message>` |
| 22 | + |
| 23 | +## Format Structure |
| 24 | + |
| 25 | +- **gitmoji**: A required gitmoji indicating the type of change |
| 26 | +- **scope**: Optional module/area name (e.g., `gfx:`, `asset:`, `render_graph:`) |
| 27 | +- **message**: Descriptive commit message in present tense |
| 28 | + |
| 29 | +## Gitmoji Reference |
| 30 | + |
| 31 | +| Gitmoji | Code | Description | |
| 32 | +| ------- | --------------- | ---------------------------------- | |
| 33 | +| ✨ | `:sparkles:` | New feature | |
| 34 | +| 🐛 | `:bug:` | Bug fix | |
| 35 | +| ♻️ | `:recycle:` | Refactor / restructure code | |
| 36 | +| ⚡ | `:zap:` | Performance improvement | |
| 37 | +| ⬆️ | `:arrow_up:` | Upgrade dependencies | |
| 38 | +| 💚 | `:green_heart:` | Fix CI/build | |
| 39 | +| ✏️ | `:pencil2:` | Fix typo | |
| 40 | +| 🔧 | `:wrench:` | Configuration changes | |
| 41 | +| 📝 | `:memo:` | Documentation | |
| 42 | +| 🎨 | `:art:` | Improve structure / format of code | |
| 43 | +| 🔥 | `:fire:` | Remove code or files | |
| 44 | +| 🏗️ | `:building_construction:` | Architectural changes | |
| 45 | + |
| 46 | +## Examples |
| 47 | + |
| 48 | +- `✨ simple material viewer` |
| 49 | +- `🐛 fix uninitialized RT/DS on D3D12MA heaps with CREATE_NOT_ZEROED` |
| 50 | +- `♻️ modernize gfx: Vulkan submit2, std::ranges, scoped_lock; fix DX12 barriers` |
| 51 | +- `⬆️ update sdl2 to sdl3` |
| 52 | +- `♻️ refactor ecs interface` |
| 53 | +- `⚡ use GPU Upload Heap (DX12) and VK_EXT_host_image_copy (Vulkan) for resource init` |
| 54 | + |
| 55 | +## Rules |
| 56 | + |
| 57 | +1. Always start with an appropriate gitmoji |
| 58 | +2. Optionally include a scope prefix (e.g., `gfx:`, `asset:`) when the change affects a specific module |
| 59 | +3. Keep the message concise but descriptive |
| 60 | +4. Use present tense ("Add feature" not "Added feature") |
| 61 | +5. Lowercase the message (except proper nouns like API names, DX12, Vulkan, etc.) |
0 commit comments