What is it ?
This extension is an extension made to formalize git commit messages. By using a template and variables, you can define how the commit message needs to looks and which data you want in this message.
By example: When you want to specify a scope in your commits, you can create a variable named scope in th e template like this {scope}
If you want to specify which data you want in this scope variable, you can specify it with the variable settings
{
"scope": [
{
"label": "🟢 App"
},
{
"label": "🟠 Api"
},
{
"label": "🔵 Scripts"
}
]
}
I show you more on the #Settings part
toto
How to use it ?
Use ctrl+alt+enter (cmd+shift+enter on Mac) or click
on the icon in SouceControl
Settings
UI
An UI is available HERE, it's not the best UI but it can help you make your first configuration for the extension
Hosted on Netlify
Erase previous commit on new one (vscodeGitCommit.insertMode
)
{
"vscodeGitCommit.insertMode": "Concatenate"
}
'Concatenate' give the ability to use multiple message in the same commit where 'Replace' not
Create my own template message (vscodeGitCommit.template
)
{
"vscodeGitCommit.template": [
"{feat}({scope}): {message}"
"by {author}"
]
}
By defining one string, you create a line, with two strings like in the example, you define two line for the template.
You can define dynamic content by using { & } in doc, I called it a variable.
When triggering this extension, a value for each variable is prompt.
Use select or text for each variables (vscodeGitCommit.variables
)
{
"vscodeGitCommit.variables": {
"author": [
{
"label": "Devs",
"detail": "Use when a change is made by Developers"
},
{
"label": "Ops"
}
],
"feat": "keke"
}
}
For each variables defined in the template above, you can define the content:
- If not set -> Free string input
- If it's an Array -> A select of choices is displayed
- If it's a string three possibilities
- the value is oneOf 'keke' | 'angular' | 'semantic' | 'alpha8' -> A predefined Array is associated to the variable
- the value startWith 'files' -> An array of files with defined status is displayed as choices
- the value looks like '<>...<<something_else>>' -> a merge of array between the variable 'something' and 'something_else' is created as choices
If you write your own Array
- The 'detail' property is optionnal
- The 'label' property is used as the content include in template
- (For old users) The 'id' property is now automatically generated and not used anymore by the extension
If you want predefined choices
- 'keke' is the prefix I use personnally
- 'angular' is prefix specific to angular repos (HELP: if someone has a full config for angular commits, can you share it with me by creating a PR or Issue ?)
- 'alpha8' is prefix we used in the enterprise where I work
- 'semantic' is an other normalization of prefix but I lost the link associated :/
If you want to list files many possibilities are yours
- 'files': All staged and changed files
- 'files.deleted': All deleted staged and changed files
- 'files.modified': All modified staged and changed files
- 'files.added': All added staged and changed files
- 'files.staged': All staged files
- 'files.staged.deleted': All deleted staged files
- 'files.staged.modified': All modified staged files
- 'files.staged.added': All added staged files
- 'files.changed': All changed files
- 'files.changed.deleted': All deleted changed files
- 'files.changed.modified': All modified changed files
- 'files.changed.added': All added changed files
If you want to add branch name in commit, you can use this
'branch': Show you a select with the choice between short and long name for current branch
{
"vscodeGitCommit.defaultVariablesValues": {
"author": "@RIOU Kevin"
}
}
For each variables defined in the template not used in variables
setting, you can define a default value pretyped in the input
In the upside example, for the variable author
, the input is prefill with @RIOU Kevin
.
{
"vscodeGitCommit.variablesDisplayTitles": {
"author": "Fill the pseudo of the person commiting with an @"
}
}
For each variables prompt, you can define a default value pretyped in the input
In the upside example, for the variable author
, the input will show the title Fill the pseudo of the person commiting with an @
.
Contributing to the extension
Share configs
You can share the config you made for you by creating a pull request, in the folder 'share' you can find a Readme as a template and an example made by jycouet
Contributing to code base
You just have to create a pull-request 😉 with what you want and a clear description of the goal of your feature
Changelog
3.2.1 (Fix-3.2.0)
3.2.0 (01-30-2024)
- ✨feature: Trim messages when finished
- ✨feature: Ability to define titles on prompts
- ✨feature: Ability to define default values on prompts
3.1.1 (09-30-2022)
- ✨feature: Trim messages when finished
- ✨feature: Ability to define titles on prompts
- ✨feature: Ability to define default values on prompts
3.1.0 (08-05-2022)
- 🐞fix: update for vscode api change in 1.70 about repositories
3.0.2 (07-16-2022)
- ✨feature: ability to define default value for free text inputs
- ✨feature: add repo current branch in variables
3.0.1 (02-24-2022)
- 🐞fix: settings migration script fix from V3.0.0
third release with an UI O_o and a lot of new features (btw: we reached the 5k installs THX U ♥️)
3.0.0 (02-23-2022)
- ✨feature: use of information or error message as feedback
- ✨feature: update contributes.configuration $schema
- ✨feature: add an UI to generate settings (cf: this UI)
- ✨feature: add PR template
- ✨feature: add a folder for settings sharing between users
- ✨feature: add ability to search for files using predefined variable names
- 📄docs (docs): update docs globaly and make a web version
2.1.0 (05-06-2021)
- ✨feature: auto focus scm commit input on finish (cf: issues #10)
- ✨feature: add abilities to concatenate multiple variables in settings (cf: issues #11 & #12)
second release OH YEAHHH !!!!
2.0.0 (04-09-2021)
- ✨feature: add ability to use text input or select input for any variables
1.1.5 (12-18-2020)
- 📄docs (docs): update docs with animated gif
1.1.4 (11-06-2020)
- ✨feature: Handle multi repo case
1.1.3 (11-06-2020)
- 🐞fix: Update icon (cf: issues #4)
- 🐞fix: Handle cancel action when typing variables (cf: issues #5)
⚙️refactor: Refacto on extension command name
1.1.1 (10-20-2020)
- 🐞fix: Update icon (cf: issues #4)
1.1.0 (10-12-2020)
- ✨feat(workflow): Add abilities to create custom message format using simple brackets in settings, see doc
- ⚙️refactor(global): Refacto on major part of the code
- 🌈style(typescript/prettier): Pass into prettier + update ts rules
1.0.1 (09-30-2020)
- ✨feature: On demand, add based commitizen prefix for alpha8
- 🔵other: Change default mode to concatenate settings
First Release, I've done it !!
1.0.0 (09-21-2020)
- ✨feature: Replace icon with outlined
0.0.4 (09-15-2020)
- ✨feature: add a mode to concatenate message with existing or replace existing
- 🐞fix: focus on quickPick not on scm input box when triggering extension
0.0.3 (08-25-2020)
- ✨feature: V0.0.3 add prefix sets
0.0.2 (08-23-2020)
- ✨feature: Add custom prefix setting
- 🐞fix: Open SCM view when prefix selector is opened, not at the end of process
0.0.1 (08-18-2020)