GithubHelp home page GithubHelp logo

redjue / git-commit-plugin Goto Github PK

View Code? Open in Web Editor NEW
167.0 5.0 45.0 2.28 MB

Automatically generate git commit

Home Page: https://marketplace.visualstudio.com/items?itemName=redjue.git-commit-plugin

License: MIT License

TypeScript 100.00%
git vscode-extension commit specification hacktoberfest

git-commit-plugin's Introduction

Git Commit Plugin For VS Code

All Contributors

Automatically generate git commit messages

Visual Studio Marketplace Version Visual Studio Marketplace Downloads Visual Studio Marketplace Installs Visual Studio Marketplace Rating (Stars) Visual Studio Marketplace Rating GitHub contributors GitHub last commit GitHub

Requirements

  • VS Code 1.42.0 or higher.
  • VS Code's built-in Git plugin

Format

This extension follows the Angular Team Commit Specification, as follows:

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

See info on the fields below.

Type

Must be one of the following:

Type Description
feat A new feature
fix A bug fix
docs Documentation only changes
style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
refactor A code change that neither fixes a bug nor adds a feature
perf A code change that improves performance
test Adding missing or correcting existing tests
chore Changes to the build process or auxiliary tools and libraries such as documentation generation

Scope

The scope could be anything specifying place of the commit change. For example $location, $browser, $compile, $rootScope, ngHref, ngClick, ngView, etc...

You can use * when the change affects more than a single scope.

Subject

The subject contains succinct description of the change:

  • use the imperative, present tense: "change" not "changed" nor "changes"
  • don't capitalize first letter
  • no dot (.) at the end

Body

Just as in the subject, use the imperative, present tense: "change" not "changed" nor "changes". The body should include the motivation for the change and contrast this with previous behavior.

Footer

The footer should contain any information about Breaking Changes and is also the place to reference GitHub issues that this commit closes.

Breaking Changes should start with the word BREAKING CHANGE: with a space or two newlines. The rest of the commit message is then used for this.

A detailed explanation can be found in this document.

Quick Start

  1. Install the plugin
  2. Use the command shortcut showGitCommit to open the command window or Click the icon on the git plugin navigation bar open
  3. Enter the commit information, which automatically generates a commit message that conforms to the specification edit

Locale Support

The plugin will automatically switch the language description based on the vscode language environment.

Support Language

  • en-US as default
  • zh-CN
  • zh-HK
  • zh-TW
  • ja-JP

Settings Options

  • GitCommitPlugin.ShowEmoji: whether to show emoji, default true.
    {
      "GitCommitPlugin.ShowEmoji": true
    }
  • GitCommitPlugin.CustomCommitType: customize the commit type, default null.
    { 
      "GitCommitPlugin.CustomCommitType": [
        "customTypeName"
      ]
    }
    or
    [
       {
           // If there are duplicate keys, rewrite the config,otherwise add As a new configuration addition
           "key": "customTypeKey", 
           "label": "customTypeName",
           "detail": "customTypeDetail",
           "icon":"customIcon"
       }
    ]
  • GitCommitPlugin.MaxSubjectCharacters: customize the maximum number of words on the subject, default 20.
    {
      "GitCommitPlugin.MaxSubjectCharacters": 20
    }
  • GitCommitPlugin.FillSubjectWithCurrent: whether to fill the subject with the current commit message, default false.
    {
      "GitCommitPlugin.FillSubjectWithCurrent": false
    }
  • GitCommitPlugin.Template: customize the git commit template.
    {
      "GitCommitPlugin.Templates": [
        {
            "templateName": "Angular",
            "templateContent": "<icon><space><type>(<scope>):<space><subject><enter><body><enter><footer>"
        },
        {
            "templateName": "git-cz",
            "templateContent": "<type>(<scope>):<space><icon><space><subject><enter><body><enter><footer>",
             // Set as default commit template
            "default":true
        }
      ]
    }

License

Released under MIT by @RedJue.

Contributors ✨

Thanks goes to these wonderful people (emoji key):

白云苍狗
白云苍狗

💻
冷空气
冷空气

📖
Hancel Lin
Hancel Lin

💻
Keriy
Keriy

💻
Arthur Meyniel
Arthur Meyniel

💻
haryoiro
haryoiro

📖
Tom
Tom

📖
风过无痕
风过无痕

💻
whwnow
whwnow

💻
Michael Currin
Michael Currin

📖
odinsam
odinsam

💻
tys1128
tys1128

📖
mlzzen
mlzzen

💻
zeye
zeye

💻
Moeyua
Moeyua

💻

This project follows the all-contributors specification. Contributions of any kind welcome!

git-commit-plugin's People

Contributors

allcontributors[bot] avatar arthurmynl avatar dependabot[bot] avatar drblackbird avatar haryoiro avatar imlinhanchao avatar maluns avatar michaelcurrin avatar moeyua avatar odinsam avatar redjue avatar tiddler-7 avatar tys1128 avatar webwuyou avatar whwnow avatar yeze322 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

git-commit-plugin's Issues

gitk can`t work

I installed this plug and push some commits. Everything is going well. But "gitk" can`t work, how to deal with it?

emoji位置

能否提供选项把emoji的放冒号后面
类似下图这样
image
不然我用standard-version没法显示

无法自动填充vscode git commit消息栏

无论是只填Subject或是Subject Scope等二三者均填写,都无法在点选Complete后自动填充。
系统:Windows 11 21H2 22000.434
VSCode:1.63.2 (system setup)

Submitting '<Subject>' text exceeds 20 characters will clear the input box

Submitting text exceeds 20 chars will leave the input box and pop up an error message:
image
Users can acknowledge the issue but cannot recover their previous input content anymore.

Repro steps:

  1. Input something more than 20 characters in the <Subject> section
  2. Press Enter to submit it
  3. My input text disappeared and lost

Expected behavior:

  1. Need to keep the exceeded text and let user modify it until it's less than 20 chars
  2. It will be nice to have an indicator to know how many characters have been input

完成 commint修改后可不可以直接提交?

我发现两点可以优化的地方:

  1. 写完commit 信息之后 选择完成后不会自动提交 能自动提交会更方便.
  2. 写完一项可以自动把下一项未写的提为第一项 可以减少选择的时间 会更方便

一个问题:

  1. 使用这个插件如何强制验证 commit是否符合规则?

感谢,辛苦!

默认名字配置可编辑

feat这类默认配置的名字希望可以更具需要替换,因为更具公司开发规范,有些单词不一样,例如我们的就是feature,默认的无法隐藏,又怕其他人误点。

Englisch translation

Hi guys!

I love your plugin so far it is totally cool and helps a lot to write better commits. Would it be possible to have a english translation of the helper text? :-)

Thanks a lot!

remote host 上不能自动填充 commit

vscode: 1.43.2
git-commit-plugin: 0.0.4
remote development: 0.20.0

本地打开的 vscode 插件工作正常

使用 remote development 插件打开 remote host, 并安装 git-commit-plugin 插件, 不能自动填充 commit

希望能支持 remote development, vscode 在远程节点上工作的场景也比较多

什么时候使用?

在vscode中我修改文档后,git add .后使用吗?我选好type,scope,subject后点击complete没反应啊。git log没看到新的log。

1.0.9版本如何配置中文?

我的vscode是英文,1.0.9更新后git-commit描述也变成了英文,我尝试配置 "GitCommitPlugin.PreferredLanguage": "cn" 但没有生效,可以单独修改git-commit描述的语言吗?

取消输入仍被识别为已编辑

取消输入后取消输入后仍被识别为已编辑,会有👍

const inputMessageDetail = (_key: string | number) => {
    ...
    vscode.window.showInputBox(CommitInputType).then((value) => {
        const _value = value || '';
        message_config[_key] = _value;
       // 没有根据value是不是undefined来修改isEdit
        _detailType && (_detailType.isEdit = true);
       ...
    });
};

emoji和type之间添加空格

commitlint-config-gitmoji 校验commit格式的时候要求emoji和type之间有一个空白符,现在每次都需要手动加,希望能自动在emoji和type之间加一个空格。

详情换行显示的问题

看到文本描述,详情部分可换行显示,如果想在编辑框换行显示,需要敲哪个命令呢?

请问下默认默认能否将emoji放到type后面

首选大佬的插件非常好用,只是在配合自动生成changelog的工具时,由于插件会在type前面添加emoji,导致校验时会认为不符合angular的commit规范(规范里的type只是英文单词,不包括表情),就不能生成正常的changelog了。

请问下能否将默认模板的emoji放到type:后面,虽然楼主提供了配置Templates配置项,可以在templateContent中修改的位置,但是多人协作的时候,都要去修改vscode的配置就不太方便了,能否在项目里加个配置文件,优先取文件的配置,再取编辑器的配置,最后取默认配置,谢谢。

Request for adding to HacktoberFest Topic

Hacktoberfest is an annual event where individuals try to make open source contributions in month of October. Starting this year hacktoberfest will only count contributions to repositories in HacktoberFest Topic.

I would like to contribute to this project (specially making it work on vscode web). And I would really appreciate if you can add this project to the HacktoberFest Topic.

🌈 is not in the correct gitmoji list

husky > commit-msg
⧗ input: 🌈 style: 格式
✖ 🌈 is not in the correct gitmoji list, please check the emoji code on https://gitmoji.dev/. [start-with-gitmoji]

在 gitmoji 里面 style 的emoji 为 💄

项目配置使用 husky 配合 commitlint-config-gitmoji ,.commitlintrc.js规则:

module.exports = {
extends: ["gitmoji"],
};

样式优化

虽然我知道很多 git commit 工具都是图标放后面
但是这会因为 fix style 等单词字数不同而导致 图标不对齐。
image

如果图标放前面会不会更好看一点
image

模板的 Title 是否可以遵循中文输入 加入盘古之白 (中英文符号之间有空格 如上图)

<body>字段可否自定义模板

实际工作中,需要在中按照模板写入需求/bug相关的自测、步骤等信息,是否可以增加自定义的模板,这样填写的时候填对应项就可以了

<Subject> : no more than 20 words

when creating a commit, the wizard says :
: no more than 20 words

But in reality, it's no more than 20 characters.

Should just change the wizard spelling

英文单词计数不正确

当 subject 使用全英文的时候会出现单词计数不正确的情况,看起来像是按照单个字母来计数的

Symbol `&gt;` is not properly rendered

See the screenshot:

image

Seemingly, the &gt; should be rendered as >, VSCode version:

版本: 1.55.1 (system setup)
提交: 08a217c4d27a02a5bcde898fd7981bda5b49391b
日期: 2021-04-07T15:06:02.360Z
Electron: 11.3.0
Chrome: 87.0.4280.141
Node.js: 12.18.3
V8: 8.7.220.31-electron.0
OS: Windows_NT x64 10.0.19042

手动配置type字符格式

不知道能否手动配置文件,将:string的格式设置为[type]string呢?因工作需要,当前格式与默认git commit template有所出入,需要实现[feat] just for commit test类似的commit type格式,不知道是否支持手动配置或者修改?

问题请教

在scoped,subject等内容之后,点击complete,好像并没有commit消息,此时push并没有用

无法自动填充

vscode 打开多个仓库时,无法为一个仓库的 commit 进行填充;
当vscode中只保留一个仓库文件夹时可以正常填充。

Message怎么换行?

#12 有时候想在message中输入多行,如

 feat(xxx): 修复了以下内容:
- 内容1
- 内容2
- 内容3
- 内容4

目前的输入框好像不能很好进行这种换行方式?

希望适配同一工作区多个仓库的情况

情景如题。

首先,源代码管理中没有这个插件的按钮了。

第二,使用命令(ctrl+shift+p),进行创建的commit一直会在第一个仓库。即使光标在第二个仓库。

综上,使用起来有点不方便。

大佬 可以做个扩展配置 自定义模板吗?

我公司的提交格式

<type>: [<scope>] <subject>
<BLANK LINE>
<body>
<BLANK LINE>
<footer>

我自己的提交格式

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

我基于你的插件,在配置文件做了模板配置。如果可以,麻烦合并一下并更新一下插件。谢谢大佬!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.