bagisto-git-workflow

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Git Workflow

Git工作流

The conventions this repository actually follows, read from its history rather than from a generic Git guide.
本仓库实际遵循的约定,均源自其历史实践,而非通用Git指南。

Branches

分支命名规范

<author>/<topic>
or
<author>/<type>/<topic>
, lowercase and hyphenated:
devansh-webkul/themes-improvements
kartikeywebkul9260/v2.4_file_attribute_required_validation
Vansh-Sharmaa/fix/duplicate-product-customizable-options
Branch from the release line you are targeting —
2.4
for 2.4 work,
master
for the next major — and open the pull request against that same branch. Never commit directly to
2.4
or
master
.
采用
<作者>/<主题>
<作者>/<类型>/<主题>
格式,全部小写并以连字符分隔:
devansh-webkul/themes-improvements
kartikeywebkul9260/v2.4_file_attribute_required_validation
Vansh-Sharmaa/fix/duplicate-product-customizable-options
从目标发布分支创建新分支——针对2.4版本的工作基于
2.4
分支,针对下一个主版本的工作基于
master
分支——并向同一分支发起拉取请求。禁止直接向
2.4
master
分支提交代码。

Commits

提交规范

Conventional Commits, lowercase subject, imperative or descriptive. Across the last 200 commits:
fix:
66,
feat:
21,
chore:
9,
chore(deps):
5,
test:
3,
refactor(shop):
1,
docs:
1.
fix: grouped themes into two parts my theme and buy themes
feat: playwight testcases updated and draft issue fixed
test: playwright testcases added
chore: changelog and version updated
A scope is optional and used sparingly —
refactor(shop):
,
chore(deps):
.
Write a body only when the subject cannot carry the reason — 12 of the last 100 non-merge commits have one. The body explains why, not what the diff shows — and it is the right home for anything you were tempted to write as a comment in the code, since this codebase does not take comments inside method bodies.
Never add AI or tool attribution. No
Co-Authored-By
for an assistant, no "Generated with", no robot emoji. There are none in this repository's history and none should appear.
遵循Conventional Commits约定,提交主题使用小写,采用命令式或描述性语气。查看最近200次提交:
fix:
66次,
feat:
21次,
chore:
9次,
chore(deps):
5次,
test:
3次,
refactor(shop):
1次,
docs:
1次。
fix: grouped themes into two parts my theme and buy themes
feat: playwight testcases updated and draft issue fixed
test: playwright testcases added
chore: changelog and version updated
作用域(scope)为可选字段,仅在必要时使用——例如
refactor(shop):
chore(deps):
仅当提交主题无法说明原因时才需要编写提交正文——最近100次非合并提交中仅有12次包含正文。提交正文需解释原因,而非代码差异展示的内容——同时,如果你曾想在代码方法体内添加注释,这些内容应放在提交正文中,因为本代码库不允许在方法体内添加注释。
禁止添加AI或工具署名。不要为助手添加
Co-Authored-By
,不要写“Generated with”,也不要使用机器人表情。本仓库历史记录中没有此类内容,未来也不应出现。

CHANGELOG

CHANGELOG规范

CHANGELOG.md
opens with
## Unreleased
, then one section per release:
markdown
undefined
CHANGELOG.md
文件以
## Unreleased
开头,之后每个版本对应一个章节:
markdown
undefined

Unreleased

Unreleased

  • Entry.
  • Entry.

v2.4.9 (5th of August 2026) - Release

v2.4.9 (5th of August 2026) - Release

  • Entry.

Entries are `-` prefixed with a blank line between them, and are **prose written
for the person upgrading**: the user-visible effect first, the cause second, in
full sentences. Not a commit subject, not a diff summary.

> Fixed the mega search leaving you on an empty tab when another tab had
> results, which read as nothing being found. It now opens the first tab that
> matched.

Two shapes, and the length rule differs between them:

| Shape | When | Length |
|---|---|---|
| `- <prose>` | A feature or a change with no reported issue | As long as it needs, one paragraph |
| `- #11432 [fixed] - <prose>` | A fix for a reported issue | **At most two lines** |

An issue-numbered entry is a terse record against a ticket that carries the
detail, so keep it to two lines. A plain entry may run longer when the change
genuinely needs explaining, but one paragraph is the ceiling.

Add the entry under `## Unreleased`. Do not invent a version heading or a date —
releases are cut separately.
  • Entry.

条目以`-`开头,条目之间空一行,且需**以面向升级用户的书面语撰写**:先写用户可见的效果,再写原因,使用完整句子。不要写成提交主题或代码差异摘要。

> 修复了当其他标签页有搜索结果时,mega search会停留在空白标签页的问题,该问题会让用户误以为没有找到内容。现在会直接打开第一个匹配结果的标签页。

条目分为两种形式,长度规则不同:

| 形式 | 使用场景 | 长度要求 |
|---|---|---|
| `- <书面描述>` | 新功能或无已报告问题的变更 | 按需撰写,最多一段 |
| `- #11432 [fixed] - <书面描述>` | 修复已报告的问题 | **最多两行** |

带问题编号的条目是针对工单的简洁记录,详细内容在工单中,因此需控制在两行以内。普通条目若变更确实需要解释,可适当延长,但最多一段。

将条目添加到`## Unreleased`章节下。不要自行创建版本标题或日期——版本发布是单独进行的操作。

Pull requests

拉取请求(PR)规范

Merged with GitHub's default subject, which is what the history shows:
Merge pull request #11426 from devansh-webkul/themes-improvements
The description states what changed and why, and names anything a reviewer cannot see in the diff — a config default, a migration, a follow-up left out. Run the verification gates before opening it, and say in the description which ran and which were skipped.
使用GitHub默认的合并主题,历史记录示例如下:
Merge pull request #11426 from devansh-webkul/themes-improvements
PR描述需说明变更内容及原因,并提及评审者无法从代码差异中看到的信息——例如配置默认值、迁移操作、未包含的后续工作。发起PR前需运行验证检查,并在描述中说明已运行哪些检查、跳过哪些检查。

Rules

规则

  • Do not commit, push, or open a PR unless asked. Leave the work in the tree and say what is ready.
  • Never
    --force
    onto a shared branch
    , and never rewrite published history.
  • Never commit
    .env
    , credentials,
    vendor/
    ,
    node_modules/
    , or build output under
    public/themes/*/build/
    .
  • One logical change per commit. A fix and an unrelated refactor are two commits, so either can be reverted alone.
  • Do not add or remove a Composer or npm dependency without approval, and never commit a lockfile change you did not intend.
  • Run the gates first. A commit that fails Pint or the tests is a commit that fails CI.
REQUIRED SUB-SKILL: Use bagisto-change-verification before calling any change done.
  • 除非得到要求,否则不要提交、推送或发起PR。将工作保留在本地分支,并说明哪些内容已准备就绪。
  • 禁止对共享分支使用
    --force
    强制推送
    ,也不要重写已发布的历史记录。
  • 禁止提交
    .env
    文件、凭据、
    vendor/
    目录、
    node_modules/
    目录或
    public/themes/*/build/
    下的构建产物
  • 每次提交仅包含一个逻辑变更。修复bug和无关的代码重构应分为两次提交,以便单独回滚其中任意一项。
  • 未经批准不得添加或移除Composer或npm依赖,也不要提交非预期的锁文件变更。
  • 先运行检查。未通过Pint或测试的提交会导致CI失败。
必备子技能: 在确认任何变更完成前,请使用bagisto-change-verification。