Skip to main content

CommitUpdater

用于在主工程中批量更新 Podfile.lock 里的组件 commit,并自动提交推送主工程仓库。

功能概述

  • 拉取主工程最新代码
  • 获取组件仓库最新 commit
  • 更新 Podfile.lock 中对应组件的 :commit:
  • 自动提交并推送主工程改动

另有 bbpull 命令:自动识别当前开发者配置,批量拉取更新 :method => LOCAL 的本地组件仓库代码(不做任何 lock 文件改动)。

安装

本地安装

cd CommitUpdater
pip install -e .

安装后会提供命令:bbcu、bbpull

外网安装

发布到 PyPI 后,可直接安装:

# 跟新pip源
python -m pip install --upgrade pip
# pip安装
pip install commit-updater
# pip命令没有找到,使用 python3 -m pip  命令安装
python3 -m pip install commit-updater
# 更新
python3 -m pip install -U commit-updater

使用方式

进入包含 Podfile.lock 的主工程目录后执行:

bbcu BBUnlock BBEngine
# 如果命令没有找到,查询安装位置,把安装路径中lib文件夹平级的bin文件夹添加到PATH中重新试下
python3 -m pip show commit-updater

也可以更新单个组件:

bbcu BBUnlock

bbpull:批量拉取本地组件

在主工程目录下执行,自动识别当前机器对应的成员配置(:pathes 在本机存在的第一份配置), 更新其中 :method => LOCAL 的组件仓库:

bbpull                                  # 更新全部 LOCAL 组件
bbpull BBUIKit BRUserModule             # 只更新指定组件
bbpull --branch develop                 # 先切分支再更新
bbpull --dry-run                        # 检查并标记每个组件是否有更新,不改动工作区与本地分支
bbpull --dry-run --no-fetch             # 离线检查:基于上次 fetch 的缓存引用判断更新
bbpull --config cocoapods/Member_modules/zyt_modules.rb   # 指定成员配置

拉取策略与 scripts/update_local_modules.sh 一致:

  • 工作区有未提交改动的仓库跳过,不做任何改动
  • 只 fetch 当前目标分支引用(+refs/heads/<分支>:refs/remotes/origin/<分支>,避开远端 大小写冲突引用导致的全量 fetch 失败),再 git merge --ff-only 纯本地快进更新,本地领先时跳过
  • 无上游分支的仓库跳过
  • --dry-run 模式:执行 fetch 后按领先/落后标记各组件(有更新 N 个提交 / 已是最新 / 本地领先), 不执行 checkout/pull;结尾列出存在更新的组件清单
  • 有组件拉到新代码时,结尾提示需手动执行 bundle exec pod install

适用场景

适用于基于 CocoaPods 管理组件依赖、并使用 Podfile.lock 锁定 commit 的工程。

更多说明

实现细节、PyCharm 运行说明、提交规则、发布流程和维护注意事项见:DEVELOPMENT.md

Metadata

Release files for commit-updater 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for commit-updater 0.6.0
File Size Uploaded Provenance
commit_updater-0.6.0.tar.gz 12.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for commit-updater 0.6.0
File Interpreter ABI Platform
commit_updater-0.6.0-py3-none-any.whl Python 3 none any Details

Total release size: 28.6 kB

Release files / commit_updater-0.6.0.tar.gz

Download URL commit_updater-0.6.0.tar.gz
Size 12.4 kB
Tags Source
SHA-256 checksum
How to use checksums
163305e9d86fc77a87a874d1c28c3cc085899658acfc211199d3005f0d9729e6
BLAKE2b-256 checksum
How to use checksums
3f100739ea2c007a76c481dcf8c92e1db4f20cde4847ffda73e3cb3912b867ea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.7

Release files / commit_updater-0.6.0-py3-none-any.whl

Download URL commit_updater-0.6.0-py3-none-any.whl
Size 16.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
433aa37828870d9d3da3daa36f3ac960e1e92fe7df59bb8f22af2afecb0e1307
BLAKE2b-256 checksum
How to use checksums
695547bd4d6f8e738ebc18fcad23d1bd449dba203f04ffcee777b922135c1185
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.7

Security for commit-updater 0.6.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page