1
0
Fork 0

Merging upstream version 0.15.1.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-11 18:42:23 +01:00
parent 86d5d7fe9f
commit 9cbf6c15e9
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
22 changed files with 1805 additions and 372 deletions

View file

@ -14,12 +14,12 @@
| | ____ | | | | | ___ |
| | \_ ) | | | | | ( ) |
| (___) |__) (___ | | | ) ( |
(_______)_______/ )_( |/ \| v0.12
(_______)_______/ )_( |/ \| v0.15
```
# Gita一个管理多个 git 库的命令行工具
这个工具有两个作用:
这个工具有两个功能:
- 并排显示多个库的状态信息,比如分支名,编辑状态,提交信息等
- 在任何目录下(批处理)代理执行 git 指令
@ -46,17 +46,34 @@
基础指令:
- `gita add <repo-path(s)>`: 添加库
- `gita add -a <repo-parent-path(s)>`:
- `gita add -b <bare-repo-path(s)>`:
- `gita add -m <main-repo-path(s)>`:
- `gita add -r <repo-parent-path(s)>`:
- `gita clone <config-file>`:
- `gita clone -p <config-file>`:
- `gita context`: 情境命令
- `gita context`: 显示当前的情境
- `gita context none`: 去除情境
- `gita context <group-name>`: 把情境设置成`group-name`, 之后所有的操作只作用到这个组里的库
- `gita color`:
- `gita color [ll]`:
- `gita color set <situation> <color>`:
- `gita flags`:
- `gita flags set <repo-name> <flags>`:
- `gita flags [ll]`:
- `gita freeze`:
- `gita group`: 组群命令
- `gita group add <repo-name(s)>`: 把库加入新的或者已经存在的组
- `gita group [ll]`: 显示已有的组和它们的库
- `gita group ls`: 显示已有的组名
- `gita group rename <group-name> <new-name>`: 改组名
- `gita group rm group(s): 删除组
- `gita group rmrepo -n <group-name>:
- `gita info`: 显示已用的和未用的信息项
- `gita info [ll]`
- `gita info add <info-item>`
- `gita info rm <info-item>`
- `gita ll`: 显示所有库的状态信息
- `gita ll <group-name>`: 显示一个组群中库的状态信息
- `gita ls`: 显示所有库的名字
@ -65,7 +82,7 @@
- `gita rm <repo-name(s)>`: 移除库(不会删除文件)
- `gita -v`: 显示版本号
库的路径存在`$XDG_CONFIG_HOME/gita/repo_path` (多半是`~/.config/gita/repo_path`)。
库的路径存在`$XDG_CONFIG_HOME/gita/repos.csv` (多半是`~/.config/gita/repos.csv`)。
代理执行的子命令有两种格式:
@ -150,11 +167,10 @@ comaster:
help: checkout the master branch
```
另一个自定义功能是针对`gita ll`展示的信息项。
`gita info`可以展示所有用到的和没用到的信息项,并且可以通过修改`$XDG_CONFIG_HOME/gita/info.yml`支持自定义。举个栗子,默认的信息项显示配置相当于是:
`gita info`可以展示所有用到的和没用到的信息项,并且可以通过修改`$XDG_CONFIG_HOME/gita/info.csv`支持自定义。举个栗子,默认的信息项显示配置相当于是:
```yaml
- branch
- commit_msg
```csv
branch,commit_msg,commit_time
```
为了创建自己的信息项,命名一个目录为`extra_info_items`
`$XDG_CONFIG_HOME/gita/extra_repo_info.py`中,要把信息项的名字作为字符串映射到方法中,该方法将库的路径作为输入参数。举个栗子:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 220 KiB

After

Width:  |  Height:  |  Size: 257 KiB

Before After
Before After