commitizen / commitizen/cz-cli

Is it possible to get branch name in a adapter?

未关闭
#44 2 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看
adapter cli enhancement question
主要语言
JavaScript
星标
17.5k
派生
566
平均合并
8 小时 16 分钟
30 天内合并 PR
1

描述

Hi,

First of all, great project!

Is it possible to pass information about a branch (or some other git information) to an custom adapter?

I find this line: https://github.com/commitizen/cz-cli/blob/master/src/cli/strategies/git-cz.js#L59 where it looks like you are passing all arguments to `git`(?). Is it possible to parse the arguments and exclude `cz-cli`-specific arguments and pass them to a adapter?

Example:

```
$ git cz --author="Name " --cz-branch-name="$(git rev-parse --abbrev-ref HEAD)"
```

The command above should pass `--author` to `git commit` and `--cz-branch-name` to the adapter (because the argument starts with `--cz-`).

What do you think? Is this a good solution? Or is it a better way?

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。