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?

貢獻指南

開啟貢獻指南

研究方向

從連結行中的 src/cli/strategies/git-cz.js 開始,追蹤命令引數如何傳遞至 git 和自訂 adapter。此 issue 需要定義引數傳遞設計;完成內容應包括讓 adapter 存取分支或其他 Git 中繼資料,同時不破壞 предназначенные for git commit 的引數。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
git, javascript
領域
cli, tooling
Issue 類型
功能
難度
5/5
預估耗時
一週以上
活躍度
停滯
描述清晰度
需要釐清
新手友好度
25/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。