├── .gitignore ├── CHANGELOG.md ├── README.md ├── changelog.jpg ├── command ├── git-ci └── git-clog ├── config └── git-message-template ├── docs └── git-hooks.md ├── hooks └── commit-msg └── installer.sh /.gitignore: -------------------------------------------------------------------------------- 1 | out 2 | gen 3 | .idea -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # git-toolkit-1.1.1 2 | 3 | #### [Tony Deng ](wolf.deng@gmail.com) (6) 4 | 5 | * :sparkles: feat(1.1.1): 添加git alias (2018-01-17 17:32:21) [view commit f18389f](https://github.com/tonydeng/git-toolkit/commit/f18389f) 6 | * :bug:fix(1.1.1): 修复在merge、maven plugin、revert等操作提交时自动生成的commit message保存失败的问题 (2017-10-29 23:34:54) [view commit a526cb5](https://github.com/tonydeng/git-toolkit/commit/a526cb5) 7 | * :bug:fix(1.1.1): 修复git hook脚本以及message template中的内容 (2017-10-20 16:30:12) [view commit 550208e](https://github.com/tonydeng/git-toolkit/commit/550208e) 8 | * :memo: docs(1.1.1): 安装说明以及git ci命令交互说明修改 (2017-10-20 15:54:38) [view commit 9185a73](https://github.com/tonydeng/git-toolkit/commit/9185a73) 9 | * :wrench: chore(1.1.1): 修改安装时下载的项目url (2017-10-20 15:52:32) [view commit 55d2784](https://github.com/tonydeng/git-toolkit/commit/55d2784) 10 | 11 | # git-toolkit-1.1 12 | 13 | #### [Tony Deng ](wolf.deng@gmail.com) (15) 14 | 15 | * fix(1.1): 解决clog没有安装问题;去掉array自定义模块,避免出现软连接时无法找到module的问题 (2017-04-25 15:41:00) [view commit 2850d9c](https://github.com/tonydeng/git-toolkit/commit/2850d9c) 16 | * docs(1.1): 补全clog的README文档 (2017-04-25 15:24:57) [view commit aff7ee7](https://github.com/tonydeng/git-toolkit/commit/aff7ee7) 17 | * docs(1.1): 添加changelog.md (2017-04-25 15:17:25) [view commit b36c1a2](https://github.com/tonydeng/git-toolkit/commit/b36c1a2) 18 | * chore(1.1): 调整相关注释和方法调用顺序 (2017-04-25 15:07:07) [view commit 7ced562](https://github.com/tonydeng/git-toolkit/commit/7ced562) 19 | * fix(1.1): 解决当项目版本中有多个"-"符号之后出现的无法输出日志的问题 (2017-04-25 14:40:23) [view commit 0d10dc0](https://github.com/tonydeng/git-toolkit/commit/0d10dc0) 20 | * chore(1.1): 删除不需要的目录 (2017-04-25 12:54:02) [view commit 664d115](https://github.com/tonydeng/git-toolkit/commit/664d115) 21 | * feat(1.1): 完成changelog的基本功能 (2017-04-25 12:47:42) [view commit 3144cb7](https://github.com/tonydeng/git-toolkit/commit/3144cb7) 22 | * feat(1.1): 解决获取作者时的无法构建正常数组的问题 (2017-04-24 19:13:35) [view commit 1965591](https://github.com/tonydeng/git-toolkit/commit/1965591) 23 | * feat(1.1): 完成版本和作者的数组组装,以及输出基本的日志 (2017-04-22 00:22:38) [view commit a0a667c](https://github.com/tonydeng/git-toolkit/commit/a0a667c) 24 | * feat(1.1): 添加版本验证功能,添加获取版本列表、作者列表等功能 (2017-04-21 12:23:12) [view commit bae5654](https://github.com/tonydeng/git-toolkit/commit/bae5654) 25 | * feat(1.1): 添加数组倒序功能,并且加入模块化编程概念 (2017-04-20 12:10:26) [view commit 97d1ffc](https://github.com/tonydeng/git-toolkit/commit/97d1ffc) 26 | * feat(1.0): 添加获取作者的方法 (2017-04-19 18:36:03) [view commit dec31cb](https://github.com/tonydeng/git-toolkit/commit/dec31cb) 27 | * feat(1.1): 添加clog命令 (2017-04-19 15:11:00) [view commit 289e08f](https://github.com/tonydeng/git-toolkit/commit/289e08f) 28 | * feat(1.0.3): 调整仓库地址为cimhealth (2016-12-27 19:08:09) [view commit 1449c5d](https://github.com/tonydeng/git-toolkit/commit/1449c5d) 29 | * fix(1.0.3): 调整可输入commit message字符长度 (2016-12-06 15:04:43) [view commit 8652769](https://github.com/tonydeng/git-toolkit/commit/8652769) 30 | 31 | #### [dinghao2020 ](18001326539@163.com) (3) 32 | 33 | * 修复逻辑执行错误 (2017-02-16 11:58:20) [view commit b19ff0e](https://github.com/tonydeng/git-toolkit/commit/b19ff0e) 34 | * fix install on linux (2017-02-16 10:45:35) [view commit 8125553](https://github.com/tonydeng/git-toolkit/commit/8125553) 35 | * Update installer.sh (2017-02-15 23:42:16) [view commit 05caa40](https://github.com/tonydeng/git-toolkit/commit/05caa40) 36 | 37 | # git-toolkit-1.0.2 38 | 39 | 40 | #### [Tony Deng ](wolf.deng@gmail.com) (14) 41 | 42 | * feat(1.0.2): 多个安装目录的检测和执行 (2016-12-05 15:26:00) [view commit 072d10e](https://github.com/tonydeng/git-toolkit/commit/072d10e) 43 | * fix(1.0.2): 修复update输出异常问题 (2016-12-05 11:04:44) [view commit 19b1831](https://github.com/tonydeng/git-toolkit/commit/19b1831) 44 | * docs(1.0.2): 解决windows安装文档问题 (2016-12-02 18:32:08) [view commit 5999605](https://github.com/tonydeng/git-toolkit/commit/5999605) 45 | * fix(1.0.2): 修复commit-msg的shellcheck的警告 (2016-12-02 14:26:36) [view commit b0a7eb7](https://github.com/tonydeng/git-toolkit/commit/b0a7eb7) 46 | * fix(1.0.2): 修改installer.sh的一些容易出现漏洞的语法 (2016-12-02 14:17:23) [view commit 84d892b](https://github.com/tonydeng/git-toolkit/commit/84d892b) 47 | * fix(1.0.2): 修复shellcheck的两个警告 (2016-12-01 18:48:19) [view commit 8901f37](https://github.com/tonydeng/git-toolkit/commit/8901f37) 48 | * fix(1.0.1): 修复提交出现的异常 (2016-10-26 13:26:08) [view commit bc16d44](https://github.com/tonydeng/git-toolkit/commit/bc16d44) 49 | * refactor(1.0): 去掉不需要的变量 (2016-09-29 19:32:49) [view commit 80ef9a4](https://github.com/tonydeng/git-toolkit/commit/80ef9a4) 50 | * fix(1.0): 解决没有githb账号无法clone的问题 (2016-09-29 16:50:11) [view commit 9841e6b](https://github.com/tonydeng/git-toolkit/commit/9841e6b) 51 | * chore(1.0): 关闭调试 (2016-09-29 15:07:00) [view commit 5956c1a](https://github.com/tonydeng/git-toolkit/commit/5956c1a) 52 | * docs(1.0.2): 解决windows安装文档问题 (2016-12-02 18:32:08) [view commit a0bbf9e](https://github.com/tonydeng/git-toolkit/commit/a0bbf9e) 53 | * fix(1.0.1): 修复commit-msg的shellcheck的警告 (2016-12-02 14:26:36) [view commit 09be38e](https://github.com/tonydeng/git-toolkit/commit/09be38e) 54 | * fix(1.0.1): 修改installer.sh的一些容易出现漏洞的语法 (2016-12-02 14:17:23) [view commit 70454f6](https://github.com/tonydeng/git-toolkit/commit/70454f6) 55 | * fix(1.0.1): 修复shellcheck的两个警告 (2016-12-01 18:48:19) [view commit 2282ac8](https://github.com/tonydeng/git-toolkit/commit/2282ac8) 56 | 57 | # git-toolkit-1.0.1 58 | 59 | 60 | #### [Tony Deng ](wolf.deng@gmail.com) (1) 61 | 62 | * fix(1.0.1): 修复提交出现的异常 (2016-10-26 13:26:08) [view commit 746286e](https://github.com/tonydeng/git-toolkit/commit/746286e) 63 | 64 | # git-toolkit-1.0 65 | 66 | 67 | #### [Tony Deng ](wolf.deng@gmail.com) (31) 68 | 69 | * refactor(1.0): 去掉不需要的变量 (2016-09-29 19:32:49) [view commit 1765849](https://github.com/tonydeng/git-toolkit/commit/1765849) 70 | * fix(1.0): 解决没有githb账号无法clone的问题 (2016-09-29 16:50:11) [view commit c4128db](https://github.com/tonydeng/git-toolkit/commit/c4128db) 71 | * chore(1.0): 关闭调试 (2016-09-29 15:07:00) [view commit e37f334](https://github.com/tonydeng/git-toolkit/commit/e37f334) 72 | * feat(1.0): 加入readline (2016-09-29 15:05:14) [view commit e257bb8](https://github.com/tonydeng/git-toolkit/commit/e257bb8) 73 | * docs(1.0): 添加git toolkit update说明 (2016-09-29 13:38:05) [view commit 1d905eb](https://github.com/tonydeng/git-toolkit/commit/1d905eb) 74 | * backlog(1.0): 添加update方法 (2016-09-29 13:36:14) [view commit 8c4b5c8](https://github.com/tonydeng/git-toolkit/commit/8c4b5c8) 75 | * fix(1.0): 解决git项目验证问题 (2016-09-29 13:30:22) [view commit f7faa01](https://github.com/tonydeng/git-toolkit/commit/f7faa01) 76 | * feat(1.0): 设置运行时的LOCALE相关变量 (2016-09-29 09:30:40) [view commit 2661db8](https://github.com/tonydeng/git-toolkit/commit/2661db8) 77 | * feat(1.0): 初始化设置 (2016-09-28 16:41:16) [view commit 1ea8ee6](https://github.com/tonydeng/git-toolkit/commit/1ea8ee6) 78 | * docs(1.0): hook文档 (2016-09-28 15:40:45) [view commit 3a53f49](https://github.com/tonydeng/git-toolkit/commit/3a53f49) 79 | * feat(1.0): 添加管理命令 (2016-09-27 18:52:19) [view commit effca54](https://github.com/tonydeng/git-toolkit/commit/effca54) 80 | * fix(1.0): 修install脚本的问题 (2016-09-27 18:00:10) [view commit e8c865a](https://github.com/tonydeng/git-toolkit/commit/e8c865a) 81 | * feat(1.0): git ci命令脚本结构 (2016-09-26 23:39:55) [view commit f53688d](https://github.com/tonydeng/git-toolkit/commit/f53688d) 82 | * refactor(1.0): 去掉不需要的变量 (2016-09-29 19:32:49) [view commit 8d001ac](https://github.com/tonydeng/git-toolkit/commit/8d001ac) 83 | * fix(1.0): 解决没有githb账号无法clone的问题 (2016-09-29 16:50:11) [view commit c2e36fd](https://github.com/tonydeng/git-toolkit/commit/c2e36fd) 84 | * chore(1.0): 关闭调试 (2016-09-29 15:07:00) [view commit 105992a](https://github.com/tonydeng/git-toolkit/commit/105992a) 85 | * feat(1.0): 加入readline (2016-09-29 15:05:14) [view commit e7ea686](https://github.com/tonydeng/git-toolkit/commit/e7ea686) 86 | * docs(1.0): 添加git toolkit update说明 (2016-09-29 13:38:05) [view commit 58e8314](https://github.com/tonydeng/git-toolkit/commit/58e8314) 87 | * backlog(1.0): 添加update方法 (2016-09-29 13:36:14) [view commit 3091d6e](https://github.com/tonydeng/git-toolkit/commit/3091d6e) 88 | * fix(1.0): 解决git项目验证问题 (2016-09-29 13:30:22) [view commit 1401354](https://github.com/tonydeng/git-toolkit/commit/1401354) 89 | * feat(1.0): 设置运行时的LOCALE相关变量 (2016-09-29 09:30:40) [view commit 9011c0b](https://github.com/tonydeng/git-toolkit/commit/9011c0b) 90 | * feat(1.0): 初始化设置 (2016-09-28 16:41:16) [view commit 83758ab](https://github.com/tonydeng/git-toolkit/commit/83758ab) 91 | * docs(1.0): hook文档 (2016-09-28 15:40:45) [view commit 49f17b7](https://github.com/tonydeng/git-toolkit/commit/49f17b7) 92 | * feat(1.0): 添加管理命令 (2016-09-27 18:52:19) [view commit ac8175e](https://github.com/tonydeng/git-toolkit/commit/ac8175e) 93 | * fix(1.0): 修install脚本的问题 (2016-09-27 18:00:10) [view commit 47020d5](https://github.com/tonydeng/git-toolkit/commit/47020d5) 94 | * feat(调整git ci命令脚本结构): git ci脚本结构调整,改成都是多个方法调用;installer脚本更新 (2016-09-26 23:39:55) [view commit 1f076f9](https://github.com/tonydeng/git-toolkit/commit/1f076f9) 95 | * feat(1.0): 安装文档 (2016-09-26 19:41:52) [view commit 8b2cfe5](https://github.com/tonydeng/git-toolkit/commit/8b2cfe5) 96 | * feat(1.0): 基本的安装流程 (2016-09-26 17:33:25) [view commit 919a6af](https://github.com/tonydeng/git-toolkit/commit/919a6af) 97 | * fix(1.0): 添加git conf模板 (2016-09-22 16:14:04) [view commit d648a32](https://github.com/tonydeng/git-toolkit/commit/d648a32) 98 | * feat(1.0): 添加基本的命令,hook脚本和模板 (2016-09-20 19:27:24) [view commit 08cb76b](https://github.com/tonydeng/git-toolkit/commit/08cb76b) 99 | * chore(1.0): 初始化项目 (2016-09-20 19:21:01) [view commit 96f74ca](https://github.com/tonydeng/git-toolkit/commit/96f74ca) 100 | 101 | # git-toolkit-1.1 102 | 103 | 104 | #### [Tony Deng ](wolf.deng@gmail.com) (15) 105 | 106 | * fix(1.1): 解决clog没有安装问题;去掉array自定义模块,避免出现软连接时无法找到module的问题 (2017-04-25 15:41:00) [view commit 2850d9c](https://github.com/tonydeng/git-toolkit/commit/2850d9c) 107 | * docs(1.1): 补全clog的README文档 (2017-04-25 15:24:57) [view commit aff7ee7](https://github.com/tonydeng/git-toolkit/commit/aff7ee7) 108 | * docs(1.1): 添加changelog.md (2017-04-25 15:17:25) [view commit b36c1a2](https://github.com/tonydeng/git-toolkit/commit/b36c1a2) 109 | * chore(1.1): 调整相关注释和方法调用顺序 (2017-04-25 15:07:07) [view commit 7ced562](https://github.com/tonydeng/git-toolkit/commit/7ced562) 110 | * fix(1.1): 解决当项目版本中有多个"-"符号之后出现的无法输出日志的问题 (2017-04-25 14:40:23) [view commit 0d10dc0](https://github.com/tonydeng/git-toolkit/commit/0d10dc0) 111 | * chore(1.1): 删除不需要的目录 (2017-04-25 12:54:02) [view commit 664d115](https://github.com/tonydeng/git-toolkit/commit/664d115) 112 | * feat(1.1): 完成changelog的基本功能 (2017-04-25 12:47:42) [view commit 3144cb7](https://github.com/tonydeng/git-toolkit/commit/3144cb7) 113 | * feat(1.1): 解决获取作者时的无法构建正常数组的问题 (2017-04-24 19:13:35) [view commit 1965591](https://github.com/tonydeng/git-toolkit/commit/1965591) 114 | * feat(1.1): 完成版本和作者的数组组装,以及输出基本的日志 (2017-04-22 00:22:38) [view commit a0a667c](https://github.com/tonydeng/git-toolkit/commit/a0a667c) 115 | * feat(1.1): 添加版本验证功能,添加获取版本列表、作者列表等功能 (2017-04-21 12:23:12) [view commit bae5654](https://github.com/tonydeng/git-toolkit/commit/bae5654) 116 | * feat(1.1): 添加数组倒序功能,并且加入模块化编程概念 (2017-04-20 12:10:26) [view commit 97d1ffc](https://github.com/tonydeng/git-toolkit/commit/97d1ffc) 117 | * feat(1.0): 添加获取作者的方法 (2017-04-19 18:36:03) [view commit dec31cb](https://github.com/tonydeng/git-toolkit/commit/dec31cb) 118 | * feat(1.1): 添加clog命令 (2017-04-19 15:11:00) [view commit 289e08f](https://github.com/tonydeng/git-toolkit/commit/289e08f) 119 | * feat(1.0.3): 调整仓库地址为cimhealth (2016-12-27 19:08:09) [view commit 1449c5d](https://github.com/tonydeng/git-toolkit/commit/1449c5d) 120 | * fix(1.0.3): 调整可输入commit message字符长度 (2016-12-06 15:04:43) [view commit 8652769](https://github.com/tonydeng/git-toolkit/commit/8652769) 121 | 122 | #### [dinghao2020 ](18001326539@163.com) (3) 123 | 124 | * 修复逻辑执行错误 (2017-02-16 11:58:20) [view commit b19ff0e](https://github.com/tonydeng/git-toolkit/commit/b19ff0e) 125 | * fix install on linux (2017-02-16 10:45:35) [view commit 8125553](https://github.com/tonydeng/git-toolkit/commit/8125553) 126 | * Update installer.sh (2017-02-15 23:42:16) [view commit 05caa40](https://github.com/tonydeng/git-toolkit/commit/05caa40) 127 | 128 | # git-toolkit-1.0.2 129 | 130 | 131 | #### [Tony Deng ](wolf.deng@gmail.com) (14) 132 | 133 | * feat(1.0.2): 多个安装目录的检测和执行 (2016-12-05 15:26:00) [view commit 072d10e](https://github.com/tonydeng/git-toolkit/commit/072d10e) 134 | * fix(1.0.2): 修复update输出异常问题 (2016-12-05 11:04:44) [view commit 19b1831](https://github.com/tonydeng/git-toolkit/commit/19b1831) 135 | * docs(1.0.2): 解决windows安装文档问题 (2016-12-02 18:32:08) [view commit 5999605](https://github.com/tonydeng/git-toolkit/commit/5999605) 136 | * fix(1.0.2): 修复commit-msg的shellcheck的警告 (2016-12-02 14:26:36) [view commit b0a7eb7](https://github.com/tonydeng/git-toolkit/commit/b0a7eb7) 137 | * fix(1.0.2): 修改installer.sh的一些容易出现漏洞的语法 (2016-12-02 14:17:23) [view commit 84d892b](https://github.com/tonydeng/git-toolkit/commit/84d892b) 138 | * fix(1.0.2): 修复shellcheck的两个警告 (2016-12-01 18:48:19) [view commit 8901f37](https://github.com/tonydeng/git-toolkit/commit/8901f37) 139 | * fix(1.0.1): 修复提交出现的异常 (2016-10-26 13:26:08) [view commit bc16d44](https://github.com/tonydeng/git-toolkit/commit/bc16d44) 140 | * refactor(1.0): 去掉不需要的变量 (2016-09-29 19:32:49) [view commit 80ef9a4](https://github.com/tonydeng/git-toolkit/commit/80ef9a4) 141 | * fix(1.0): 解决没有githb账号无法clone的问题 (2016-09-29 16:50:11) [view commit 9841e6b](https://github.com/tonydeng/git-toolkit/commit/9841e6b) 142 | * chore(1.0): 关闭调试 (2016-09-29 15:07:00) [view commit 5956c1a](https://github.com/tonydeng/git-toolkit/commit/5956c1a) 143 | * docs(1.0.2): 解决windows安装文档问题 (2016-12-02 18:32:08) [view commit a0bbf9e](https://github.com/tonydeng/git-toolkit/commit/a0bbf9e) 144 | * fix(1.0.1): 修复commit-msg的shellcheck的警告 (2016-12-02 14:26:36) [view commit 09be38e](https://github.com/tonydeng/git-toolkit/commit/09be38e) 145 | * fix(1.0.1): 修改installer.sh的一些容易出现漏洞的语法 (2016-12-02 14:17:23) [view commit 70454f6](https://github.com/tonydeng/git-toolkit/commit/70454f6) 146 | * fix(1.0.1): 修复shellcheck的两个警告 (2016-12-01 18:48:19) [view commit 2282ac8](https://github.com/tonydeng/git-toolkit/commit/2282ac8) 147 | 148 | # git-toolkit-1.0.1 149 | 150 | 151 | #### [Tony Deng ](wolf.deng@gmail.com) (1) 152 | 153 | * fix(1.0.1): 修复提交出现的异常 (2016-10-26 13:26:08) [view commit 746286e](https://github.com/tonydeng/git-toolkit/commit/746286e) 154 | 155 | # git-toolkit-1.0 156 | 157 | 158 | #### [Tony Deng ](wolf.deng@gmail.com) (31) 159 | 160 | * refactor(1.0): 去掉不需要的变量 (2016-09-29 19:32:49) [view commit 1765849](https://github.com/tonydeng/git-toolkit/commit/1765849) 161 | * fix(1.0): 解决没有githb账号无法clone的问题 (2016-09-29 16:50:11) [view commit c4128db](https://github.com/tonydeng/git-toolkit/commit/c4128db) 162 | * chore(1.0): 关闭调试 (2016-09-29 15:07:00) [view commit e37f334](https://github.com/tonydeng/git-toolkit/commit/e37f334) 163 | * feat(1.0): 加入readline (2016-09-29 15:05:14) [view commit e257bb8](https://github.com/tonydeng/git-toolkit/commit/e257bb8) 164 | * docs(1.0): 添加git toolkit update说明 (2016-09-29 13:38:05) [view commit 1d905eb](https://github.com/tonydeng/git-toolkit/commit/1d905eb) 165 | * backlog(1.0): 添加update方法 (2016-09-29 13:36:14) [view commit 8c4b5c8](https://github.com/tonydeng/git-toolkit/commit/8c4b5c8) 166 | * fix(1.0): 解决git项目验证问题 (2016-09-29 13:30:22) [view commit f7faa01](https://github.com/tonydeng/git-toolkit/commit/f7faa01) 167 | * feat(1.0): 设置运行时的LOCALE相关变量 (2016-09-29 09:30:40) [view commit 2661db8](https://github.com/tonydeng/git-toolkit/commit/2661db8) 168 | * feat(1.0): 初始化设置 (2016-09-28 16:41:16) [view commit 1ea8ee6](https://github.com/tonydeng/git-toolkit/commit/1ea8ee6) 169 | * docs(1.0): hook文档 (2016-09-28 15:40:45) [view commit 3a53f49](https://github.com/tonydeng/git-toolkit/commit/3a53f49) 170 | * feat(1.0): 添加管理命令 (2016-09-27 18:52:19) [view commit effca54](https://github.com/tonydeng/git-toolkit/commit/effca54) 171 | * fix(1.0): 修install脚本的问题 (2016-09-27 18:00:10) [view commit e8c865a](https://github.com/tonydeng/git-toolkit/commit/e8c865a) 172 | * feat(1.0): git ci命令脚本结构 (2016-09-26 23:39:55) [view commit f53688d](https://github.com/tonydeng/git-toolkit/commit/f53688d) 173 | * refactor(1.0): 去掉不需要的变量 (2016-09-29 19:32:49) [view commit 8d001ac](https://github.com/tonydeng/git-toolkit/commit/8d001ac) 174 | * fix(1.0): 解决没有githb账号无法clone的问题 (2016-09-29 16:50:11) [view commit c2e36fd](https://github.com/tonydeng/git-toolkit/commit/c2e36fd) 175 | * chore(1.0): 关闭调试 (2016-09-29 15:07:00) [view commit 105992a](https://github.com/tonydeng/git-toolkit/commit/105992a) 176 | * feat(1.0): 加入readline (2016-09-29 15:05:14) [view commit e7ea686](https://github.com/tonydeng/git-toolkit/commit/e7ea686) 177 | * docs(1.0): 添加git toolkit update说明 (2016-09-29 13:38:05) [view commit 58e8314](https://github.com/tonydeng/git-toolkit/commit/58e8314) 178 | * backlog(1.0): 添加update方法 (2016-09-29 13:36:14) [view commit 3091d6e](https://github.com/tonydeng/git-toolkit/commit/3091d6e) 179 | * fix(1.0): 解决git项目验证问题 (2016-09-29 13:30:22) [view commit 1401354](https://github.com/tonydeng/git-toolkit/commit/1401354) 180 | * feat(1.0): 设置运行时的LOCALE相关变量 (2016-09-29 09:30:40) [view commit 9011c0b](https://github.com/tonydeng/git-toolkit/commit/9011c0b) 181 | * feat(1.0): 初始化设置 (2016-09-28 16:41:16) [view commit 83758ab](https://github.com/tonydeng/git-toolkit/commit/83758ab) 182 | * docs(1.0): hook文档 (2016-09-28 15:40:45) [view commit 49f17b7](https://github.com/tonydeng/git-toolkit/commit/49f17b7) 183 | * feat(1.0): 添加管理命令 (2016-09-27 18:52:19) [view commit ac8175e](https://github.com/tonydeng/git-toolkit/commit/ac8175e) 184 | * fix(1.0): 修install脚本的问题 (2016-09-27 18:00:10) [view commit 47020d5](https://github.com/tonydeng/git-toolkit/commit/47020d5) 185 | * feat(调整git ci命令脚本结构): git ci脚本结构调整,改成都是多个方法调用;installer脚本更新 (2016-09-26 23:39:55) [view commit 1f076f9](https://github.com/tonydeng/git-toolkit/commit/1f076f9) 186 | * feat(1.0): 安装文档 (2016-09-26 19:41:52) [view commit 8b2cfe5](https://github.com/tonydeng/git-toolkit/commit/8b2cfe5) 187 | * feat(1.0): 基本的安装流程 (2016-09-26 17:33:25) [view commit 919a6af](https://github.com/tonydeng/git-toolkit/commit/919a6af) 188 | * fix(1.0): 添加git conf模板 (2016-09-22 16:14:04) [view commit d648a32](https://github.com/tonydeng/git-toolkit/commit/d648a32) 189 | * feat(1.0): 添加基本的命令,hook脚本和模板 (2016-09-20 19:27:24) [view commit 08cb76b](https://github.com/tonydeng/git-toolkit/commit/08cb76b) 190 | * chore(1.0): 初始化项目 (2016-09-20 19:21:01) [view commit 96f74ca](https://github.com/tonydeng/git-toolkit/commit/96f74ca) 191 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Git Toolkit 2 | 3 | 4 | > 人类懒惰的本性和不满足的本性是驱使科技发展的源泉...... 5 | 6 | ## 安装 7 | 8 | **使用curl** 9 | 10 | ```bash 11 | bash -c "$(curl -fsSL https://raw.githubusercontent.com/tonydeng/git-toolkit/master/installer.sh)" 12 | ``` 13 | 14 | **使用wget** 15 | 16 | ```bash 17 | bash -c "$(wget https://raw.githubusercontent.com/tonydeng/git-toolkit/master/installer.sh -O -)" 18 | ``` 19 | 20 | ## git toolkit介绍 21 | 22 | 本工具集包含几个部分,自定义命令,Hook脚本,以及配置模板 23 | 24 | ### 自定义命令 25 | 26 | #### git toolkit 27 | 28 | 提供本工具集的管理命令。 29 | 30 | **查看帮助** 31 | 32 | ```bash 33 | git toolkit help 34 | ``` 35 | 36 | **卸载本工具集** 37 | 38 | ```bash 39 | git toolkit uninstall 40 | ``` 41 | 42 | **更新本工具集** 43 | 44 | ```bash 45 | git toolkit update 46 | ``` 47 | 48 | #### git ci 49 | 50 | 提供交互式`git commit`的命令,用于定制统一`commit message`。 51 | 52 | > 用于替换[Commitizen](https://github.com/commitizen/cz-cli) 53 | 54 | ```bash 55 | git ci 56 | 57 | 选择您正在提交的类型: 58 | 1. feat: 新功能( Introducing new features ) 59 | 2. fix: 修补bug ( Fixing a bug ) 60 | 3. docs: 文档( Writing docs ) 61 | 4. style: 格式( Improving structure / format of the code ) 62 | 5. refactor: 重构( Refactoring code ) 63 | 6. test: 增加测试 ( Adding tests ) 64 | 7. chore: 构建过程或辅助工具的变动 ( Changing configuration files. ) 65 | 8. perf: 改善性能 ( Improving performance ) 66 | 0. quit: 退出 ( Exit ) 67 | ``` 68 | 69 | #### git clog 70 | 71 | 提供项目的`CHANGELOG`输出,支持输出到终端或指定文件中,可以使用`git clog -h`来查看帮助信息。 72 | 73 | 输出的格式大致如下,符合`Markdown`语法([查看样例](CHANGELOG.md)): 74 | 75 | ``` 76 | # tag 77 | 78 | #### [author](mailto:email) (commit_count) 79 | 80 | * commit message (commit date) [commit_short_sha1](commit_url) 81 | * commit message (commit date) [commit_short_sha1](commit_url) 82 | ``` 83 | 84 | 显示效果如下: 85 | 86 | ![git-toolkit changelog](changelog.jpg) 87 | 88 | ### Hook脚本 89 | 90 | #### commit-msg 91 | 92 | 用于验证每次提交的`commit message`是否符合规范,如果不符合规范,则提交不成功 93 | 94 | ### 配置 95 | 96 | #### git config --global commit.template 97 | 98 | 配置统一的`commit message`模板 99 | 100 | #### git config --global core.hooksPath 101 | 102 | 配置制定的Hook脚本的目录,使用本项目的git hook脚本 103 | -------------------------------------------------------------------------------- /changelog.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cimhealth/git-toolkit/e94e21e056f2f7f3bb4dbb68ec9003a6a83dea30/changelog.jpg -------------------------------------------------------------------------------- /command/git-ci: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | function init() { 3 | LOCALE=(LANG LC_COLLATE LC_CTYPE LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME LC_ALL) 4 | LANGUAGE="zh_CN.UTF-8" 5 | for l in "${LOCALE[@]}" ; do 6 | export "$l=$LANGUAGE" 7 | done 8 | TYPE=(":sparkles: feat" ":bug: fix" ":memo: docs" ":art: style" ":hammer: refactor" ":white_check_mark: test" ":wrench: chore" ":zap: perf") 9 | } 10 | 11 | # 验证当前是否为Git项目 12 | function verify { 13 | git rev-parse --show-toplevel > /dev/null 2>&1 14 | GIT_VERIFY=$? 15 | if test $GIT_VERIFY != 0; then 16 | >&2 echo "fatal: Not a git repository (or any of the parent directories): .git" 17 | exit $GIT_VERIFY 18 | fi 19 | } 20 | # 消息主体 21 | function mainMessage() { 22 | echo "选择您正在提交的类型: 23 | 1. feat: 新功能( Introducing new features ) 24 | 2. fix: 修补bug ( Fixing a bug ) 25 | 3. docs: 文档( Writing docs ) 26 | 4. style: 格式( Improving structure / format of the code ) 27 | 5. refactor: 重构( Refactoring code ) 28 | 6. test: 增加测试 ( Adding tests ) 29 | 7. chore: 构建过程或辅助工具的变动 ( Changing configuration files. ) 30 | 8. perf: 改善性能 ( Improving performance ) 31 | 0. quit: 退出 ( Exit ) 32 | " 33 | read -e -n 1 -p "请选择相关数字选项 [0-8]> " 34 | 35 | if [[ $REPLY =~ ^[0-8]$ ]]; then 36 | if [[ $REPLY == 0 ]]; then 37 | echo "退出本次提交" 38 | exit 39 | fi 40 | type=${TYPE[$REPLY-1]} 41 | else 42 | echo "无效的输入" >&2 43 | exit 1 44 | fi 45 | 46 | echo '本次提交的范围,建议填写版本号 ($version):' 47 | read -e scope 48 | echo 49 | echo "请添加简短的,必要的对本次提交的描述:" 50 | read -e subject 51 | echo 52 | echo "添加一个完整提交的描述:" 53 | IFS='' 54 | read -e body 55 | while : 56 | do 57 | read -e bodyLine 58 | if [ "$bodyLine" == "" ]; then 59 | break #终止循环. 60 | fi 61 | body="$body\n$bodyLine" 62 | done 63 | body="$(echo -e $body)" 64 | 65 | echo "列出本次提交解决的、可以关闭的所有相关问题,建议使用关键字 refs 、 close:" 66 | IFS=' ' 67 | read -e footer 68 | while : 69 | do 70 | read -e footerLine 71 | if [ "$footerLine" == "" ]; then 72 | break #终止循环. 73 | fi 74 | footer="$footer\n$footerLine" 75 | done 76 | footer="$(echo -e $footer)" 77 | echo 78 | } 79 | # 其他消息内容 80 | function otherMessage() { 81 | #add Signed off by 82 | SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') 83 | } 84 | # 构建消息 85 | function build() { 86 | if [ -z "$*" ]; then 87 | ALL="-a" 88 | else 89 | ALL=$* 90 | fi 91 | MSGFILE="`git rev-parse --git-dir`COMMIT-MSG.tmp" 92 | 93 | echo "$type($scope): $subject" > $MSGFILE 94 | echo "" >> $MSGFILE 95 | echo "$body" >> $MSGFILE 96 | echo "" >> $MSGFILE 97 | echo "$footer" >> $MSGFILE 98 | echo "" >> $MSGFILE 99 | echo "$SOB" >> $MSGFILE 100 | 101 | } 102 | # 执行提交 103 | function run() { 104 | GIT_COMMIT_CMD="git commit -F $MSGFILE $ALL" 105 | echo $GIT_COMMIT_CMD 106 | eval $GIT_COMMIT_CMD 107 | } 108 | # 清除临时文件 109 | function clean() { 110 | rm -f $MSGFILE 111 | } 112 | case $1 in 113 | *) 114 | init 115 | verify 116 | mainMessage 117 | otherMessage 118 | build "$@" 119 | run 120 | clean 121 | 122 | ;; 123 | esac -------------------------------------------------------------------------------- /command/git-clog: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ##### 3 | # Git Customization Changle Log Output 4 | ##### 5 | 6 | # clog命令传入的version参数 7 | _CURRENT_TAG="" 8 | # clog命令传入的output参数 9 | _OUTPUT="" 10 | 11 | # 远程仓库地址变量 12 | REMOTE_URL="" 13 | # 项目已有tag数组,如果存在,则以git tag输出的倒序存在 14 | # 数组中的值为| 15 | declare -a TAGS 16 | # 当前tag信息( ) 17 | declare -a CURRENT_TAG 18 | # 上一个tag信息( ) 19 | declare -a BEFORE_TAG 20 | # 当前命令执行的所有代码作者信息 (author (commit_count)) 21 | # 例如:Tony Deng (1) 22 | declare -a AUTHORS 23 | 24 | VERSION_PARAMETERS='' 25 | 26 | #### 27 | # changelog main方法 28 | #### 29 | function main() { 30 | verify_version 31 | get_all_tag 32 | verify_param "$@" 33 | get_remote_url 34 | all_log 35 | } 36 | ##### 37 | # 验证当前git的版本是否大于2.1 38 | ##### 39 | function verify_version() { 40 | version=(`git --version|awk -F ' ' '{print $3}'|cut -d '.' -f1 -f2`) 41 | t=`expr "$version" \>= '2.1'` 42 | if [[ "$t" -eq "0" ]]; then 43 | echo "The current Git version is less than 2.1, please upgrade to Git - 2.1 above" 44 | exit 1 45 | fi 46 | } 47 | ##### 48 | # 验证命令参数 49 | ##### 50 | function verify_param() { 51 | PARAM=("$@") 52 | i=0 53 | for p in "${PARAM[@]}"; do 54 | case $p in 55 | "-v"|"--vesion" ) 56 | if [[ -n "${PARAM[$i+1]}" ]]; then 57 | _CURRENT_TAG=${PARAM[$i+1]} 58 | # set_tag "${PARAM[$i+1]}" 59 | fi 60 | ;; 61 | "-o"|"--output" ) 62 | if [[ -n "${PARAM[$i+1]}" ]]; then 63 | _OUTPUT="${PARAM[$i+1]}" 64 | fi 65 | ;; 66 | esac 67 | let i++ 68 | done 69 | } 70 | 71 | ##### 72 | # 获取远程仓库地址 73 | ##### 74 | function get_remote_url() { 75 | if [[ -n "$1" ]]; then 76 | ORIGIN="$1" 77 | else 78 | ORIGIN=`git remote get-url origin` 79 | fi 80 | if [[ "$ORIGIN" == "https"* ]]; then 81 | REMOTE_URL="${ORIGIN%.*}" 82 | else 83 | REMOTE_URL=(`echo "$ORIGIN"|awk -F '[@:]' '{print "https://"$2"/"$3}'`) 84 | REMOTE_URL=("${REMOTE_URL%.*}") 85 | fi 86 | } 87 | ##### 88 | # 数组倒序排列 89 | ##### 90 | function _array_sort_desc() { 91 | arr=($@) 92 | for (( i=0, j=${#arr[*]} ; j>=0;i++,j-- )); do 93 | newarray[$i]=${arr[$j]}; 94 | done; 95 | echo "${newarray[*]}" 96 | } 97 | ##### 98 | # 获取当前所有tag 99 | ##### 100 | function get_all_tag() { 101 | i=0 102 | # git tag -l --sort="version:refname" 103 | for tag in `git for-each-ref --sort="version:refname" --format='%(objectname)|%(refname:short)' refs/tags/`; do 104 | tags[$i]="$tag" 105 | let i++ 106 | done 107 | TAGS=(`_array_sort_desc "${tags[*]}"`) 108 | unset tags 109 | unset i 110 | unset tag 111 | } 112 | ##### 113 | # 获取某个tag信息 114 | ##### 115 | function get_tag() { 116 | _t="$1" 117 | # 判断输入的版本信息是否包含项目名 118 | # if [[ $(echo "$1"|grep "-") != "" ]]; then 119 | if [[ "$1" == *"-"* ]]; then 120 | # _t=`echo $1|awk -F '-' '{print $2}'` 121 | _t=${_t##*-} 122 | fi 123 | for (( i=0; i<${#TAGS[*]};i++)); do 124 | # echo "$_t ${TAGS[$i]} ${TAGS[$i]##*-}" 125 | # if [[ "$_t" == "`echo ${TAGS[$i]}|awk -F '[|-]' '{print $3}'`" ]]; then 126 | if [[ "$_t" == "${TAGS[$i]##*-}" ]]; then 127 | tag[0]="$i" 128 | tag[1]="${TAGS[$i]%|*}" # tag commit_id_sha1 129 | tag[2]="${TAGS[$i]#*|}" # tag project_version 130 | tag[3]="${TAGS[$i]##*-}" # tag version 131 | # tag[1]=`echo ${TAGS[$i]}|awk -F '|' '{print $1}'` 132 | # tag[2]=`echo ${TAGS[$i]}|awk -F '|' '{print $2}'` 133 | # tag[3]=`echo ${TAGS[$i]}|awk -F '[|-]' '{print $3}'` 134 | fi 135 | done 136 | echo "${tag[*]}" 137 | } 138 | 139 | #### 140 | # 设置TAG相关的全局变量 141 | #### 142 | function set_tag() { 143 | # for (( i = 0; i < ${#TAGS[@]}; i++ )); do 144 | # echo ${TAGS[$i]} 145 | # done 146 | # get_tag "$1" 147 | CURRENT_TAG=(`get_tag "$1"`) 148 | _index="${CURRENT_TAG[0]}" 149 | let _index++ 150 | if [[ $_index < ${#TAGS[*]} ]]; then 151 | BEFORE_TAG=(`get_tag ${TAGS[$_index]}`) 152 | VERSION_PARAMETERS="${BEFORE_TAG[1]}..${CURRENT_TAG[1]}" 153 | else 154 | VERSION_PARAMETERS="${CURRENT_TAG[1]}" 155 | unset BEFORE_TAG 156 | fi 157 | } 158 | ##### 159 | # 获得所有提交者 160 | ##### 161 | function get_all_author() { 162 | # git shortlog -s -n -e --no-merges 85e76af9..3637d2b8 163 | _index=0 164 | while read _line; do 165 | AUTHORS[$_index]="`get_author "$_line"`" 166 | let _index++ 167 | done<” 这样的格式改成 "Tony Deng (751)" 173 | ### 174 | function get_author() { 175 | echo "$1"|awk '{for(i=2;i<=NF;i++)printf $i""FS;print "("$1")"}' 176 | } 177 | ### 178 | # 输出所有日志 179 | ### 180 | function all_log() { 181 | if [[ -n "$_CURRENT_TAG" ]]; then 182 | set_tag "$_CURRENT_TAG" 183 | simple_log 184 | else 185 | for tag in "${TAGS[@]}"; do 186 | set_tag "$tag" 187 | simple_log 188 | done 189 | fi 190 | 191 | } 192 | ##### 193 | # 直接输出日志到在终端 194 | ##### 195 | function simple_log() { 196 | get_all_author 197 | if [[ -n "$_OUTPUT" ]]; then 198 | echo "# ${CURRENT_TAG[2]}" >> "$_OUTPUT" 199 | echo "" >> "$_OUTPUT" 200 | echo "" >> "$_OUTPUT" 201 | else 202 | echo "# ${CURRENT_TAG[2]}" 203 | echo "" 204 | echo "" 205 | fi 206 | 207 | for a in "${AUTHORS[@]}"; do 208 | _author=`echo "$a"|awk -F '[<\>]' '{print $2}'` 209 | _author_output=`echo "$a"|awk -F '[<\>]' '{print "["$1"]("$2")"$3}'` 210 | _cmd="git log --author='${_author}' --no-merges $VERSION_PARAMETERS --pretty=format:'* %s (%ad) [view commit %h](${REMOTE_URL[*]}/commit/%h) ' --date=format:'%Y-%m-%d %H:%M:%S'" 211 | if [[ -n "$_OUTPUT" ]]; then 212 | echo "#### $_author_output" >> "$_OUTPUT" 213 | echo "" >> "$_OUTPUT" 214 | _cmd="$_cmd >> $_OUTPUT" 215 | # echo $"$_cmd" 216 | eval "$_cmd" 217 | echo "" >> "$_OUTPUT" 218 | echo "" >> "$_OUTPUT" 219 | else 220 | echo "#### $_author_output" 221 | echo "" 222 | # echo $"$_cmd" 223 | eval "$_cmd" 224 | echo "" 225 | echo "" 226 | fi 227 | unset _author 228 | unset _cmd 229 | done 230 | unset AUTHORS 231 | } 232 | ##### 233 | # 使用帮助 234 | ##### 235 | function help() { 236 | cat << EOF 237 | GIT-CLOG(1) 238 | 239 | NAME 240 | git-clog - Git Change Logs Output 241 | 242 | SYNOPSIS 243 | git clog [] [] [[--] ...] 244 | 245 | DESCRIPTION 246 | Summarizes git log output in a format suitable for inclusion in release announcements. Each commit will be grouped by author and title. 247 | 248 | OPTIONS 249 | -o, --output 250 | The changelog output to a file. 251 | -v, --version 252 | Specify the output one version. 253 | -h, --help 254 | Prints the synopsis and a list of the most commonly used commands. 255 | EOF 256 | } 257 | case $1 in 258 | "-h" | "--help") 259 | help 260 | ;; 261 | * ) 262 | main "$@" 263 | exit 264 | ;; 265 | esac 266 | -------------------------------------------------------------------------------- /config/git-message-template: -------------------------------------------------------------------------------- 1 | type(): 2 | 3 | 4 | 5 |