The original

In the company, because everyone submits git-commit information at will, resulting in a strange style of submission, writing information is not clear, do not know the specific submission is to fix the bug? Add new features, change configuration files, or refactor some bad code. We can only guess by ourselves. Even if we submit the information, we may not know exactly what the purpose of this submission is because of a long time, and we can only look through the code in the submission record. In the long run, it is not conducive to product iteration and bug positioning.

Why write this plug-in

For this reason, we started looking for a more formal submission format, and the Angular Team’s Angular Team Commit Specification came to our attention:

<type>(<scope>): <subject>
<BLANK LINE>
<body>
<BLANK LINE>
<footer>
Copy the code

The clear display of information makes us think that this is what we are looking for! Fortunately, the IDEA used by the back-end Java team directly has ready-made plug-ins that can be used. Unfortunately, our front-end team uses Vscode uniformly. We have seen several plug-ins, but none of them meet our requirements. So I decided to write a plug-in that met the requirements for the team to use.

How to use

  1. First we need to goVscodePlug-in Market Search git-commit-pluginAnd install it.

2. After the installation, you can use the combination keyCommand + Shift + PBreathe outThe command lineAnd type instructionsshow git commit templateOr clickgitA small icon on the plug-in bar wakes up the plug-in interface.3. Select the corresponding one according to the meaning of the present submissiontypeType to writecommitinformation

conclusion

There were a few hicks in writing the plugin, and the official website documentation was a bit of a blur to find an API, but it was worth it to solve the problem in the end. If you think this project is helpful to you, don’t be stingy with your hand ✨ to this project star✨, your encouragement is the biggest support for the author! If you find a bug or have any points you want to improve, please also mention issue 😘 at the bottom of the project.

Updated on 30 March 2020

The community raised a lot of good issues, also raised a lot of PR, there are bug fixes, there are also some hope to join the function, in the 0.0.4 version of the update have been implemented and solved!

Update the content

✨ Feat

  • GitCommitPlugin.ShowEmoji: Configurable whether requiredEmojiPrefix, default istrue
    GitCommitPlugin.ShowEmoji:true 
    Copy the code
  • GitCommitPlugin.CustomCommitType: Supports customizationCommit TypePrefix, default isnull
    GitCommitPlugin.CustomCommitType:[
      "customTypeName"
    ] 
    Copy the code
  • GitCommitPlugin.MaxSubjectWords: Supports modification.SubjectThe default value is20
    GitCommitPlugin.MaxSubjectWords:20
    Copy the code

🐞 Bug Fix

  • issue #2
  • issue #8

Updated on 22 September 2020

✨ Feat

  • GitCommitPlugin.CustomCommitType: Supports customizationCommit TypePrefix, default isnull
    GitCommitPlugin.CustomCommitType:[
      "customTypeName"
    ]  or [
     {
         "label": "customTypeName"."detail": "customTypeDetail"}]Copy the code

🐞 Bug Fix

  • issue #17
  • issue #21
  • issue #23
  • issue #19