Skip to content

Commit

Permalink
release 7.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
saqqdy committed Jun 18, 2024
1 parent 43921c2 commit b53bcf3
Show file tree
Hide file tree
Showing 18 changed files with 468 additions and 276 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# 更新日志

## 2024.06.18 v7.1.0

1. 增加`--push`传值,是否在copy之后推送目标分支到远程

## 2024.05.10 v7.0.1

1. 修复版本控制BUG
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@gitmars/monorepo",
"description": "这是一个git工作流工具",
"version": "7.0.1",
"version": "7.1.0",
"packageManager": "[email protected]",
"main": "index.js",
"files": [
Expand Down
2 changes: 1 addition & 1 deletion packages/api/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@gitmars/api",
"description": "gitmars api",
"version": "7.0.0-beta.34",
"version": "7.1.0",
"private": false,
"main": "./dist/index.cjs.js",
"module": "./dist/index.esm-bundler.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/build/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@gitmars/build",
"description": "gitmars build",
"version": "7.0.0-beta.34",
"version": "7.1.0",
"private": false,
"main": "./dist/index.cjs.js",
"module": "./dist/index.esm-bundler.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/cache/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@gitmars/cache",
"description": "gitmars cache",
"version": "7.0.0-beta.34",
"version": "7.1.0",
"private": false,
"main": "./dist/index.cjs.js",
"module": "./dist/index.esm-bundler.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@gitmars/core",
"description": "gitmars核心程序",
"version": "7.0.0-beta.34",
"version": "7.1.0",
"private": false,
"main": "./dist/index.cjs.js",
"module": "./dist/index.esm-bundler.js",
Expand Down
4 changes: 3 additions & 1 deletion packages/docs/api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -421,10 +421,11 @@ gitm ct -l
#### 短指令:gitm cp

> v4.0.0 重构指令,改造成自选提交记录的方式
> v7.1.0 增加`--push`传值,是否在copy之后推送目标分支到远程
复制当前分支上的提交记录到目标分支

- 使用:`gitm copy [commitid...]` 或者 `gitm copy [--lastet [lastet]] [--limit [limit]] [--no-merges]`
- 使用:`gitm copy [commitid...]` 或者 `gitm copy [--lastet [lastet]] [--limit [limit]] [--no-merges] [-p -push]`
- 参数:

<div class="table-prop">
Expand All @@ -444,6 +445,7 @@ gitm ct -l
| --no-merge | - | 排除 merge 记录 | `Boolean` | - || `false` |
| --lastet | - | 查询在某个时间之后的日志,填写格式:10s/2m/2h/3d/4M/5y | `String` | - || '7d' |
| --limit | - | 最多查询的日志条数 | `Number` | - || 20 |
| --push | -p | 推送目标分支到远程 | `boolean` | - || `false` |

</div>

Expand Down
4 changes: 4 additions & 0 deletions packages/docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# 更新日志

## 2024.06.18 v7.1.0

1. 增加`--push`传值,是否在copy之后推送目标分支到远程

## 2024.05.10 v7.0.1

1. 修复版本控制BUG
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@gitmars/docs",
"description": "gitmars文档库",
"version": "7.0.0-beta.34",
"version": "7.1.0",
"private": false,
"files": [
"dist",
Expand Down
2 changes: 1 addition & 1 deletion packages/git/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@gitmars/git",
"description": "gitmars git",
"version": "7.0.0-beta.34",
"version": "7.1.0",
"private": false,
"main": "./dist/index.cjs.js",
"module": "./dist/index.esm-bundler.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/gitmars/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "gitmars",
"description": "这是一个git工作流工具",
"type": "module",
"version": "7.0.0-beta.34",
"version": "7.1.0",
"private": false,
"bin": {
"gitm": "lib/gitm.mjs"
Expand Down
12 changes: 12 additions & 0 deletions packages/gitmars/src/conf/copy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,18 @@ export const cmdConfig: GitmarsOptionType = {
negate: false,
description: t('The maximum number of logs to be queried'),
defaultValue: ''
},
{
flags: '-p, --push',
required: false,
optional: false,
variadic: false,
mandatory: false,
short: '-p',
long: '--push',
negate: false,
description: t('Push target branch'),
recommend: false
}
],
// validator opts
Expand Down
10 changes: 7 additions & 3 deletions packages/gitmars/src/gitm-copy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,15 @@ interface GitmCopyOption {
merges: boolean
lastet: string
limit: number
push: boolean
}

/**
* gitm copy
*/
program
.name('gitm copy')
.usage('[commitid...] [--lastet [lastet]] [--limit [limit]] [--no-merges]')
.usage('[commitid...] [--lastet [lastet]] [--limit [limit]] [--no-merges] [-p --push]')
.description(
t(
'cherry-pick batch version, copy a record from a branch and merge it into the current branch'
Expand All @@ -55,6 +56,7 @@ options.forEach((o: GitmarsOptionOptionsType) => {
// .option('--no-merges', t('Whether to exclude merge's log'), false)
// .option('--lastet [lastet]', t('Query logs after a certain time, fill in the format: 10s/2m/2h/3d/4M/5y'), '')
// .option('--limit [limit]', t('The maximum number of logs to be queried'))
// .option('-p --push', t('Push target branch'))
program.action(async (commitid: string[], opts: GitmCopyOption) => {
const keys: GitLogKeysType[] = ['%H', '%T', '%P', '%aI', '%an', '%s', '%b']
const current = getCurrentBranch()
Expand Down Expand Up @@ -132,10 +134,12 @@ program.action(async (commitid: string[], opts: GitmCopyOption) => {
success: t('Record merge successful'),
fail: t('Merge failed, please follow the instructions')
}
},
`git checkout ${current}`
}
]

if (opts.push) cmd.push('git push')
cmd.push(`git checkout ${current}`)

// 执行
queue(cmd)
})
Expand Down
3 changes: 2 additions & 1 deletion packages/gitmars/src/locales/zh-CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -461,5 +461,6 @@ export default {
'Enter wechat account': '输入微信号',
'Implementation success': '执行成功',
'Select wechat account': '选择微信账号',
'Confirm unbind wechat account': '是否确认解绑体验者'
'Confirm unbind wechat account': '是否确认解绑体验者',
'Push target branch': '推送目标分支到远程'
}
2 changes: 1 addition & 1 deletion packages/go/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@gitmars/go",
"description": "gitmars go",
"version": "7.0.0-beta.34",
"version": "7.1.0",
"private": false,
"main": "./dist/index.cjs.js",
"module": "./dist/index.esm-bundler.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/hook/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@gitmars/hook",
"description": "gitmars hook",
"version": "7.0.0-beta.34",
"version": "7.1.0",
"private": false,
"main": "./dist/index.cjs.js",
"module": "./dist/index.esm-bundler.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@gitmars/utils",
"description": "gitmars utils",
"version": "7.0.0-beta.34",
"version": "7.1.0",
"private": false,
"main": "./dist/index.cjs.js",
"module": "./dist/index.esm-bundler.js",
Expand Down
Loading

0 comments on commit b53bcf3

Please sign in to comment.