mirror of
git://f0xx.org/android_cast
synced 2026-07-29 04:38:53 +03:00
EB of git flow
This commit is contained in:
@@ -1,7 +1,13 @@
|
||||
# Android Cast — Git flow (green `master`)
|
||||
|
||||
**Version:** 1.0 · **Last updated:** 2026-05-21
|
||||
**PDF:** regenerate with `python3 docs/_pdf_build/build_git_flow_pdf.py` → `docs/GIT_FLOW.pdf`
|
||||
| Field | Value |
|
||||
|-------|-------|
|
||||
| **Version** | 1.1 |
|
||||
| **Published** | 2026-05-21 |
|
||||
| **Author(s)** | Anton Afanaasyeu |
|
||||
| **Markdown source** | `docs/GIT_FLOW.md` |
|
||||
| **PDF** | `docs/GIT_FLOW.pdf` — `python3 docs/_pdf_build/build_git_flow_pdf.py` |
|
||||
| **Diagrams (vector)** | `docs/_pdf_build/git_flow_diagram_*.svg` — open in Okular for crisp zoom |
|
||||
|
||||
This document defines how we develop, integrate, release, and hotfix. **Cursor agents and humans follow the same rules.**
|
||||
|
||||
@@ -66,7 +72,7 @@ flowchart LR
|
||||
3. **Commit** in small logical chunks on the topic branch.
|
||||
4. **Before merge:** run project checks (Android: `./gradlew :app:testDebugUnitTest` or CI equivalent; backend: relevant tests/lint).
|
||||
5. **Merge to `next`:** prefer merge commit or squash per team habit; **do not** merge unfinished work.
|
||||
6. **Delete** topic branch after merge (local + remote).
|
||||
6. **Topic branch cleanup:** optional locally (`git branch -d feature/...`). On the server, prefer **delete branch on merge** (Gitea/GitLab/GitHub) so merged `feature/*` / `fix/*` are removed on `origin` automatically.
|
||||
|
||||
```mermaid
|
||||
sequenceDiagram
|
||||
@@ -166,6 +172,7 @@ flowchart TD
|
||||
| No direct pushes of WIP | ✓ | ✓ | — |
|
||||
| Only maintainers merge to `master` | ✓ | optional | — |
|
||||
| Tag only on `master` | ✓ | — | — |
|
||||
| Force-push | **never** | **maintainer only, rare** | allowed on topic branches |
|
||||
|
||||
See **[§7.1 How to protect branches](#71-how-to-protect-branches-not-local-hooks-alone)** below.
|
||||
|
||||
@@ -182,10 +189,12 @@ See **[§7.1 How to protect branches](#71-how-to-protect-branches-not-local-hook
|
||||
|
||||
#### What to enable on `master` and `next`
|
||||
|
||||
1. **No force-push** (no `git push --force` rewriting history).
|
||||
2. **No direct push** (optional but strong): changes only via merge from `feature/*` or from PR/MR — you merge locally or on the web, but the server rejects `git push origin master` with a normal commit on top without review (exact option name varies).
|
||||
3. **Require CI green** before merge (if you have Actions/GitLab CI/Gitea Actions).
|
||||
4. **Restrict who can push** to you (and CI deploy key if needed).
|
||||
1. **`master`: never allow force-push** — production history must not be rewritten.
|
||||
2. **`next`: force-push off by default** — enable only for maintainers when you intentionally clean integration history (squash/rebase of already-merged work). Prefer fixing history on `feature/*` before merging to `next`. After a rare `next` force-push, anyone with a clone must reset: `git fetch origin && git reset --hard origin/next`.
|
||||
3. **Delete branch on merge** on the server — merged `feature/*` / `fix/*` disappear from `origin` without a manual delete step.
|
||||
4. **No direct push** (optional but strong): changes only via merge from `feature/*` or from PR/MR.
|
||||
5. **Require CI green** before merge (if you have Actions/GitLab CI/Gitea Actions).
|
||||
6. **Restrict who can push** to you (and CI deploy key if needed).
|
||||
|
||||
`feature/*` branches stay **unprotected** — push freely.
|
||||
|
||||
@@ -252,7 +261,7 @@ Agents working in this repo **must**:
|
||||
4. **Releases:** only describe merging `next` → `master` and tagging after user confirms QA.
|
||||
5. **Hotfixes on released code:** branch from `master`, merge back to `master`, tag, then **merge `master` into `next`**.
|
||||
6. **Set active branch** metadata when using a named topic branch (project convention).
|
||||
7. **Do not** force-push `master` / `next`.
|
||||
7. **Do not** force-push `master`; avoid force-push on `next` unless the user explicitly requests integration history rewrite.
|
||||
|
||||
---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user