yyp


Nameyyp JSON
Version 0.2.2 PyPI version JSON
download
home_pageNone
Summary多分支 worktree 管理工具
upload_time2025-08-21 16:37:18
maintainerNone
docs_urlNone
authoryyp
requires_python>=3.8
licenseNone
keywords git worktree krepo-ng cli
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # yyp

多分支 worktree 管理工具(支持 `krepo-ng` 与 `git`)。

## 安装

```bash
pip install yyp
```

## 使用

- 创建 worktree:

```bash
yyp add <path> <branch>
```

这会在 `~/<path>/wpsmain` 和 `~/<path>/wpsweb` 下分别创建或切换到 `<branch>`。

- 列出 worktree:

```bash
yyp list
```

- 移除 worktree:

```bash
yyp remove <path>
```

这会移除 `~/<path>/wpsmain` 和 `~/<path>/wpsweb` 的 worktree,并删除整个 `<path>` 目录。

- 配置管理:

```bash
yyp set work_dir=~/workspace  # 设置工作目录
yyp config                    # 显示当前配置
```

- 修改配置和生成构建脚本(仅限 Linux):

```bash
yyp modify                    # 修改 wpsweb/server/Makefile 和生成 build_server.sh
yyp modify --force            # 强制在非 Linux 系统上运行(不推荐)
```

这会自动查找 wpsweb 目录,并执行以下操作:
1. **修改 `server/Makefile`**:
   - 去掉 `-Wl,-s` 参数
   - 将 `-O2` 修改为 `-g`
2. **生成 `build_server.sh`**:
   - 清空文件内容并写入构建脚本
   - 动态替换路径变量(基于当前执行路径)
   - 自动设置执行权限

> **注意**: `modify` 命令仅在 Linux 系统上支持,因为它需要修改 Makefile 和生成 shell 脚本。

- 自动编译 wpsmain:

```bash
yyp build                     # 自动编译 wpsmain
```

这会自动查找 wpsmain 目录,并在 Docker 中执行以下操作:
1. **配置 weboffice**:执行 `krepo-ng config --new -x weboffice`
2. **检查目录**:验证 `debug_weboffice` 目录是否创建成功
3. **编译项目**:在 `debug_weboffice` 目录中执行 `krepo-ng build`
4. **执行构建脚本**:查找并执行 `wpsweb/build_server.sh` 脚本

> **注意**: `build` 命令需要在 Docker 环境中执行,使用 `kdocker -r qt5` 命令。

## 依赖

- 需要本机已安装并在 PATH 中可用:`krepo-ng`、`git`。
- 配置文件位置:`~/.yyp.json`

## 许可

MIT

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "yyp",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "git, worktree, krepo-ng, cli",
    "author": "yyp",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/d7/f8/0e194481a43ddac46d1e5e1c5f4cbf78a69a1eb3845c7184aeeb4f3cf91d/yyp-0.2.2.tar.gz",
    "platform": null,
    "description": "# yyp\n\n\u591a\u5206\u652f worktree \u7ba1\u7406\u5de5\u5177\uff08\u652f\u6301 `krepo-ng` \u4e0e `git`\uff09\u3002\n\n## \u5b89\u88c5\n\n```bash\npip install yyp\n```\n\n## \u4f7f\u7528\n\n- \u521b\u5efa worktree\uff1a\n\n```bash\nyyp add <path> <branch>\n```\n\n\u8fd9\u4f1a\u5728 `~/<path>/wpsmain` \u548c `~/<path>/wpsweb` \u4e0b\u5206\u522b\u521b\u5efa\u6216\u5207\u6362\u5230 `<branch>`\u3002\n\n- \u5217\u51fa worktree\uff1a\n\n```bash\nyyp list\n```\n\n- \u79fb\u9664 worktree\uff1a\n\n```bash\nyyp remove <path>\n```\n\n\u8fd9\u4f1a\u79fb\u9664 `~/<path>/wpsmain` \u548c `~/<path>/wpsweb` \u7684 worktree\uff0c\u5e76\u5220\u9664\u6574\u4e2a `<path>` \u76ee\u5f55\u3002\n\n- \u914d\u7f6e\u7ba1\u7406\uff1a\n\n```bash\nyyp set work_dir=~/workspace  # \u8bbe\u7f6e\u5de5\u4f5c\u76ee\u5f55\nyyp config                    # \u663e\u793a\u5f53\u524d\u914d\u7f6e\n```\n\n- \u4fee\u6539\u914d\u7f6e\u548c\u751f\u6210\u6784\u5efa\u811a\u672c\uff08\u4ec5\u9650 Linux\uff09\uff1a\n\n```bash\nyyp modify                    # \u4fee\u6539 wpsweb/server/Makefile \u548c\u751f\u6210 build_server.sh\nyyp modify --force            # \u5f3a\u5236\u5728\u975e Linux \u7cfb\u7edf\u4e0a\u8fd0\u884c\uff08\u4e0d\u63a8\u8350\uff09\n```\n\n\u8fd9\u4f1a\u81ea\u52a8\u67e5\u627e wpsweb \u76ee\u5f55\uff0c\u5e76\u6267\u884c\u4ee5\u4e0b\u64cd\u4f5c\uff1a\n1. **\u4fee\u6539 `server/Makefile`**\uff1a\n   - \u53bb\u6389 `-Wl,-s` \u53c2\u6570\n   - \u5c06 `-O2` \u4fee\u6539\u4e3a `-g`\n2. **\u751f\u6210 `build_server.sh`**\uff1a\n   - \u6e05\u7a7a\u6587\u4ef6\u5185\u5bb9\u5e76\u5199\u5165\u6784\u5efa\u811a\u672c\n   - \u52a8\u6001\u66ff\u6362\u8def\u5f84\u53d8\u91cf\uff08\u57fa\u4e8e\u5f53\u524d\u6267\u884c\u8def\u5f84\uff09\n   - \u81ea\u52a8\u8bbe\u7f6e\u6267\u884c\u6743\u9650\n\n> **\u6ce8\u610f**: `modify` \u547d\u4ee4\u4ec5\u5728 Linux \u7cfb\u7edf\u4e0a\u652f\u6301\uff0c\u56e0\u4e3a\u5b83\u9700\u8981\u4fee\u6539 Makefile \u548c\u751f\u6210 shell \u811a\u672c\u3002\n\n- \u81ea\u52a8\u7f16\u8bd1 wpsmain\uff1a\n\n```bash\nyyp build                     # \u81ea\u52a8\u7f16\u8bd1 wpsmain\n```\n\n\u8fd9\u4f1a\u81ea\u52a8\u67e5\u627e wpsmain \u76ee\u5f55\uff0c\u5e76\u5728 Docker \u4e2d\u6267\u884c\u4ee5\u4e0b\u64cd\u4f5c\uff1a\n1. **\u914d\u7f6e weboffice**\uff1a\u6267\u884c `krepo-ng config --new -x weboffice`\n2. **\u68c0\u67e5\u76ee\u5f55**\uff1a\u9a8c\u8bc1 `debug_weboffice` \u76ee\u5f55\u662f\u5426\u521b\u5efa\u6210\u529f\n3. **\u7f16\u8bd1\u9879\u76ee**\uff1a\u5728 `debug_weboffice` \u76ee\u5f55\u4e2d\u6267\u884c `krepo-ng build`\n4. **\u6267\u884c\u6784\u5efa\u811a\u672c**\uff1a\u67e5\u627e\u5e76\u6267\u884c `wpsweb/build_server.sh` \u811a\u672c\n\n> **\u6ce8\u610f**: `build` \u547d\u4ee4\u9700\u8981\u5728 Docker \u73af\u5883\u4e2d\u6267\u884c\uff0c\u4f7f\u7528 `kdocker -r qt5` \u547d\u4ee4\u3002\n\n## \u4f9d\u8d56\n\n- \u9700\u8981\u672c\u673a\u5df2\u5b89\u88c5\u5e76\u5728 PATH \u4e2d\u53ef\u7528\uff1a`krepo-ng`\u3001`git`\u3002\n- \u914d\u7f6e\u6587\u4ef6\u4f4d\u7f6e\uff1a`~/.yyp.json`\n\n## \u8bb8\u53ef\n\nMIT\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "\u591a\u5206\u652f worktree \u7ba1\u7406\u5de5\u5177",
    "version": "0.2.2",
    "project_urls": null,
    "split_keywords": [
        "git",
        " worktree",
        " krepo-ng",
        " cli"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "36b34ab5ba4c4214bc38ca27728c500f54632f63cd12090cdfa9f0a851210673",
                "md5": "c009bfa52e9642b7a2ad650dd98e4b47",
                "sha256": "969fbc5e7b4d740fcd9c50abeada1b66e507d03bd73832a25d39055b73ef7a3b"
            },
            "downloads": -1,
            "filename": "yyp-0.2.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c009bfa52e9642b7a2ad650dd98e4b47",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 10007,
            "upload_time": "2025-08-21T16:37:17",
            "upload_time_iso_8601": "2025-08-21T16:37:17.206042Z",
            "url": "https://files.pythonhosted.org/packages/36/b3/4ab5ba4c4214bc38ca27728c500f54632f63cd12090cdfa9f0a851210673/yyp-0.2.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "d7f80e194481a43ddac46d1e5e1c5f4cbf78a69a1eb3845c7184aeeb4f3cf91d",
                "md5": "b19c67b3ccc19322ae7a9d4d3eaec256",
                "sha256": "cb9494fd4ebf7b601439ee582386d3302fd3d77854ed01b373862f5c29ea0ac4"
            },
            "downloads": -1,
            "filename": "yyp-0.2.2.tar.gz",
            "has_sig": false,
            "md5_digest": "b19c67b3ccc19322ae7a9d4d3eaec256",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 9272,
            "upload_time": "2025-08-21T16:37:18",
            "upload_time_iso_8601": "2025-08-21T16:37:18.678571Z",
            "url": "https://files.pythonhosted.org/packages/d7/f8/0e194481a43ddac46d1e5e1c5f4cbf78a69a1eb3845c7184aeeb4f3cf91d/yyp-0.2.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-21 16:37:18",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "yyp"
}
        
yyp
Elapsed time: 1.58335s