Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

CohleRustW/N_Commit_Tool

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

N Commit Tool

本工具用于 GitHub 开源仓库开发者,开发过程中交互式选择并创建本地开发分支,并通过对应 Issue ID 的描述信息完成 commit message 拼接

工具目录

mac os 已编译测试版本二进制到目录 examples/ncommit

  1. 使用方式1:追加以上函数到 .bashrc or .zsh_profile
 function ncommit () {
     /Users/......./ncommit $@
 }
  1. 方式2:放置工具在路径 /usr/local/bin目录下

  2. 你可以自行编译

  • 安装 rustcurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
  • 同步仓库到本地: git clone
  • 编译: cargo build --release 就能在 target/release 目录中拿到对应二进制
  • windows 编译参数: cargo build --release --target x86_64-pc-windows-gnu

依赖步骤

  1. 依赖开源工具 gh, 需要提前安装并且完成鉴权
  2. 新增配置文件ncommit.yml/etc/目录下,根据项目需求自行配置
 ---
# git remote name on working directory
 remote_name: origin

# 通过本地分支名称提取对应的 Issue ID, 用于关联 Issue, 例如 test_issue#1111, 支持正则表达式
 dev_issue_re: .*issue#?(\d+).*

# 是否开启自动 fetch 远程分支
 enable_auto_fetch: true

# 版本比较正则,用于提取符合正则规则的最大版本号来创建 dev branch
 version_compare_re: v(\d{1,2}\.\d{1,2}\.\d{1,2})-dev

# Issue title 正则, 用于匹配 Issue title, Like: [BUG] xxxxx
 issue_title_filter_re: \[(.*)\](.*)

# 本地分支名创建规则,自动追加 Issue ID在分支名称后面
 dev_issue_name_header: dev_issue#

# 是否启动节点管理 commit message append, 默认关闭
 commit_append_nodeman_msg: false

# 节点管理 commit message append 规则
 commit_append_msg: (wf -l)

# github work flow link commit description Like:fixed close closed
 commit_link_description: closed

 # 在拉取远程分支选出最新版本号后,用于拼接远程分支名称模板, {{ number }} 为版本号关键词, 目的是解决远程分支规则的变更
remote_branch_name_template: v{{ number }}-dev
安装步骤
  1. brew install gh
  2. gh登录鉴权

支持参数

  1. 直接执行ncommit -> git commit -m "bugfix: Test Issue (closed #4)(wf -l)" 参考: (issue#4)[#4]
  2. -p打印 git commit 提交信息
  3. -m test message 自定义提交内容 git commit -m "bugfix: test message (closed #3)(wf -l)"
  4. -w 浏览器打开仓库Issue页面 gh issue list --web
  5. -n 命令行交互式选择ISSUES,根据规则的最大版本号分支,创建新的开发分支,交互方式如图

企业微信截图_f403a8f5-7b97-4c7b-8617-e5ebc190e81c

  1. -n -c, 命令行交互式选择ISSUES, 并且 fetch origin 分支, 交互式选择新增 dev 分支对应的 base branch

image

Q&A

  1. MAC OS会报错开发者异常,只要在访达中打开一次就行

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.