Compare commits
50 Commits
1eab53b7ba
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 52cb73be47 | |||
|
|
3e689ed0b2 | ||
| 5d7068ae1d | |||
|
|
201700f27b | ||
| 540efeac89 | |||
| 0ff81cccbd | |||
| 501f89d3a0 | |||
| ba92e6c212 | |||
| 7bed32b60a | |||
|
9652714455
|
|||
|
|
b33a02991c | ||
|
|
fc393caa5b | ||
|
|
b6dfa4b787 | ||
|
|
c4bb1ae3f1 | ||
| 3a64fee42e | |||
|
e5d2604edc
|
|||
| 19a5bafeec | |||
|
|
e01d929793 | ||
| 02f2c9a887 | |||
|
|
ebe2a6be99 | ||
| 53e20b43d3 | |||
|
e85a83c2c6
|
|||
| be432b6f79 | |||
|
|
bd5963d454 | ||
| 8465487155 | |||
| 3f30bedcd3 | |||
| df2caadb70 | |||
|
ee0c0171a5
|
|||
|
|
2705ab40d0 | ||
|
|
f9f55d3a72 | ||
| 3243639e3c | |||
|
cb43e511c2
|
|||
|
0f01a1f154
|
|||
| 949cc0b5b5 | |||
|
|
42260f46b5 | ||
| 1c25833e69 | |||
|
a6a4950947
|
|||
|
69c730f463
|
|||
| bd680be110 | |||
|
898d05bfa5
|
|||
| df8d313896 | |||
|
fb95f72e03
|
|||
|
be51ec4831
|
|||
| 55eba06cb2 | |||
|
4ce2eb82e6
|
|||
| b6e1c794d2 | |||
|
a51a957530
|
|||
|
cd659d7b4f
|
|||
|
|
868e67ad4b
|
||
|
58f310bb8c
|
@@ -1,10 +1,22 @@
|
|||||||
{
|
{
|
||||||
"permissions": {
|
"permissions": {
|
||||||
"allow": [
|
"allow": [
|
||||||
"Bash(bun install:*)",
|
"Bash(cat:*)",
|
||||||
"Bash(bun run build:*)",
|
"Bash(git add:*)",
|
||||||
"Bash(bun run update:*)",
|
"Bash(git commit:*)",
|
||||||
"Bash(bun update:*)"
|
"Bash(git diff:*)",
|
||||||
|
"Bash(ls:*)",
|
||||||
|
"Bash(npm install:*)",
|
||||||
|
"Bash(npm run astro:*)",
|
||||||
|
"Bash(npm run build:*)",
|
||||||
|
"Bash(npm run check:*)",
|
||||||
|
"Bash(npm run dev:*)",
|
||||||
|
"Bash(npm run format:*)",
|
||||||
|
"Bash(npm run format:check:*)",
|
||||||
|
"Bash(npm run lint:*)",
|
||||||
|
"Bash(npm run preview:*)",
|
||||||
|
"Bash(npm run update-specs:*)",
|
||||||
|
"mcp__deepwiki__ask_question"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
24
.github/dependabot.yml
vendored
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
---
|
||||||
|
version: 2
|
||||||
|
updates:
|
||||||
|
- package-ecosystem: github-actions
|
||||||
|
directory: /
|
||||||
|
schedule:
|
||||||
|
interval: monthly
|
||||||
|
- package-ecosystem: npm
|
||||||
|
directory: /
|
||||||
|
schedule:
|
||||||
|
interval: monthly
|
||||||
|
groups:
|
||||||
|
npm-development:
|
||||||
|
dependency-type: development
|
||||||
|
update-types:
|
||||||
|
- major
|
||||||
|
- minor
|
||||||
|
- patch
|
||||||
|
npm-production:
|
||||||
|
dependency-type: production
|
||||||
|
update-types:
|
||||||
|
- major
|
||||||
|
- minor
|
||||||
|
- patch
|
||||||
47
.github/workflows/update-specs.yml
vendored
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
name: Update Specs
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
update-specs:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Generate GitHub App Token
|
||||||
|
id: app-token
|
||||||
|
uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1
|
||||||
|
with:
|
||||||
|
app-id: ${{ secrets.BOT_APP_ID }}
|
||||||
|
private-key: ${{ secrets.BOT_PRIVATE_KEY }}
|
||||||
|
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||||
|
with:
|
||||||
|
token: ${{ steps.app-token.outputs.token }}
|
||||||
|
|
||||||
|
- name: Setup Node.js
|
||||||
|
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
|
||||||
|
with:
|
||||||
|
node-version-file: ".node-version"
|
||||||
|
cache: "npm"
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
|
- name: Update specs
|
||||||
|
run: npm run update-specs
|
||||||
|
|
||||||
|
- name: Create Pull Request
|
||||||
|
uses: peter-evans/create-pull-request@98357b18bf14b5342f975ff684046ec3b2a07725 # v8.0.0
|
||||||
|
with:
|
||||||
|
token: ${{ steps.app-token.outputs.token }}
|
||||||
|
commit-message: "chore: update spec versions"
|
||||||
|
title: "chore: update spec versions"
|
||||||
|
body: |
|
||||||
|
Automated update of spec versions from upstream repository.
|
||||||
|
|
||||||
|
This PR was created by the update-specs workflow.
|
||||||
|
branch: update-specs
|
||||||
|
delete-branch: true
|
||||||
|
add-paths: |
|
||||||
|
src/content/spec/*
|
||||||
3
.gitignore
vendored
@@ -2,6 +2,9 @@
|
|||||||
dist/
|
dist/
|
||||||
.astro/
|
.astro/
|
||||||
|
|
||||||
|
# Claude
|
||||||
|
.claude/settings.local.json
|
||||||
|
|
||||||
# Node
|
# Node
|
||||||
node_modules/
|
node_modules/
|
||||||
|
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
[tools]
|
[settings]
|
||||||
bun = "1"
|
idiomatic_version_file_enable_tools = ["node"]
|
||||||
|
|||||||
1
.node-version
Normal file
@@ -0,0 +1 @@
|
|||||||
|
24
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
docs/
|
|
||||||
.astro/
|
.astro/
|
||||||
|
dist/
|
||||||
node_modules/
|
node_modules/
|
||||||
bun.lock
|
package-lock.json
|
||||||
|
src/content/spec/
|
||||||
|
|||||||
2
.vscode/launch.json
vendored
@@ -2,7 +2,7 @@
|
|||||||
"version": "0.2.0",
|
"version": "0.2.0",
|
||||||
"configurations": [
|
"configurations": [
|
||||||
{
|
{
|
||||||
"command": "bun run dev",
|
"command": "npm run dev",
|
||||||
"name": "dev server",
|
"name": "dev server",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"type": "node-terminal"
|
"type": "node-terminal"
|
||||||
|
|||||||
47
CLAUDE.md
@@ -12,50 +12,51 @@ that combines GitHub Flow with versioned releases.
|
|||||||
## Build Commands
|
## Build Commands
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Install tooling (bun) via mise
|
# Install tooling (node) via mise
|
||||||
mise install
|
mise install
|
||||||
|
|
||||||
# Install dependencies
|
# Install dependencies
|
||||||
bun install
|
npm install
|
||||||
|
|
||||||
# Development server
|
# Development server
|
||||||
bun run dev
|
npm run dev
|
||||||
|
|
||||||
# Build site (outputs to docs/ directory)
|
# Build site (outputs to dist/ directory)
|
||||||
bun run build
|
npm run build
|
||||||
|
|
||||||
# Preview built site
|
# Preview built site
|
||||||
bun run preview
|
npm run preview
|
||||||
|
|
||||||
# Type checking
|
# Type checking
|
||||||
bun run check
|
npm run check
|
||||||
|
|
||||||
# Linting
|
# Linting
|
||||||
bun run lint
|
npm run lint
|
||||||
|
|
||||||
# Formatting
|
# Formatting
|
||||||
bun run format
|
npm run format
|
||||||
bun run format:check
|
npm run format:check
|
||||||
|
|
||||||
# Update specs from upstream (fetches from github.com/jimeh/common-flow)
|
# Update specs from upstream (fetches from github.com/jimeh/common-flow)
|
||||||
bun run update
|
npm run update-specs
|
||||||
```
|
```
|
||||||
|
|
||||||
The site is built to `docs/` for GitHub Pages hosting.
|
The site is built to `dist/` and deployed to Cloudflare Workers.
|
||||||
|
|
||||||
## Architecture
|
## Architecture
|
||||||
|
|
||||||
- **Astro 5.x** static site generator
|
- **Astro 5.x** static site generator
|
||||||
- **Tailwind CSS 4.x** for styling with dark mode support
|
- **Tailwind CSS 4.x** for styling with dark mode support
|
||||||
- **astro-icon** with Heroicons and Simple Icons for icons
|
- **astro-icon** with Heroicons, Simple Icons, and custom local SVGs (`src/icons/`)
|
||||||
- **Content Collections** for spec markdown files
|
- **Content Collections** for spec markdown files
|
||||||
- **TypeScript** throughout
|
- **TypeScript** throughout
|
||||||
- **Bun** as JavaScript runtime and package manager (managed via mise)
|
- **Node.js** as JavaScript runtime (managed via mise)
|
||||||
|
|
||||||
### Key Files
|
### Key Files
|
||||||
|
|
||||||
- `src/config.ts` - Site configuration with version list
|
- `src/config.ts` - Site configuration (metadata, update settings)
|
||||||
- `src/content.config.ts` - Astro content collection definition
|
- `src/content.config.ts` - Astro content collection definition
|
||||||
|
- `src/styles/global.css` - Global Tailwind styles
|
||||||
- `src/layouts/BaseLayout.astro` - Base layout with head, meta tags, theme scripts
|
- `src/layouts/BaseLayout.astro` - Base layout with head, meta tags, theme scripts
|
||||||
- `src/layouts/SpecLayout.astro` - Spec page layout composing all sections
|
- `src/layouts/SpecLayout.astro` - Spec page layout composing all sections
|
||||||
- `src/components/` - UI components:
|
- `src/components/` - UI components:
|
||||||
@@ -70,18 +71,22 @@ The site is built to `docs/` for GitHub Pages hosting.
|
|||||||
- `TocLink.astro` - Reusable TOC link component
|
- `TocLink.astro` - Reusable TOC link component
|
||||||
- `ThemeToggle.astro` - Dark/light mode toggle
|
- `ThemeToggle.astro` - Dark/light mode toggle
|
||||||
- `VersionSelector.astro` - Spec version dropdown
|
- `VersionSelector.astro` - Spec version dropdown
|
||||||
- `src/scripts/activeSectionTracker.ts` - Shared scroll-based active section tracking
|
- `src/scripts/` - Client-side TypeScript:
|
||||||
|
- `activeSectionTracker.ts` - Scroll-based active section tracking
|
||||||
|
- `clauseHighlight.ts` - Clause highlight on anchor navigation
|
||||||
- `src/pages/index.astro` - Landing page
|
- `src/pages/index.astro` - Landing page
|
||||||
- `src/pages/404.astro` - 404 error page
|
- `src/pages/404.astro` - 404 error page
|
||||||
- `src/pages/spec/[version].astro` - Dynamic route for spec versions
|
- `src/pages/spec/[version].astro` - Dynamic route for spec versions
|
||||||
- `src/utils/parseSpecContent.ts` - Markdown parsing utilities
|
- `src/pages/spec/[version]/raw.astro` - Raw markdown spec page
|
||||||
|
- `src/utils/` - Utility functions:
|
||||||
|
- `parseSpecContent.ts` - Markdown parsing utilities
|
||||||
|
- `versions.ts` - Version info helper (derives current version from specs)
|
||||||
- `src/content/spec/*.md` - Versioned spec documents
|
- `src/content/spec/*.md` - Versioned spec documents
|
||||||
- `public/spec/*.svg` - SVG diagrams for each version
|
- `public/spec/*.svg` - SVG diagrams for each version
|
||||||
- `scripts/update-specs.ts` - Fetches specs from GitHub
|
- `scripts/update-specs.ts` - Fetches specs from GitHub
|
||||||
|
- `wrangler.jsonc` - Cloudflare Workers deployment config
|
||||||
|
|
||||||
### Updating Spec Versions
|
### Updating Spec Versions
|
||||||
|
|
||||||
1. Add new version to `versions` array in `src/config.ts`
|
1. Run `npm run update-specs` to fetch specs from GitHub
|
||||||
2. Update `currentVersion` if this is the new default
|
2. Run `npm run build` to rebuild the site
|
||||||
3. Run `bun run update` to fetch specs from GitHub
|
|
||||||
4. Run `bun run build` to rebuild the site
|
|
||||||
|
|||||||
@@ -1,13 +1,38 @@
|
|||||||
import { defineConfig } from "astro/config";
|
import { defineConfig, fontProviders } from "astro/config";
|
||||||
import tailwindcss from "@tailwindcss/vite";
|
import tailwindcss from "@tailwindcss/vite";
|
||||||
import sitemap from "@astrojs/sitemap";
|
import sitemap from "@astrojs/sitemap";
|
||||||
import icon from "astro-icon";
|
import icon from "astro-icon";
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
site: "https://commonflow.org",
|
site: "https://commonflow.org",
|
||||||
outDir: "./docs",
|
outDir: "./dist",
|
||||||
integrations: [sitemap(), icon()],
|
integrations: [sitemap(), icon()],
|
||||||
vite: {
|
vite: {
|
||||||
plugins: [tailwindcss()],
|
plugins: [tailwindcss()],
|
||||||
},
|
},
|
||||||
|
experimental: {
|
||||||
|
fonts: [
|
||||||
|
{
|
||||||
|
provider: fontProviders.fontsource(),
|
||||||
|
name: "Bricolage Grotesque",
|
||||||
|
cssVariable: "--font-bricolage",
|
||||||
|
weights: ["200 800"],
|
||||||
|
fallbacks: ["system-ui", "sans-serif"],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
provider: fontProviders.fontsource(),
|
||||||
|
name: "DM Sans",
|
||||||
|
cssVariable: "--font-dm-sans",
|
||||||
|
weights: ["100 1000"],
|
||||||
|
fallbacks: ["system-ui", "sans-serif"],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
provider: fontProviders.fontsource(),
|
||||||
|
name: "JetBrains Mono",
|
||||||
|
cssVariable: "--font-jetbrains",
|
||||||
|
weights: ["100 800"],
|
||||||
|
fallbacks: ["SF Mono", "Consolas", "monospace"],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,24 +0,0 @@
|
|||||||
<!DOCTYPE html><html lang="en"> <head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><link rel="canonical" href="https://commonflow.org/404/"><title>Page Not Found | Git Common-Flow</title><meta name="description" content="An attempt to gather a sensible selection of the most common usage patterns of git into a single and concise specification."><meta name="author" content="Jim Myhrberg"><!-- Open Graph --><meta property="og:title" content="Page Not Found | Git Common-Flow"><meta property="og:description" content="An attempt to gather a sensible selection of the most common usage patterns of git into a single and concise specification."><meta property="og:type" content="website"><meta property="og:url" content="https://commonflow.org/404/"><!-- Twitter --><meta name="twitter:card" content="summary"><meta name="twitter:title" content="Page Not Found | Git Common-Flow"><meta name="twitter:description" content="An attempt to gather a sensible selection of the most common usage patterns of git into a single and concise specification."><!-- Favicon --><link rel="icon" href="/favicon.ico" sizes="32x32"><link rel="icon" href="/favicon.svg" type="image/svg+xml"><link rel="apple-touch-icon" href="/apple-touch-icon.png"><!-- Prevent flash of wrong theme --><script>
|
|
||||||
(function () {
|
|
||||||
const mode = localStorage.getItem("theme");
|
|
||||||
const prefersDark = window.matchMedia(
|
|
||||||
"(prefers-color-scheme: dark)",
|
|
||||||
).matches;
|
|
||||||
if (mode === "dark" || (mode !== "light" && prefersDark)) {
|
|
||||||
document.documentElement.classList.add("dark");
|
|
||||||
}
|
|
||||||
})();
|
|
||||||
</script><link rel="stylesheet" href="/_astro/index.DF_wxGza.css"></head> <body class="min-h-screen"> <div class="flex flex-col items-center justify-center min-h-screen p-8"> <div class="text-center"> <h1 class="text-[8rem] sm:text-[12rem] font-display font-bold leading-none
|
|
||||||
text-gray-300 dark:text-neutral-700">
|
|
||||||
404
|
|
||||||
</h1> <p class="text-xl mb-2 text-gray-600 dark:text-neutral-400">
|
|
||||||
Page not found
|
|
||||||
</p> <p class="text-gray-500 dark:text-neutral-500">
|
|
||||||
The page you're looking for doesn't exist.
|
|
||||||
</p> <a href="/" class="inline-flex items-center justify-center gap-2 mt-8
|
|
||||||
px-5 py-2.5 text-sm font-medium rounded-lg
|
|
||||||
transition-all cursor-pointer
|
|
||||||
bg-sky-600 text-white
|
|
||||||
hover:bg-sky-500 hover:-translate-y-0.5 hover:shadow-md">
|
|
||||||
Go to homepage
|
|
||||||
</a> </div> </div> <!-- Re-init theme on Astro page transitions --> <script type="module">document.addEventListener("astro:after-swap",()=>{const e=localStorage.getItem("theme"),t=window.matchMedia("(prefers-color-scheme: dark)").matches;e==="dark"||e!=="light"&&t?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")});</script> </body> </html>
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
import{i as o}from"./activeSectionTracker.CGlk-3e6.js";function a(){const e=document.getElementById("site-header"),d=document.getElementById("hero"),r=document.getElementById("mobile-menu-btn"),t=document.getElementById("mobile-nav");if(!e||!d)return;const i=64;function n(){e&&(window.scrollY>=i?(e.classList.remove("translate-y-[-100%]","border-transparent"),e.classList.add("border-gray-200","dark:border-neutral-800")):(e.classList.add("translate-y-[-100%]","border-transparent"),e.classList.remove("border-gray-200","dark:border-neutral-800")))}window.addEventListener("scroll",n,{passive:!0}),n(),r&&t&&(r.addEventListener("click",()=>{t.classList.toggle("hidden")}),t.querySelectorAll("a").forEach(s=>{s.addEventListener("click",()=>{t.classList.add("hidden")})})),o({linkSelector:"[data-nav-link]",defaultToFirst:!1})}a();document.addEventListener("astro:after-swap",a);
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
import{i as v}from"./activeSectionTracker.CGlk-3e6.js";function s(){v({linkSelector:"[data-sidebar-link]"});const t=document.getElementById("spec-toc-toggle"),e=document.getElementById("spec-toc-drawer"),r=e?.querySelector("[data-toc-backdrop]"),d=e?.querySelector("[data-toc-close]"),i=e?.querySelectorAll("[data-toc-link]");function a(){e?.classList.remove("hidden"),document.body.style.overflow="hidden"}function c(){e?.classList.add("hidden"),document.body.style.overflow=""}t?.addEventListener("click",a),r?.addEventListener("click",c),d?.addEventListener("click",c),i?.forEach(o=>{o.addEventListener("click",c)});const n=document.getElementById("spec");n&&t&&new IntersectionObserver(([l])=>{t.classList.toggle("hidden",!l.isIntersecting)},{threshold:0}).observe(n)}s();document.addEventListener("astro:after-swap",s);
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
function m(l){const{linkSelector:a,sectionIdAttr:o="data-section-id",headerOffset:f=100,defaultToFirst:u=!0}=l,s=document.querySelectorAll(a),i=[],r=new Set;s.forEach(n=>{const t=n.getAttribute(o);if(t&&!r.has(t)){r.add(t);const e=document.getElementById(t);e&&i.push({id:t,element:e})}});function d(){let n=u?i[0]?.id:null;for(const{id:t,element:e}of i)e.getBoundingClientRect().top<=f&&(n=t);s.forEach(t=>{const e=t.getAttribute(o);t.classList.toggle("active",e===n)})}let c=!1;window.addEventListener("scroll",()=>{c||(requestAnimationFrame(()=>{d(),c=!1}),c=!0)}),d()}export{m as i};
|
|
||||||
|
Before Width: | Height: | Size: 1.9 KiB |
BIN
docs/favicon.ico
|
Before Width: | Height: | Size: 14 KiB |
@@ -1,17 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
|
|
||||||
<!-- Main horizontal line -->
|
|
||||||
<path d="M 4 10 L 28 10" fill="none" stroke="currentColor" stroke-width="2"/>
|
|
||||||
|
|
||||||
<!-- Branch line: down from left, curve, up to right -->
|
|
||||||
<path d="M 8 10 L 8 16 Q 8 22 16 22 Q 24 22 24 16 L 24 10"
|
|
||||||
fill="none" stroke="currentColor" stroke-width="2"/>
|
|
||||||
|
|
||||||
<!-- Left dot on main line -->
|
|
||||||
<circle cx="8" cy="10" r="3" fill="currentColor"/>
|
|
||||||
|
|
||||||
<!-- Right dot on main line -->
|
|
||||||
<circle cx="24" cy="10" r="3" fill="currentColor"/>
|
|
||||||
|
|
||||||
<!-- Middle dot on branch -->
|
|
||||||
<circle cx="16" cy="22" r="3" fill="currentColor"/>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 625 B |
522
docs/index.html
@@ -1 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1"><url><loc>https://commonflow.org/</loc></url><url><loc>https://commonflow.org/spec/1.0.0-rc.1/</loc></url><url><loc>https://commonflow.org/spec/1.0.0-rc.2/</loc></url><url><loc>https://commonflow.org/spec/1.0.0-rc.3/</loc></url><url><loc>https://commonflow.org/spec/1.0.0-rc.4/</loc></url><url><loc>https://commonflow.org/spec/1.0.0-rc.5/</loc></url></urlset>
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?><sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><sitemap><loc>https://commonflow.org/sitemap-0.xml</loc></sitemap></sitemapindex>
|
|
||||||
|
Before Width: | Height: | Size: 18 KiB |
@@ -1,343 +0,0 @@
|
|||||||
<!DOCTYPE html><html lang="en"> <head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><link rel="canonical" href="https://commonflow.org/spec/1.0.0-rc.1/"><title>Git Common-Flow 1.0.0-rc.1 | Git Common-Flow</title><meta name="description" content="An attempt to gather a sensible selection of the most common usage patterns of git into a single and concise specification."><meta name="author" content="Jim Myhrberg"><!-- Open Graph --><meta property="og:title" content="Git Common-Flow 1.0.0-rc.1 | Git Common-Flow"><meta property="og:description" content="An attempt to gather a sensible selection of the most common usage patterns of git into a single and concise specification."><meta property="og:type" content="website"><meta property="og:url" content="https://commonflow.org/spec/1.0.0-rc.1/"><!-- Twitter --><meta name="twitter:card" content="summary"><meta name="twitter:title" content="Git Common-Flow 1.0.0-rc.1 | Git Common-Flow"><meta name="twitter:description" content="An attempt to gather a sensible selection of the most common usage patterns of git into a single and concise specification."><!-- Favicon --><link rel="icon" href="/favicon.ico" sizes="32x32"><link rel="icon" href="/favicon.svg" type="image/svg+xml"><link rel="apple-touch-icon" href="/apple-touch-icon.png"><!-- Prevent flash of wrong theme --><script>
|
|
||||||
(function () {
|
|
||||||
const mode = localStorage.getItem("theme");
|
|
||||||
const prefersDark = window.matchMedia(
|
|
||||||
"(prefers-color-scheme: dark)",
|
|
||||||
).matches;
|
|
||||||
if (mode === "dark" || (mode !== "light" && prefersDark)) {
|
|
||||||
document.documentElement.classList.add("dark");
|
|
||||||
}
|
|
||||||
})();
|
|
||||||
</script><link rel="stylesheet" href="/_astro/index.DF_wxGza.css"></head> <body class="min-h-screen"> <header id="site-header" class="fixed top-0 inset-x-0 z-50 border-b border-transparent
|
|
||||||
translate-y-[-100%] transition-transform duration-300
|
|
||||||
backdrop-blur-xl bg-gray-50/85 dark:bg-neutral-950/85"> <div class="max-w-6xl mx-auto px-4 sm:px-6 h-16 flex items-center justify-between"> <!-- Logo / Title + Version --> <div class="flex items-center gap-3"> <a href="#hero" class="flex items-center gap-3 no-underline
|
|
||||||
text-gray-950 dark:text-neutral-50
|
|
||||||
hover:text-sky-600 transition-colors"> <span class="font-display font-bold text-lg tracking-tight">
|
|
||||||
Git Common-Flow
|
|
||||||
</span> </a> <div class="hidden md:block"> <div class="relative" data-version-selector> <!-- Trigger button --> <button type="button" data-version-trigger aria-haspopup="listbox" aria-expanded="false" class="flex items-center gap-1.5 px-2.5 py-1.5 text-sm font-mono
|
|
||||||
border border-gray-200 dark:border-neutral-700
|
|
||||||
rounded-md bg-transparent cursor-pointer transition-colors
|
|
||||||
text-gray-600 dark:text-neutral-400
|
|
||||||
hover:border-sky-600 hover:text-gray-950 dark:hover:text-neutral-50"> <span>v1.0.0-rc.1</span> <svg width="1em" height="1em" data-arrow-icon="true" class="w-3.5 h-3.5 transition-transform duration-150" data-icon="heroicons:chevron-down"> <symbol id="ai:heroicons:chevron-down" viewBox="0 0 24 24"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="m19.5 8.25l-7.5 7.5l-7.5-7.5"/></symbol><use href="#ai:heroicons:chevron-down"></use> </svg> </button> <!-- Dropdown menu --> <div data-version-dropdown role="listbox" aria-label="Select version" class="absolute top-full left-0 mt-2 min-w-full p-1.5 z-50
|
|
||||||
bg-gray-50 dark:bg-neutral-900
|
|
||||||
border border-gray-200 dark:border-neutral-700
|
|
||||||
rounded-lg shadow-lg
|
|
||||||
opacity-0 invisible -translate-y-1 transition-all duration-150
|
|
||||||
data-[open]:opacity-100 data-[open]:visible data-[open]:translate-y-0"> <a href="/spec/1.0.0-rc.5" role="option" aria-selected="false" class="block px-3 py-2 font-mono text-sm rounded transition-colors text-gray-600 dark:text-neutral-400 hover:bg-gray-100 dark:hover:bg-neutral-800 hover:text-gray-950 dark:hover:text-neutral-50">
|
|
||||||
v1.0.0-rc.5 </a><a href="/spec/1.0.0-rc.4" role="option" aria-selected="false" class="block px-3 py-2 font-mono text-sm rounded transition-colors text-gray-600 dark:text-neutral-400 hover:bg-gray-100 dark:hover:bg-neutral-800 hover:text-gray-950 dark:hover:text-neutral-50">
|
|
||||||
v1.0.0-rc.4 </a><a href="/spec/1.0.0-rc.3" role="option" aria-selected="false" class="block px-3 py-2 font-mono text-sm rounded transition-colors text-gray-600 dark:text-neutral-400 hover:bg-gray-100 dark:hover:bg-neutral-800 hover:text-gray-950 dark:hover:text-neutral-50">
|
|
||||||
v1.0.0-rc.3 </a><a href="/spec/1.0.0-rc.2" role="option" aria-selected="false" class="block px-3 py-2 font-mono text-sm rounded transition-colors text-gray-600 dark:text-neutral-400 hover:bg-gray-100 dark:hover:bg-neutral-800 hover:text-gray-950 dark:hover:text-neutral-50">
|
|
||||||
v1.0.0-rc.2 </a><a href="/spec/1.0.0-rc.1" role="option" aria-selected="true" class="block px-3 py-2 font-mono text-sm rounded transition-colors text-gray-600 dark:text-neutral-400 hover:bg-gray-100 dark:hover:bg-neutral-800 hover:text-gray-950 dark:hover:text-neutral-50 bg-sky-500/15 dark:bg-sky-500/20 text-sky-600 dark:text-sky-400">
|
|
||||||
v1.0.0-rc.1 </a> </div> </div> <script type="module">function c(){document.querySelectorAll("[data-version-selector]").forEach(e=>{if(e.dataset.initialized)return;e.dataset.initialized="true";const t=e.querySelector("[data-version-trigger]"),a=e.querySelector("[data-version-dropdown]"),n=e.querySelector("[data-arrow-icon]");if(!t||!a)return;const l=()=>{a.dataset.open="true",t.setAttribute("aria-expanded","true"),n&&(n.style.transform="rotate(180deg)")},o=()=>{delete a.dataset.open,t.setAttribute("aria-expanded","false"),n&&(n.style.transform="")};t.addEventListener("click",r=>{r.stopPropagation();const u=a.dataset.open==="true";document.querySelectorAll("[data-version-dropdown][data-open]").forEach(s=>{delete s.dataset.open;const i=s.previousElementSibling;i?.setAttribute("aria-expanded","false");const d=i?.querySelector("[data-arrow-icon]");d&&(d.style.transform="")}),u?o():l()}),document.addEventListener("click",r=>{e.contains(r.target)||o()}),document.addEventListener("keydown",r=>{r.key==="Escape"&&a.dataset.open==="true"&&(o(),t.focus())})})}c();document.addEventListener("astro:after-swap",c);</script> </div> </div> <!-- Desktop Navigation --> <nav class="hidden md:flex items-center gap-1"> <a href="#about" class="nav-link inline-flex items-center gap-1.5 px-4 py-2 text-sm
|
|
||||||
font-medium rounded-lg transition-colors cursor-pointer
|
|
||||||
text-gray-600 dark:text-neutral-400
|
|
||||||
hover:bg-gray-100 hover:text-gray-950
|
|
||||||
dark:hover:bg-neutral-800 dark:hover:text-neutral-50" data-nav-link data-section-id="about"> <svg width="1em" height="1em" class="w-4 h-4" data-icon="heroicons:information-circle"> <symbol id="ai:heroicons:information-circle" viewBox="0 0 24 24"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="m11.25 11.25l.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0a9 9 0 0 1 18 0m-9-3.75h.008v.008H12z"/></symbol><use href="#ai:heroicons:information-circle"></use> </svg> About </a><a href="#spec" class="nav-link inline-flex items-center gap-1.5 px-4 py-2 text-sm
|
|
||||||
font-medium rounded-lg transition-colors cursor-pointer
|
|
||||||
text-gray-600 dark:text-neutral-400
|
|
||||||
hover:bg-gray-100 hover:text-gray-950
|
|
||||||
dark:hover:bg-neutral-800 dark:hover:text-neutral-50" data-nav-link data-section-id="spec"> <svg width="1em" height="1em" class="w-4 h-4" data-icon="heroicons:document-text"> <symbol id="ai:heroicons:document-text" viewBox="0 0 24 24"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9"/></symbol><use href="#ai:heroicons:document-text"></use> </svg> Spec </a><a href="#faq" class="nav-link inline-flex items-center gap-1.5 px-4 py-2 text-sm
|
|
||||||
font-medium rounded-lg transition-colors cursor-pointer
|
|
||||||
text-gray-600 dark:text-neutral-400
|
|
||||||
hover:bg-gray-100 hover:text-gray-950
|
|
||||||
dark:hover:bg-neutral-800 dark:hover:text-neutral-50" data-nav-link data-section-id="faq"> <svg width="1em" height="1em" class="w-4 h-4" data-icon="heroicons:question-mark-circle"> <symbol id="ai:heroicons:question-mark-circle" viewBox="0 0 24 24"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M9.879 7.519c1.172-1.025 3.071-1.025 4.243 0c1.171 1.025 1.171 2.687 0 3.712q-.308.268-.67.442c-.746.361-1.452.999-1.452 1.827v.75M21 12a9 9 0 1 1-18 0a9 9 0 0 1 18 0m-9 5.25h.008v.008H12z"/></symbol><use href="#ai:heroicons:question-mark-circle"></use> </svg> FAQ </a> </nav> <!-- Right side: Theme, GitHub --> <div class="flex items-center gap-3"> <div class="relative group"> <button data-theme-toggle type="button" class="p-2 rounded-lg cursor-pointer transition-colors duration-200
|
|
||||||
text-gray-500 dark:text-neutral-500
|
|
||||||
hover:text-gray-950 dark:hover:text-neutral-50
|
|
||||||
hover:bg-gray-100 dark:hover:bg-neutral-800" aria-label="Toggle theme"> <svg width="1em" height="1em" data-theme-icon="light" class="hidden w-5 h-5" data-icon="heroicons:sun"> <symbol id="ai:heroicons:sun" viewBox="0 0 24 24"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M12 3v2.25m6.364.386l-1.591 1.591M21 12h-2.25m-.386 6.364l-1.591-1.591M12 18.75V21m-4.773-4.227l-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 1 1-7.5 0a3.75 3.75 0 0 1 7.5 0"/></symbol><use href="#ai:heroicons:sun"></use> </svg> <svg width="1em" height="1em" data-theme-icon="dark" class="hidden w-5 h-5" data-icon="heroicons:moon"> <symbol id="ai:heroicons:moon" viewBox="0 0 24 24"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M21.752 15.002A9.7 9.7 0 0 1 18 15.75A9.75 9.75 0 0 1 8.25 6c0-1.33.266-2.597.748-3.752A9.75 9.75 0 0 0 3 11.25A9.75 9.75 0 0 0 12.75 21a9.75 9.75 0 0 0 9.002-5.998"/></symbol><use href="#ai:heroicons:moon"></use> </svg> <svg width="1em" height="1em" data-theme-icon="auto" class="hidden w-5 h-5" data-icon="heroicons:computer-desktop"> <symbol id="ai:heroicons:computer-desktop" viewBox="0 0 24 24"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M9 17.25v1.007a3 3 0 0 1-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0 1 15 18.257V17.25m6-12V15a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 15V5.25m18 0A2.25 2.25 0 0 0 18.75 3H5.25A2.25 2.25 0 0 0 3 5.25m18 0V12a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 12V5.25"/></symbol><use href="#ai:heroicons:computer-desktop"></use> </svg> </button> <!-- Tooltip --> <div class="absolute left-1/2 -translate-x-1/2 top-full mt-2
|
|
||||||
px-2 py-1 text-xs font-medium whitespace-nowrap rounded-md shadow-sm
|
|
||||||
bg-gray-900 text-white dark:bg-white dark:text-gray-900
|
|
||||||
opacity-0 group-hover:opacity-100
|
|
||||||
transition-opacity duration-200 pointer-events-none"> <span data-tooltip-text="light" class="hidden">Light</span> <span data-tooltip-text="dark" class="hidden">Dark</span> <span data-tooltip-text="auto" class="hidden">System</span> </div> </div> <script type="module">function r(){const c=document.querySelectorAll("[data-theme-toggle]");function n(){const e=localStorage.getItem("theme");return e==="dark"||e==="light"||e==="auto"?e:"auto"}function i(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function d(e){return e==="auto"?i():e}function s(e){document.querySelectorAll("[data-theme-icon]").forEach(t=>{const a=t.dataset.themeIcon;t.classList.toggle("hidden",a!==e)}),document.querySelectorAll("[data-tooltip-text]").forEach(t=>{const a=t.dataset.tooltipText;t.classList.toggle("hidden",a!==e)})}function o(e){d(e)==="dark"?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark"),s(e)}function u(e){localStorage.setItem("theme",e),o(e)}function l(){const e=n();return e==="light"?"dark":e==="dark"?"auto":"light"}const f=n();o(f),c.forEach(e=>{e.dataset.initialized||(e.dataset.initialized="true",e.addEventListener("click",()=>{u(l())}))}),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{n()==="auto"&&o("auto")})}r();document.addEventListener("astro:after-swap",r);</script> <a href="https://github.com/jimeh/common-flow" target="_blank" rel="noopener noreferrer" class="p-2 rounded-lg transition-colors
|
|
||||||
text-gray-500 dark:text-neutral-500
|
|
||||||
hover:text-gray-950 dark:hover:text-neutral-50
|
|
||||||
hover:bg-gray-100 dark:hover:bg-neutral-800" aria-label="View on GitHub"> <svg width="1em" height="1em" class="w-5 h-5" data-icon="simple-icons:github"> <symbol id="ai:simple-icons:github" viewBox="0 0 24 24"><path fill="currentColor" d="M12 .297c-6.63 0-12 5.373-12 12c0 5.303 3.438 9.8 8.205 11.385c.6.113.82-.258.82-.577c0-.285-.01-1.04-.015-2.04c-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729c1.205.084 1.838 1.236 1.838 1.236c1.07 1.835 2.809 1.305 3.495.998c.108-.776.417-1.305.76-1.605c-2.665-.3-5.466-1.332-5.466-5.93c0-1.31.465-2.38 1.235-3.22c-.135-.303-.54-1.523.105-3.176c0 0 1.005-.322 3.3 1.23c.96-.267 1.98-.399 3-.405c1.02.006 2.04.138 3 .405c2.28-1.552 3.285-1.23 3.285-1.23c.645 1.653.24 2.873.12 3.176c.765.84 1.23 1.91 1.23 3.22c0 4.61-2.805 5.625-5.475 5.92c.42.36.81 1.096.81 2.22c0 1.606-.015 2.896-.015 3.286c0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"/></symbol><use href="#ai:simple-icons:github"></use> </svg> </a> <!-- Mobile menu button --> <button id="mobile-menu-btn" class="md:hidden p-2 rounded-lg
|
|
||||||
text-gray-500 dark:text-neutral-500
|
|
||||||
hover:bg-gray-100 dark:hover:bg-neutral-800" aria-label="Toggle menu"> <svg width="1em" height="1em" class="w-5 h-5" data-icon="heroicons:bars-3"> <symbol id="ai:heroicons:bars-3" viewBox="0 0 24 24"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5"/></symbol><use href="#ai:heroicons:bars-3"></use> </svg> </button> </div> </div> <!-- Mobile Navigation --> <nav id="mobile-nav" class="md:hidden hidden border-t border-gray-200 dark:border-neutral-800"> <div class="px-4 py-3 space-y-1 text-center"> <div class="py-2 flex justify-center"> <div class="relative" data-version-selector> <!-- Trigger button --> <button type="button" data-version-trigger aria-haspopup="listbox" aria-expanded="false" class="flex items-center gap-1.5 px-2.5 py-1.5 text-sm font-mono
|
|
||||||
border border-gray-200 dark:border-neutral-700
|
|
||||||
rounded-md bg-transparent cursor-pointer transition-colors
|
|
||||||
text-gray-600 dark:text-neutral-400
|
|
||||||
hover:border-sky-600 hover:text-gray-950 dark:hover:text-neutral-50"> <span>v1.0.0-rc.1</span> <svg width="1em" height="1em" viewBox="0 0 24 24" data-arrow-icon="true" class="w-3.5 h-3.5 transition-transform duration-150" data-icon="heroicons:chevron-down"> <use href="#ai:heroicons:chevron-down"></use> </svg> </button> <!-- Dropdown menu --> <div data-version-dropdown role="listbox" aria-label="Select version" class="absolute top-full left-0 mt-2 min-w-full p-1.5 z-50
|
|
||||||
bg-gray-50 dark:bg-neutral-900
|
|
||||||
border border-gray-200 dark:border-neutral-700
|
|
||||||
rounded-lg shadow-lg
|
|
||||||
opacity-0 invisible -translate-y-1 transition-all duration-150
|
|
||||||
data-[open]:opacity-100 data-[open]:visible data-[open]:translate-y-0"> <a href="/spec/1.0.0-rc.5" role="option" aria-selected="false" class="block px-3 py-2 font-mono text-sm rounded transition-colors text-gray-600 dark:text-neutral-400 hover:bg-gray-100 dark:hover:bg-neutral-800 hover:text-gray-950 dark:hover:text-neutral-50">
|
|
||||||
v1.0.0-rc.5 </a><a href="/spec/1.0.0-rc.4" role="option" aria-selected="false" class="block px-3 py-2 font-mono text-sm rounded transition-colors text-gray-600 dark:text-neutral-400 hover:bg-gray-100 dark:hover:bg-neutral-800 hover:text-gray-950 dark:hover:text-neutral-50">
|
|
||||||
v1.0.0-rc.4 </a><a href="/spec/1.0.0-rc.3" role="option" aria-selected="false" class="block px-3 py-2 font-mono text-sm rounded transition-colors text-gray-600 dark:text-neutral-400 hover:bg-gray-100 dark:hover:bg-neutral-800 hover:text-gray-950 dark:hover:text-neutral-50">
|
|
||||||
v1.0.0-rc.3 </a><a href="/spec/1.0.0-rc.2" role="option" aria-selected="false" class="block px-3 py-2 font-mono text-sm rounded transition-colors text-gray-600 dark:text-neutral-400 hover:bg-gray-100 dark:hover:bg-neutral-800 hover:text-gray-950 dark:hover:text-neutral-50">
|
|
||||||
v1.0.0-rc.2 </a><a href="/spec/1.0.0-rc.1" role="option" aria-selected="true" class="block px-3 py-2 font-mono text-sm rounded transition-colors text-gray-600 dark:text-neutral-400 hover:bg-gray-100 dark:hover:bg-neutral-800 hover:text-gray-950 dark:hover:text-neutral-50 bg-sky-500/15 dark:bg-sky-500/20 text-sky-600 dark:text-sky-400">
|
|
||||||
v1.0.0-rc.1 </a> </div> </div> </div> <a href="#about" class="nav-link flex items-center justify-center gap-1.5 py-2
|
|
||||||
text-gray-600 dark:text-neutral-400 hover:text-sky-600" data-nav-link data-section-id="about"> <svg width="1em" height="1em" viewBox="0 0 24 24" class="w-4 h-4" data-icon="heroicons:information-circle"> <use href="#ai:heroicons:information-circle"></use> </svg> About </a><a href="#spec" class="nav-link flex items-center justify-center gap-1.5 py-2
|
|
||||||
text-gray-600 dark:text-neutral-400 hover:text-sky-600" data-nav-link data-section-id="spec"> <svg width="1em" height="1em" viewBox="0 0 24 24" class="w-4 h-4" data-icon="heroicons:document-text"> <use href="#ai:heroicons:document-text"></use> </svg> Spec </a><a href="#faq" class="nav-link flex items-center justify-center gap-1.5 py-2
|
|
||||||
text-gray-600 dark:text-neutral-400 hover:text-sky-600" data-nav-link data-section-id="faq"> <svg width="1em" height="1em" viewBox="0 0 24 24" class="w-4 h-4" data-icon="heroicons:question-mark-circle"> <use href="#ai:heroicons:question-mark-circle"></use> </svg> FAQ </a> </div> </nav> </header> <script type="module" src="/_astro/Header.astro_astro_type_script_index_0_lang.ClIJVJFM.js"></script> <main> <section id="hero" class="relative min-h-[75vh] flex flex-col items-center justify-center
|
|
||||||
px-6 pt-16 pb-24 overflow-hidden"> <!-- Background gradient/texture --> <div class="absolute inset-0 bg-gradient-to-b
|
|
||||||
from-gray-100 to-gray-50
|
|
||||||
dark:from-neutral-900 dark:to-neutral-950"></div> <!-- Subtle grid pattern with fade --> <div class="absolute inset-0 opacity-[0.06] dark:opacity-[0.12]
|
|
||||||
bg-[linear-gradient(theme(colors.gray.950)_1px,transparent_1px),linear-gradient(90deg,theme(colors.gray.950)_1px,transparent_1px)]
|
|
||||||
dark:bg-[linear-gradient(theme(colors.neutral.600)_1px,transparent_1px),linear-gradient(90deg,theme(colors.neutral.600)_1px,transparent_1px)]
|
|
||||||
bg-[size:60px_60px] bg-center
|
|
||||||
[-webkit-mask-image:linear-gradient(to_bottom,black_20%,transparent_80%)]
|
|
||||||
[mask-image:linear-gradient(to_bottom,black_20%,transparent_80%)]"></div> <!-- Top bar with version & theme --> <div class="absolute top-0 inset-x-0 z-20 flex items-center justify-between
|
|
||||||
px-6 py-4 animate-fade-in-down"> <div class="flex items-center gap-3"> <div class="relative" data-version-selector> <!-- Trigger button --> <button type="button" data-version-trigger aria-haspopup="listbox" aria-expanded="false" class="flex items-center gap-1.5 px-2.5 py-1.5 text-sm font-mono
|
|
||||||
border border-gray-200 dark:border-neutral-700
|
|
||||||
rounded-md bg-transparent cursor-pointer transition-colors
|
|
||||||
text-gray-600 dark:text-neutral-400
|
|
||||||
hover:border-sky-600 hover:text-gray-950 dark:hover:text-neutral-50"> <span>v1.0.0-rc.1</span> <svg width="1em" height="1em" viewBox="0 0 24 24" data-arrow-icon="true" class="w-3.5 h-3.5 transition-transform duration-150" data-icon="heroicons:chevron-down"> <use href="#ai:heroicons:chevron-down"></use> </svg> </button> <!-- Dropdown menu --> <div data-version-dropdown role="listbox" aria-label="Select version" class="absolute top-full left-0 mt-2 min-w-full p-1.5 z-50
|
|
||||||
bg-gray-50 dark:bg-neutral-900
|
|
||||||
border border-gray-200 dark:border-neutral-700
|
|
||||||
rounded-lg shadow-lg
|
|
||||||
opacity-0 invisible -translate-y-1 transition-all duration-150
|
|
||||||
data-[open]:opacity-100 data-[open]:visible data-[open]:translate-y-0"> <a href="/spec/1.0.0-rc.5" role="option" aria-selected="false" class="block px-3 py-2 font-mono text-sm rounded transition-colors text-gray-600 dark:text-neutral-400 hover:bg-gray-100 dark:hover:bg-neutral-800 hover:text-gray-950 dark:hover:text-neutral-50">
|
|
||||||
v1.0.0-rc.5 </a><a href="/spec/1.0.0-rc.4" role="option" aria-selected="false" class="block px-3 py-2 font-mono text-sm rounded transition-colors text-gray-600 dark:text-neutral-400 hover:bg-gray-100 dark:hover:bg-neutral-800 hover:text-gray-950 dark:hover:text-neutral-50">
|
|
||||||
v1.0.0-rc.4 </a><a href="/spec/1.0.0-rc.3" role="option" aria-selected="false" class="block px-3 py-2 font-mono text-sm rounded transition-colors text-gray-600 dark:text-neutral-400 hover:bg-gray-100 dark:hover:bg-neutral-800 hover:text-gray-950 dark:hover:text-neutral-50">
|
|
||||||
v1.0.0-rc.3 </a><a href="/spec/1.0.0-rc.2" role="option" aria-selected="false" class="block px-3 py-2 font-mono text-sm rounded transition-colors text-gray-600 dark:text-neutral-400 hover:bg-gray-100 dark:hover:bg-neutral-800 hover:text-gray-950 dark:hover:text-neutral-50">
|
|
||||||
v1.0.0-rc.2 </a><a href="/spec/1.0.0-rc.1" role="option" aria-selected="true" class="block px-3 py-2 font-mono text-sm rounded transition-colors text-gray-600 dark:text-neutral-400 hover:bg-gray-100 dark:hover:bg-neutral-800 hover:text-gray-950 dark:hover:text-neutral-50 bg-sky-500/15 dark:bg-sky-500/20 text-sky-600 dark:text-sky-400">
|
|
||||||
v1.0.0-rc.1 </a> </div> </div> </div> <div class="flex items-center gap-2"> <div class="relative group"> <button data-theme-toggle type="button" class="p-2 rounded-lg cursor-pointer transition-colors duration-200
|
|
||||||
text-gray-500 dark:text-neutral-500
|
|
||||||
hover:text-gray-950 dark:hover:text-neutral-50
|
|
||||||
hover:bg-gray-100 dark:hover:bg-neutral-800" aria-label="Toggle theme"> <svg width="1em" height="1em" viewBox="0 0 24 24" data-theme-icon="light" class="hidden w-5 h-5" data-icon="heroicons:sun"> <use href="#ai:heroicons:sun"></use> </svg> <svg width="1em" height="1em" viewBox="0 0 24 24" data-theme-icon="dark" class="hidden w-5 h-5" data-icon="heroicons:moon"> <use href="#ai:heroicons:moon"></use> </svg> <svg width="1em" height="1em" viewBox="0 0 24 24" data-theme-icon="auto" class="hidden w-5 h-5" data-icon="heroicons:computer-desktop"> <use href="#ai:heroicons:computer-desktop"></use> </svg> </button> <!-- Tooltip --> <div class="absolute left-1/2 -translate-x-1/2 top-full mt-2
|
|
||||||
px-2 py-1 text-xs font-medium whitespace-nowrap rounded-md shadow-sm
|
|
||||||
bg-gray-900 text-white dark:bg-white dark:text-gray-900
|
|
||||||
opacity-0 group-hover:opacity-100
|
|
||||||
transition-opacity duration-200 pointer-events-none"> <span data-tooltip-text="light" class="hidden">Light</span> <span data-tooltip-text="dark" class="hidden">Dark</span> <span data-tooltip-text="auto" class="hidden">System</span> </div> </div> <a href="https://github.com/jimeh/common-flow" target="_blank" rel="noopener noreferrer" class="p-2 rounded-lg transition-colors
|
|
||||||
text-gray-500 dark:text-neutral-500
|
|
||||||
hover:text-gray-950 dark:hover:text-neutral-50
|
|
||||||
hover:bg-white/50 dark:hover:bg-neutral-800/50" aria-label="View on GitHub"> <svg width="1em" height="1em" viewBox="0 0 24 24" class="w-5 h-5" data-icon="simple-icons:github"> <use href="#ai:simple-icons:github"></use> </svg> </a> </div> </div> <!-- Main content --> <div class="relative z-10 w-full max-w-4xl mx-auto text-center"> <!-- Title --> <h1 class="animate-fade-in-up mb-4
|
|
||||||
text-gray-950 dark:text-neutral-50">
|
|
||||||
Git Common-Flow
|
|
||||||
</h1> <!-- Tagline --> <p class="animate-fade-in-up delay-100
|
|
||||||
text-lg sm:text-xl max-w-2xl mx-auto mb-8
|
|
||||||
text-gray-600 dark:text-neutral-400">
|
|
||||||
A sensible git workflow for teams who ship
|
|
||||||
</p> <!-- Version badge --> <div class="animate-fade-in-up delay-200 mb-10"> <span class="inline-flex items-center px-3 py-1 font-mono text-xs font-medium
|
|
||||||
rounded-full border
|
|
||||||
bg-gray-100 border-gray-200 text-gray-500
|
|
||||||
dark:bg-neutral-800/50 dark:border-neutral-700 dark:text-neutral-400">
|
|
||||||
v1.0.0-rc.1 </span> </div> <!-- SVG Diagram --> <div class="animate-fade-in-up delay-300
|
|
||||||
relative mx-auto mb-12 p-4 sm:p-8
|
|
||||||
bg-white dark:bg-neutral-900
|
|
||||||
rounded-2xl shadow-lg dark:shadow-none
|
|
||||||
border border-gray-200 dark:border-neutral-800"> <img src="/spec/1.0.0-rc.1.svg" alt="Git Common-Flow diagram" class="w-full h-auto max-w-3xl mx-auto
|
|
||||||
dark:invert dark:hue-rotate-180 dark:contrast-90"> </div> <!-- Navigation links --> <nav class="animate-fade-in-up delay-400
|
|
||||||
flex flex-wrap items-center justify-center gap-4"> <a href="#about" class="inline-flex items-center justify-center gap-2 px-6 py-3
|
|
||||||
text-base font-medium rounded-lg transition-all cursor-pointer
|
|
||||||
text-gray-600 dark:text-neutral-400
|
|
||||||
hover:bg-gray-100 hover:text-gray-950
|
|
||||||
dark:hover:bg-neutral-800 dark:hover:text-neutral-50">
|
|
||||||
About
|
|
||||||
</a> <a href="#spec" class="inline-flex items-center justify-center gap-2 px-6 py-3
|
|
||||||
text-base font-medium rounded-lg transition-all cursor-pointer
|
|
||||||
bg-sky-600 text-white
|
|
||||||
hover:bg-sky-500 hover:-translate-y-0.5 hover:shadow-md">
|
|
||||||
Read the Spec
|
|
||||||
</a> <a href="#faq" class="inline-flex items-center justify-center gap-2 px-6 py-3
|
|
||||||
text-base font-medium rounded-lg transition-all cursor-pointer
|
|
||||||
text-gray-600 dark:text-neutral-400
|
|
||||||
hover:bg-gray-100 hover:text-gray-950
|
|
||||||
dark:hover:bg-neutral-800 dark:hover:text-neutral-50">
|
|
||||||
FAQ
|
|
||||||
</a> </nav> </div> <!-- Scroll indicator --> <a href="#about" class="absolute bottom-8 left-1/2 -translate-x-1/2
|
|
||||||
animate-fade-in delay-700
|
|
||||||
text-gray-500 dark:text-neutral-500
|
|
||||||
hover:text-sky-600 transition-colors" aria-label="Scroll to content"> <svg width="1em" height="1em" class="w-6 h-6 animate-bounce-subtle" data-icon="heroicons:arrow-down"> <symbol id="ai:heroicons:arrow-down" viewBox="0 0 24 24"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M19.5 13.5L12 21m0 0l-7.5-7.5M12 21V3"/></symbol><use href="#ai:heroicons:arrow-down"></use> </svg> </a> </section> <section id="about" class="py-20 sm:py-28"> <div class="section-container"> <div class="max-w-3xl mx-auto"> <div class="mb-12 text-center"> <h2 class="text-3xl sm:text-4xl mb-4">About Common-Flow</h2> <p class="text-lg text-gray-600 dark:text-neutral-400"> A practical git workflow that combines the best of GitHub Flow with versioned releases </p> </div> <!-- Introduction --> <div class="prose-spec mb-12"></div> <!-- Summary as feature cards --> <div class="mb-16"> <h3 class="text-xl font-display font-semibold mb-6
|
|
||||||
text-gray-950 dark:text-neutral-50">
|
|
||||||
Key Principles
|
|
||||||
</h3> <div class="prose-spec"><p>Common-Flow is an attempt to gather a sensible selection of the most common
|
|
||||||
usage patterns of git into a single and concise specification. It is based on
|
|
||||||
the <a href="http://scottchacon.com/2011/08/31/github-flow.html">original variant</a>
|
|
||||||
of <a href="https://guides.github.com/introduction/flow/">GitHub Flow</a>, while taking
|
|
||||||
into account how a lot of open source projects use git.</p>
|
|
||||||
<p>TL;DR: Common-Flow is basically GitHub Flow with the addition of versioned
|
|
||||||
releases, maintenance releases for old versions, and without the requirement to
|
|
||||||
deploy to production all the time.</p></div> </div> <!-- Feedback & License --> <div class="pt-8 border-t border-gray-200 dark:border-neutral-800"> <div class="grid sm:grid-cols-2 gap-8"> <div> <h4 class="text-sm font-semibold uppercase tracking-wider mb-3
|
|
||||||
text-gray-500 dark:text-neutral-500">
|
|
||||||
Feedback
|
|
||||||
</h4> <p class="text-gray-600 dark:text-neutral-400">
|
|
||||||
Please <a href="https://github.com/jimeh/common-flow/issues" class="text-sky-600 hover:text-sky-400" target="_blank" rel="noopener noreferrer">open an issue on GitHub</a>.
|
|
||||||
</p> </div> <div> <h4 class="text-sm font-semibold uppercase tracking-wider mb-3
|
|
||||||
text-gray-500 dark:text-neutral-500">
|
|
||||||
License
|
|
||||||
</h4> <div class="text-gray-600 dark:text-neutral-400"><p><a href="http://creativecommons.org/licenses/by/3.0/">Creative Commons - CC BY 3.0</a></p></div> </div> </div> </div> </div> </div> </section> <section id="spec" class="py-20 sm:py-28"> <div class="section-container"> <div class="mb-12 text-center max-w-3xl mx-auto"> <h2 class="text-3xl sm:text-4xl mb-4">The Specification</h2> <p class="text-lg text-gray-600 dark:text-neutral-400"> The complete Git Common-Flow specification </p> </div> <!-- Content with sidebar --> <div class="lg:flex lg:gap-8"> <!-- Sidebar --> <div class="lg:w-64 lg:flex-shrink-0"> <aside id="spec-sidebar" class="hidden lg:block lg:sticky lg:top-24 lg:self-start
|
|
||||||
lg:max-h-[calc(100vh-8rem)] lg:overflow-y-auto
|
|
||||||
lg:pr-8 lg:mr-8 lg:border-r border-gray-200 dark:border-neutral-800"> <nav class="space-y-1 py-2"> <div class="text-xs font-semibold uppercase tracking-wider mb-4
|
|
||||||
text-gray-500 dark:text-neutral-500">
|
|
||||||
Table of Contents
|
|
||||||
</div> <a href="#terminology" class="sidebar-link block py-2 px-4 text-sm rounded-md transition-colors text-gray-500 hover:text-gray-950 hover:bg-gray-100 dark:text-neutral-500 dark:hover:text-neutral-50 dark:hover:bg-neutral-800" data-sidebar-link data-section-id="terminology"> <span>Terminology</span> </a><a href="#specification" class="sidebar-link block py-2 px-4 text-sm rounded-md transition-colors text-gray-500 hover:text-gray-950 hover:bg-gray-100 dark:text-neutral-500 dark:hover:text-neutral-50 dark:hover:bg-neutral-800" data-sidebar-link data-section-id="specification"> <span>Specification</span> </a><a href="#spec-the-master-branch" class="sidebar-link block py-2 px-4 text-sm rounded-md transition-colors text-gray-500 hover:text-gray-950 hover:bg-gray-100 dark:text-neutral-500 dark:hover:text-neutral-50 dark:hover:bg-neutral-800 pl-6 text-[0.8125rem] flex" data-sidebar-link data-section-id="spec-the-master-branch"> <span class="shrink-0 w-6 text-gray-400 dark:text-neutral-600"> 1. </span> <span>The Master Branch</span> </a><a href="#spec-changes" class="sidebar-link block py-2 px-4 text-sm rounded-md transition-colors text-gray-500 hover:text-gray-950 hover:bg-gray-100 dark:text-neutral-500 dark:hover:text-neutral-50 dark:hover:bg-neutral-800 pl-6 text-[0.8125rem] flex" data-sidebar-link data-section-id="spec-changes"> <span class="shrink-0 w-6 text-gray-400 dark:text-neutral-600"> 2. </span> <span>Changes</span> </a><a href="#spec-git-best-practices" class="sidebar-link block py-2 px-4 text-sm rounded-md transition-colors text-gray-500 hover:text-gray-950 hover:bg-gray-100 dark:text-neutral-500 dark:hover:text-neutral-50 dark:hover:bg-neutral-800 pl-6 text-[0.8125rem] flex" data-sidebar-link data-section-id="spec-git-best-practices"> <span class="shrink-0 w-6 text-gray-400 dark:text-neutral-600"> 3. </span> <span>Git Best Practices</span> </a><a href="#spec-versioning" class="sidebar-link block py-2 px-4 text-sm rounded-md transition-colors text-gray-500 hover:text-gray-950 hover:bg-gray-100 dark:text-neutral-500 dark:hover:text-neutral-50 dark:hover:bg-neutral-800 pl-6 text-[0.8125rem] flex" data-sidebar-link data-section-id="spec-versioning"> <span class="shrink-0 w-6 text-gray-400 dark:text-neutral-600"> 4. </span> <span>Versioning</span> </a><a href="#spec-releases" class="sidebar-link block py-2 px-4 text-sm rounded-md transition-colors text-gray-500 hover:text-gray-950 hover:bg-gray-100 dark:text-neutral-500 dark:hover:text-neutral-50 dark:hover:bg-neutral-800 pl-6 text-[0.8125rem] flex" data-sidebar-link data-section-id="spec-releases"> <span class="shrink-0 w-6 text-gray-400 dark:text-neutral-600"> 5. </span> <span>Releases</span> </a><a href="#spec-bug-fixes-rollback" class="sidebar-link block py-2 px-4 text-sm rounded-md transition-colors text-gray-500 hover:text-gray-950 hover:bg-gray-100 dark:text-neutral-500 dark:hover:text-neutral-50 dark:hover:bg-neutral-800 pl-6 text-[0.8125rem] flex" data-sidebar-link data-section-id="spec-bug-fixes-rollback"> <span class="shrink-0 w-6 text-gray-400 dark:text-neutral-600"> 6. </span> <span>Bug Fixes & Rollback</span> </a><a href="#spec-maintenance-releases" class="sidebar-link block py-2 px-4 text-sm rounded-md transition-colors text-gray-500 hover:text-gray-950 hover:bg-gray-100 dark:text-neutral-500 dark:hover:text-neutral-50 dark:hover:bg-neutral-800 pl-6 text-[0.8125rem] flex" data-sidebar-link data-section-id="spec-maintenance-releases"> <span class="shrink-0 w-6 text-gray-400 dark:text-neutral-600"> 7. </span> <span>Maintenance Releases</span> </a> </nav> </aside> <!-- Mobile floating button --> <button id="spec-toc-toggle" class="lg:hidden fixed bottom-6 right-6 z-40
|
|
||||||
w-12 h-12 rounded-full shadow-lg
|
|
||||||
bg-sky-600 text-white
|
|
||||||
flex items-center justify-center
|
|
||||||
hover:bg-sky-500
|
|
||||||
transition-all duration-200" aria-label="Jump to section"> <svg width="1em" height="1em" class="w-5 h-5" data-icon="heroicons:bars-3-bottom-left"> <symbol id="ai:heroicons:bars-3-bottom-left" viewBox="0 0 24 24"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25H12"/></symbol><use href="#ai:heroicons:bars-3-bottom-left"></use> </svg> </button> <!-- Mobile TOC drawer --> <div id="spec-toc-drawer" class="lg:hidden fixed inset-0 z-50 hidden" data-toc-drawer> <!-- Backdrop --> <div class="absolute inset-0 bg-black/50" data-toc-backdrop></div> <!-- Drawer --> <div class="absolute bottom-0 inset-x-0 max-h-[70vh] overflow-y-auto
|
|
||||||
bg-gray-50 dark:bg-neutral-950
|
|
||||||
rounded-t-2xl shadow-xl p-6"> <div class="flex items-center justify-between mb-4"> <span class="text-sm font-semibold uppercase tracking-wider
|
|
||||||
text-gray-500 dark:text-neutral-500">
|
|
||||||
Jump to Section
|
|
||||||
</span> <button class="p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-neutral-800" data-toc-close aria-label="Close"> <svg width="1em" height="1em" class="w-5 h-5" data-icon="heroicons:x-mark"> <symbol id="ai:heroicons:x-mark" viewBox="0 0 24 24"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M6 18L18 6M6 6l12 12"/></symbol><use href="#ai:heroicons:x-mark"></use> </svg> </button> </div> <nav class="space-y-1"> <a href="#terminology" class="sidebar-link block py-2 px-4 text-sm rounded-md transition-colors text-gray-500 hover:text-gray-950 hover:bg-gray-100 dark:text-neutral-500 dark:hover:text-neutral-50 dark:hover:bg-neutral-800" data-toc-link> <span>Terminology</span> </a><a href="#specification" class="sidebar-link block py-2 px-4 text-sm rounded-md transition-colors text-gray-500 hover:text-gray-950 hover:bg-gray-100 dark:text-neutral-500 dark:hover:text-neutral-50 dark:hover:bg-neutral-800" data-toc-link> <span>Specification</span> </a><a href="#spec-the-master-branch" class="sidebar-link block py-2 px-4 text-sm rounded-md transition-colors text-gray-500 hover:text-gray-950 hover:bg-gray-100 dark:text-neutral-500 dark:hover:text-neutral-50 dark:hover:bg-neutral-800 pl-6 text-[0.8125rem] flex" data-toc-link> <span class="shrink-0 w-6 text-gray-400 dark:text-neutral-600"> 1. </span> <span>The Master Branch</span> </a><a href="#spec-changes" class="sidebar-link block py-2 px-4 text-sm rounded-md transition-colors text-gray-500 hover:text-gray-950 hover:bg-gray-100 dark:text-neutral-500 dark:hover:text-neutral-50 dark:hover:bg-neutral-800 pl-6 text-[0.8125rem] flex" data-toc-link> <span class="shrink-0 w-6 text-gray-400 dark:text-neutral-600"> 2. </span> <span>Changes</span> </a><a href="#spec-git-best-practices" class="sidebar-link block py-2 px-4 text-sm rounded-md transition-colors text-gray-500 hover:text-gray-950 hover:bg-gray-100 dark:text-neutral-500 dark:hover:text-neutral-50 dark:hover:bg-neutral-800 pl-6 text-[0.8125rem] flex" data-toc-link> <span class="shrink-0 w-6 text-gray-400 dark:text-neutral-600"> 3. </span> <span>Git Best Practices</span> </a><a href="#spec-versioning" class="sidebar-link block py-2 px-4 text-sm rounded-md transition-colors text-gray-500 hover:text-gray-950 hover:bg-gray-100 dark:text-neutral-500 dark:hover:text-neutral-50 dark:hover:bg-neutral-800 pl-6 text-[0.8125rem] flex" data-toc-link> <span class="shrink-0 w-6 text-gray-400 dark:text-neutral-600"> 4. </span> <span>Versioning</span> </a><a href="#spec-releases" class="sidebar-link block py-2 px-4 text-sm rounded-md transition-colors text-gray-500 hover:text-gray-950 hover:bg-gray-100 dark:text-neutral-500 dark:hover:text-neutral-50 dark:hover:bg-neutral-800 pl-6 text-[0.8125rem] flex" data-toc-link> <span class="shrink-0 w-6 text-gray-400 dark:text-neutral-600"> 5. </span> <span>Releases</span> </a><a href="#spec-bug-fixes-rollback" class="sidebar-link block py-2 px-4 text-sm rounded-md transition-colors text-gray-500 hover:text-gray-950 hover:bg-gray-100 dark:text-neutral-500 dark:hover:text-neutral-50 dark:hover:bg-neutral-800 pl-6 text-[0.8125rem] flex" data-toc-link> <span class="shrink-0 w-6 text-gray-400 dark:text-neutral-600"> 6. </span> <span>Bug Fixes & Rollback</span> </a><a href="#spec-maintenance-releases" class="sidebar-link block py-2 px-4 text-sm rounded-md transition-colors text-gray-500 hover:text-gray-950 hover:bg-gray-100 dark:text-neutral-500 dark:hover:text-neutral-50 dark:hover:bg-neutral-800 pl-6 text-[0.8125rem] flex" data-toc-link> <span class="shrink-0 w-6 text-gray-400 dark:text-neutral-600"> 7. </span> <span>Maintenance Releases</span> </a> </nav> </div> </div> <script type="module" src="/_astro/SpecSidebar.astro_astro_type_script_index_0_lang.BQBj5HuJ.js"></script> </div> <!-- Main content --> <div class="flex-1 min-w-0"> <article class="prose-spec"> <!-- Terminology --> <section id="terminology"> <h2>Terminology</h2> <ul>
|
|
||||||
<li><strong>Master Branch</strong> - Must always have passing tests, is considered bleeding
|
|
||||||
edge, and must be named <code>master</code>.</li>
|
|
||||||
<li><strong>Change Branches</strong> - Any branch that introduces changes like a new feature, a
|
|
||||||
bug fix, etc.</li>
|
|
||||||
<li><strong>Source Branch</strong> - The branch that a change branch was created from. New
|
|
||||||
changes in the source branch should be incorporated into the change branch via
|
|
||||||
rebasing.</li>
|
|
||||||
<li><strong>Merge Target</strong> - A branch that is the intended merge target for a change
|
|
||||||
branch. Typically the merge target branch will be the same as the source
|
|
||||||
branch.</li>
|
|
||||||
<li><strong>Maintenance Branches</strong> - Used for maintaining old versions and releasing
|
|
||||||
PATCH updates when the master branch has moved on. Should follow a
|
|
||||||
<code>stable-X.Y</code> naming pattern, where <code>X</code> is MAJOR version and <code>Y</code> is MINOR
|
|
||||||
version.</li>
|
|
||||||
<li><strong>Pull Request</strong> - A means of requesting that a change branch is merged in to
|
|
||||||
its merge target, allowing others to review, discuss and approve the changes.</li>
|
|
||||||
<li><strong>Release</strong> - Consists of a version bump commit directly on the master branch,
|
|
||||||
and a git tag named according to the new version string placed on said commit.</li>
|
|
||||||
<li><strong>Maintenance Release</strong> - Just like a regular release, except the version bump
|
|
||||||
commit and release tag are on a maintenance branch instead of the master
|
|
||||||
branch.</li>
|
|
||||||
</ul> </section> <!-- Main specification --> <section id="specification"> <h2>Specification</h2> <p>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD",
|
|
||||||
"SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be
|
|
||||||
interpreted as described in <a href="https://tools.ietf.org/html/rfc2119">RFC 2119</a>.</p>
|
|
||||||
<ol>
|
|
||||||
<li id="spec-the-master-branch">The Master Branch
|
|
||||||
<ol>
|
|
||||||
<li>A branch named "master" MUST exist and it MUST be referred to as the
|
|
||||||
"master branch".</li>
|
|
||||||
<li>The master branch MUST be considered bleeding edge.</li>
|
|
||||||
<li>The master branch MUST always be in a non-broken state with its test
|
|
||||||
suite passing.</li>
|
|
||||||
<li>The master branch SHOULD always be in a "as near as possible ready for
|
|
||||||
release/production" state to reduce the friction of creating a new
|
|
||||||
release.</li>
|
|
||||||
</ol>
|
|
||||||
</li>
|
|
||||||
<li id="spec-changes">Changes
|
|
||||||
<ol>
|
|
||||||
<li>Changes MUST be performed on a separate branch that SHOULD be referred to
|
|
||||||
as a "change branch". All change branches MUST have descriptive names. It
|
|
||||||
is RECOMMENDED that you commit often locally, and you SHOULD regularly
|
|
||||||
push your work to the same named branch on the remote server.</li>
|
|
||||||
<li>When a change branch is created, the branch that it is created from
|
|
||||||
SHOULD be referred to as the "source branch". Each change branch also
|
|
||||||
needs a designated "merge target branch", typically this will be the same
|
|
||||||
as the source branch.</li>
|
|
||||||
<li>Change branches MUST be regularly updated with any changes from their
|
|
||||||
source branch. This MUST be done by rebasing the change branch on top of
|
|
||||||
the source branch. To be clear you MUST NOT merge a source branch into a
|
|
||||||
change branch.</li>
|
|
||||||
<li>After rebasing a change branch on top of its source branch you MUST push
|
|
||||||
the change branch to the remote server. This will require you do a force
|
|
||||||
push, and you SHOULD use the "--force-with-lease" git push option.</li>
|
|
||||||
<li>To merge a change branch into its merge target branch, you MUST open a
|
|
||||||
"pull request" (or equivalent) so others can review and approve your
|
|
||||||
changes.</li>
|
|
||||||
<li>A pull request MUST only be merged when the change branch is up-to-date
|
|
||||||
with its source branch, the test suite is passing, and you and others are
|
|
||||||
happy with the change. This is especially important if the merge target
|
|
||||||
is the master branch.</li>
|
|
||||||
<li>To get feedback, help, or generally just discuss a change branch with
|
|
||||||
others, it is RECOMMENDED you do this by creating a pull request and
|
|
||||||
discuss the changes with others there.</li>
|
|
||||||
</ol>
|
|
||||||
</li>
|
|
||||||
<li id="spec-git-best-practices">Git Best Practices
|
|
||||||
<ol>
|
|
||||||
<li>All commit messages SHOULD follow the Commit Guidelines and format from
|
|
||||||
the official git
|
|
||||||
documentation:
|
|
||||||
<a href="https://git-scm.com/book/en/v2/Distributed-Git-Contributing-to-a-Project">https://git-scm.com/book/en/v2/Distributed-Git-Contributing-to-a-Project</a></li>
|
|
||||||
<li>You SHOULD always use "--force-with-lease" when doing a force push. The
|
|
||||||
plain "--force" option is dangerous and destructive. More
|
|
||||||
information:
|
|
||||||
<a href="https://developer.atlassian.com/blog/2015/04/force-with-lease/">https://developer.atlassian.com/blog/2015/04/force-with-lease/</a></li>
|
|
||||||
<li>You SHOULD understand and be comfortable with
|
|
||||||
rebasing: <a href="https://git-scm.com/book/en/v2/Git-Branching-Rebasing">https://git-scm.com/book/en/v2/Git-Branching-Rebasing</a></li>
|
|
||||||
<li>It is RECOMMENDED that you always do "git pull --rebase" instead of "git
|
|
||||||
pull" to avoid unnecessary merge commits. You can make this the default
|
|
||||||
behavior of "git pull" with "git config --global pull.rebase true".</li>
|
|
||||||
<li>It is RECOMMENDED that all branches be merged using "git merge --no-ff".
|
|
||||||
This makes sure the reference to the original branch is kept in the commits,
|
|
||||||
allows one to revert a merge by reverting a single merge commit, and creates
|
|
||||||
a merge commit to mark the integration of the branch with master.</li>
|
|
||||||
</ol>
|
|
||||||
</li>
|
|
||||||
<li id="spec-versioning">Versioning
|
|
||||||
<ol>
|
|
||||||
<li>The project MUST have its version hard-coded somewhere in the
|
|
||||||
code-base. It is RECOMMENDED that this is done in a file called "VERSION"
|
|
||||||
located in the root of the project.</li>
|
|
||||||
<li>If you are using a "VERSION" file in the root of the project, this MUST
|
|
||||||
only contain the exact version string.</li>
|
|
||||||
<li>The version string SHOULD follow the Semantic Versioning
|
|
||||||
(<a href="http://semver.org/">http://semver.org/</a>) format. Use of Semantic Versioning is OPTIONAL,
|
|
||||||
but the version string MUST NOT have a "v" prefix. For example "v2.11.4"
|
|
||||||
is bad, and "2.11.4" is good.</li>
|
|
||||||
</ol>
|
|
||||||
</li>
|
|
||||||
<li id="spec-releases">Releases
|
|
||||||
<ol>
|
|
||||||
<li>To create a new release, you MUST create a "version bump" commit directly
|
|
||||||
on the master branch which changes the hard-coded version value of the
|
|
||||||
project. The version bump commit MUST have a git tag created on it and
|
|
||||||
named as the exact version string.</li>
|
|
||||||
<li>A version bump commit MUST have a commit message title of "Bump version
|
|
||||||
to VERSION". For example, if the new version string is "2.11.4", the
|
|
||||||
first line of the commit message MUST read: "Bump version to 2.11.4"</li>
|
|
||||||
<li>The release tag on the version bump commit MUST be named exactly the same
|
|
||||||
as the version string. The tag name can OPTIONALLY be prefixed with
|
|
||||||
"v". For example the tag name can be either "2.11.4" or "v2.11.4".</li>
|
|
||||||
<li>It is RECOMMENDED that release tags are lightweight tags, but you can
|
|
||||||
OPTIONALLY use annotated tags if you want to include changelog
|
|
||||||
information in the release tag itself.</li>
|
|
||||||
<li>If you use annotated release tags, the first line of the annotation MUST
|
|
||||||
read "Release VERSION". For example for version "2.11.4" the first line
|
|
||||||
of the tag annotation would read "Release 2.11.4". The second line must
|
|
||||||
be blank, and the changelog MUST start on the third line.</li>
|
|
||||||
</ol>
|
|
||||||
</li>
|
|
||||||
<li id="spec-bug-fixes-rollback">Bug Fixes & Rollback
|
|
||||||
<ol>
|
|
||||||
<li>You MUST NOT under any circumstances force push to the master branch.</li>
|
|
||||||
<li>If a change branch which has been merged in to the master branch is found
|
|
||||||
to have a bug in it, the bug fix work MUST be done as a new separate
|
|
||||||
change branch and MUST follow the same workflow as any other change
|
|
||||||
branch.</li>
|
|
||||||
<li>If a change branch is wrongfully merged in to master, or for any other
|
|
||||||
reason the merge must be undone, you MUST undo the merge by reverting the
|
|
||||||
merge commit itself. Effectively creating a new commit that reverses all
|
|
||||||
the relevant changes.</li>
|
|
||||||
</ol>
|
|
||||||
</li>
|
|
||||||
<li id="spec-maintenance-releases">Maintenance Releases
|
|
||||||
<ol>
|
|
||||||
<li>Any branch that has a name starting with "stable-" SHOULD be referred to
|
|
||||||
as a "maintenance branch".</li>
|
|
||||||
<li>Maintenance branches are used for managing new releases of older
|
|
||||||
versions. Typically this is used to provide security updates for older
|
|
||||||
versions when the master branch has moved on to a point that a new
|
|
||||||
release for the old version cannot be made from the master branch.</li>
|
|
||||||
<li>A "maintenance release" is identical to a regular release, except the
|
|
||||||
version bump commit and the release tag are placed on the maintenance
|
|
||||||
branch instead of on the master branch.</li>
|
|
||||||
<li>A maintenance branch SHOULD follow a "stable-X.Y" naming pattern, where
|
|
||||||
"X" is the MAJOR version and "Y" is the minor version.</li>
|
|
||||||
<li>A maintenance branch MUST be created from the relevant release tag. For
|
|
||||||
example if there is a security fix for all 2.9.x releases, the latest of
|
|
||||||
which is "2.9.7", we create a new branch called "stable-2.9" off of the
|
|
||||||
"2.9.7" release tag. The security fix release will then end up being
|
|
||||||
version "2.9.8".</li>
|
|
||||||
<li>When working on a maintenance release, the relevant maintenance branch
|
|
||||||
MUST be thought of as the master branch for that maintenance work.</li>
|
|
||||||
<li>Changes in a maintenance branch SHOULD typically come from work being
|
|
||||||
done against the master branch. Meaning changes SHOULD only trickle
|
|
||||||
downwards from the master branch. If a change needs to trickle back up
|
|
||||||
into the master branch, that work should have happened against the master
|
|
||||||
branch in the first place.</li>
|
|
||||||
</ol>
|
|
||||||
</li>
|
|
||||||
</ol> </section> </article> </div> </div> </div> </section> <section id="faq" class="py-20 sm:py-28"> <div class="section-container"> <div class="max-w-3xl mx-auto"> <div class="mb-12 text-center"> <h2 class="text-3xl sm:text-4xl mb-4">FAQ</h2> <p class="text-lg text-gray-600 dark:text-neutral-400"> Common questions about Git Common-Flow </p> </div> <!-- FAQ Items --> <div class="space-y-0"> </div> </div> </div> </section> <script type="module">function n(){document.querySelectorAll("[data-faq-item]").forEach(r=>{const t=r.querySelector("[data-faq-trigger]"),a=r.querySelector("[data-faq-content]"),s=r.querySelector("[data-faq-icon]");!t||!a||!s||t.addEventListener("click",()=>{const e=t.getAttribute("aria-expanded")==="true";t.setAttribute("aria-expanded",e?"false":"true"),a.classList.toggle("grid-rows-[1fr]",!e),a.classList.toggle("grid-rows-[0fr]",e),s.classList.toggle("rotate-180",!e)})})}n();document.addEventListener("astro:after-swap",n);</script> </main> <footer class="pt-12 pb-6 my-28 text-sm
|
|
||||||
text-gray-500 dark:text-neutral-500
|
|
||||||
border-t border-gray-200 dark:border-neutral-800"> <div class="section-container flex flex-col sm:flex-row
|
|
||||||
sm:justify-between sm:items-center gap-2"> <p>
|
|
||||||
License:
|
|
||||||
<a href="https://creativecommons.org/licenses/by/4.0/" class="hover:text-sky-600" target="_blank" rel="noopener noreferrer"> CC BY 4.0 </a> </p> <p> Git Common-Flow by
|
|
||||||
<a href="https://jimeh.me/" class="hover:text-sky-600" target="_blank" rel="noopener noreferrer"> Jim Myhrberg </a> </p> </div> </footer> <!-- Re-init theme on Astro page transitions --> <script type="module">document.addEventListener("astro:after-swap",()=>{const e=localStorage.getItem("theme"),t=window.matchMedia("(prefers-color-scheme: dark)").matches;e==="dark"||e!=="light"&&t?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")});</script> </body> </html>
|
|
||||||
|
Before Width: | Height: | Size: 18 KiB |
@@ -1,377 +0,0 @@
|
|||||||
<!DOCTYPE html><html lang="en"> <head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><link rel="canonical" href="https://commonflow.org/spec/1.0.0-rc.2/"><title>Git Common-Flow 1.0.0-rc.2 | Git Common-Flow</title><meta name="description" content="An attempt to gather a sensible selection of the most common usage patterns of git into a single and concise specification."><meta name="author" content="Jim Myhrberg"><!-- Open Graph --><meta property="og:title" content="Git Common-Flow 1.0.0-rc.2 | Git Common-Flow"><meta property="og:description" content="An attempt to gather a sensible selection of the most common usage patterns of git into a single and concise specification."><meta property="og:type" content="website"><meta property="og:url" content="https://commonflow.org/spec/1.0.0-rc.2/"><!-- Twitter --><meta name="twitter:card" content="summary"><meta name="twitter:title" content="Git Common-Flow 1.0.0-rc.2 | Git Common-Flow"><meta name="twitter:description" content="An attempt to gather a sensible selection of the most common usage patterns of git into a single and concise specification."><!-- Favicon --><link rel="icon" href="/favicon.ico" sizes="32x32"><link rel="icon" href="/favicon.svg" type="image/svg+xml"><link rel="apple-touch-icon" href="/apple-touch-icon.png"><!-- Prevent flash of wrong theme --><script>
|
|
||||||
(function () {
|
|
||||||
const mode = localStorage.getItem("theme");
|
|
||||||
const prefersDark = window.matchMedia(
|
|
||||||
"(prefers-color-scheme: dark)",
|
|
||||||
).matches;
|
|
||||||
if (mode === "dark" || (mode !== "light" && prefersDark)) {
|
|
||||||
document.documentElement.classList.add("dark");
|
|
||||||
}
|
|
||||||
})();
|
|
||||||
</script><link rel="stylesheet" href="/_astro/index.DF_wxGza.css"></head> <body class="min-h-screen"> <header id="site-header" class="fixed top-0 inset-x-0 z-50 border-b border-transparent
|
|
||||||
translate-y-[-100%] transition-transform duration-300
|
|
||||||
backdrop-blur-xl bg-gray-50/85 dark:bg-neutral-950/85"> <div class="max-w-6xl mx-auto px-4 sm:px-6 h-16 flex items-center justify-between"> <!-- Logo / Title + Version --> <div class="flex items-center gap-3"> <a href="#hero" class="flex items-center gap-3 no-underline
|
|
||||||
text-gray-950 dark:text-neutral-50
|
|
||||||
hover:text-sky-600 transition-colors"> <span class="font-display font-bold text-lg tracking-tight">
|
|
||||||
Git Common-Flow
|
|
||||||
</span> </a> <div class="hidden md:block"> <div class="relative" data-version-selector> <!-- Trigger button --> <button type="button" data-version-trigger aria-haspopup="listbox" aria-expanded="false" class="flex items-center gap-1.5 px-2.5 py-1.5 text-sm font-mono
|
|
||||||
border border-gray-200 dark:border-neutral-700
|
|
||||||
rounded-md bg-transparent cursor-pointer transition-colors
|
|
||||||
text-gray-600 dark:text-neutral-400
|
|
||||||
hover:border-sky-600 hover:text-gray-950 dark:hover:text-neutral-50"> <span>v1.0.0-rc.2</span> <svg width="1em" height="1em" data-arrow-icon="true" class="w-3.5 h-3.5 transition-transform duration-150" data-icon="heroicons:chevron-down"> <symbol id="ai:heroicons:chevron-down" viewBox="0 0 24 24"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="m19.5 8.25l-7.5 7.5l-7.5-7.5"/></symbol><use href="#ai:heroicons:chevron-down"></use> </svg> </button> <!-- Dropdown menu --> <div data-version-dropdown role="listbox" aria-label="Select version" class="absolute top-full left-0 mt-2 min-w-full p-1.5 z-50
|
|
||||||
bg-gray-50 dark:bg-neutral-900
|
|
||||||
border border-gray-200 dark:border-neutral-700
|
|
||||||
rounded-lg shadow-lg
|
|
||||||
opacity-0 invisible -translate-y-1 transition-all duration-150
|
|
||||||
data-[open]:opacity-100 data-[open]:visible data-[open]:translate-y-0"> <a href="/spec/1.0.0-rc.5" role="option" aria-selected="false" class="block px-3 py-2 font-mono text-sm rounded transition-colors text-gray-600 dark:text-neutral-400 hover:bg-gray-100 dark:hover:bg-neutral-800 hover:text-gray-950 dark:hover:text-neutral-50">
|
|
||||||
v1.0.0-rc.5 </a><a href="/spec/1.0.0-rc.4" role="option" aria-selected="false" class="block px-3 py-2 font-mono text-sm rounded transition-colors text-gray-600 dark:text-neutral-400 hover:bg-gray-100 dark:hover:bg-neutral-800 hover:text-gray-950 dark:hover:text-neutral-50">
|
|
||||||
v1.0.0-rc.4 </a><a href="/spec/1.0.0-rc.3" role="option" aria-selected="false" class="block px-3 py-2 font-mono text-sm rounded transition-colors text-gray-600 dark:text-neutral-400 hover:bg-gray-100 dark:hover:bg-neutral-800 hover:text-gray-950 dark:hover:text-neutral-50">
|
|
||||||
v1.0.0-rc.3 </a><a href="/spec/1.0.0-rc.2" role="option" aria-selected="true" class="block px-3 py-2 font-mono text-sm rounded transition-colors text-gray-600 dark:text-neutral-400 hover:bg-gray-100 dark:hover:bg-neutral-800 hover:text-gray-950 dark:hover:text-neutral-50 bg-sky-500/15 dark:bg-sky-500/20 text-sky-600 dark:text-sky-400">
|
|
||||||
v1.0.0-rc.2 </a><a href="/spec/1.0.0-rc.1" role="option" aria-selected="false" class="block px-3 py-2 font-mono text-sm rounded transition-colors text-gray-600 dark:text-neutral-400 hover:bg-gray-100 dark:hover:bg-neutral-800 hover:text-gray-950 dark:hover:text-neutral-50">
|
|
||||||
v1.0.0-rc.1 </a> </div> </div> <script type="module">function c(){document.querySelectorAll("[data-version-selector]").forEach(e=>{if(e.dataset.initialized)return;e.dataset.initialized="true";const t=e.querySelector("[data-version-trigger]"),a=e.querySelector("[data-version-dropdown]"),n=e.querySelector("[data-arrow-icon]");if(!t||!a)return;const l=()=>{a.dataset.open="true",t.setAttribute("aria-expanded","true"),n&&(n.style.transform="rotate(180deg)")},o=()=>{delete a.dataset.open,t.setAttribute("aria-expanded","false"),n&&(n.style.transform="")};t.addEventListener("click",r=>{r.stopPropagation();const u=a.dataset.open==="true";document.querySelectorAll("[data-version-dropdown][data-open]").forEach(s=>{delete s.dataset.open;const i=s.previousElementSibling;i?.setAttribute("aria-expanded","false");const d=i?.querySelector("[data-arrow-icon]");d&&(d.style.transform="")}),u?o():l()}),document.addEventListener("click",r=>{e.contains(r.target)||o()}),document.addEventListener("keydown",r=>{r.key==="Escape"&&a.dataset.open==="true"&&(o(),t.focus())})})}c();document.addEventListener("astro:after-swap",c);</script> </div> </div> <!-- Desktop Navigation --> <nav class="hidden md:flex items-center gap-1"> <a href="#about" class="nav-link inline-flex items-center gap-1.5 px-4 py-2 text-sm
|
|
||||||
font-medium rounded-lg transition-colors cursor-pointer
|
|
||||||
text-gray-600 dark:text-neutral-400
|
|
||||||
hover:bg-gray-100 hover:text-gray-950
|
|
||||||
dark:hover:bg-neutral-800 dark:hover:text-neutral-50" data-nav-link data-section-id="about"> <svg width="1em" height="1em" class="w-4 h-4" data-icon="heroicons:information-circle"> <symbol id="ai:heroicons:information-circle" viewBox="0 0 24 24"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="m11.25 11.25l.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0a9 9 0 0 1 18 0m-9-3.75h.008v.008H12z"/></symbol><use href="#ai:heroicons:information-circle"></use> </svg> About </a><a href="#spec" class="nav-link inline-flex items-center gap-1.5 px-4 py-2 text-sm
|
|
||||||
font-medium rounded-lg transition-colors cursor-pointer
|
|
||||||
text-gray-600 dark:text-neutral-400
|
|
||||||
hover:bg-gray-100 hover:text-gray-950
|
|
||||||
dark:hover:bg-neutral-800 dark:hover:text-neutral-50" data-nav-link data-section-id="spec"> <svg width="1em" height="1em" class="w-4 h-4" data-icon="heroicons:document-text"> <symbol id="ai:heroicons:document-text" viewBox="0 0 24 24"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9"/></symbol><use href="#ai:heroicons:document-text"></use> </svg> Spec </a><a href="#faq" class="nav-link inline-flex items-center gap-1.5 px-4 py-2 text-sm
|
|
||||||
font-medium rounded-lg transition-colors cursor-pointer
|
|
||||||
text-gray-600 dark:text-neutral-400
|
|
||||||
hover:bg-gray-100 hover:text-gray-950
|
|
||||||
dark:hover:bg-neutral-800 dark:hover:text-neutral-50" data-nav-link data-section-id="faq"> <svg width="1em" height="1em" class="w-4 h-4" data-icon="heroicons:question-mark-circle"> <symbol id="ai:heroicons:question-mark-circle" viewBox="0 0 24 24"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M9.879 7.519c1.172-1.025 3.071-1.025 4.243 0c1.171 1.025 1.171 2.687 0 3.712q-.308.268-.67.442c-.746.361-1.452.999-1.452 1.827v.75M21 12a9 9 0 1 1-18 0a9 9 0 0 1 18 0m-9 5.25h.008v.008H12z"/></symbol><use href="#ai:heroicons:question-mark-circle"></use> </svg> FAQ </a> </nav> <!-- Right side: Theme, GitHub --> <div class="flex items-center gap-3"> <div class="relative group"> <button data-theme-toggle type="button" class="p-2 rounded-lg cursor-pointer transition-colors duration-200
|
|
||||||
text-gray-500 dark:text-neutral-500
|
|
||||||
hover:text-gray-950 dark:hover:text-neutral-50
|
|
||||||
hover:bg-gray-100 dark:hover:bg-neutral-800" aria-label="Toggle theme"> <svg width="1em" height="1em" data-theme-icon="light" class="hidden w-5 h-5" data-icon="heroicons:sun"> <symbol id="ai:heroicons:sun" viewBox="0 0 24 24"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M12 3v2.25m6.364.386l-1.591 1.591M21 12h-2.25m-.386 6.364l-1.591-1.591M12 18.75V21m-4.773-4.227l-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 1 1-7.5 0a3.75 3.75 0 0 1 7.5 0"/></symbol><use href="#ai:heroicons:sun"></use> </svg> <svg width="1em" height="1em" data-theme-icon="dark" class="hidden w-5 h-5" data-icon="heroicons:moon"> <symbol id="ai:heroicons:moon" viewBox="0 0 24 24"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M21.752 15.002A9.7 9.7 0 0 1 18 15.75A9.75 9.75 0 0 1 8.25 6c0-1.33.266-2.597.748-3.752A9.75 9.75 0 0 0 3 11.25A9.75 9.75 0 0 0 12.75 21a9.75 9.75 0 0 0 9.002-5.998"/></symbol><use href="#ai:heroicons:moon"></use> </svg> <svg width="1em" height="1em" data-theme-icon="auto" class="hidden w-5 h-5" data-icon="heroicons:computer-desktop"> <symbol id="ai:heroicons:computer-desktop" viewBox="0 0 24 24"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M9 17.25v1.007a3 3 0 0 1-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0 1 15 18.257V17.25m6-12V15a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 15V5.25m18 0A2.25 2.25 0 0 0 18.75 3H5.25A2.25 2.25 0 0 0 3 5.25m18 0V12a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 12V5.25"/></symbol><use href="#ai:heroicons:computer-desktop"></use> </svg> </button> <!-- Tooltip --> <div class="absolute left-1/2 -translate-x-1/2 top-full mt-2
|
|
||||||
px-2 py-1 text-xs font-medium whitespace-nowrap rounded-md shadow-sm
|
|
||||||
bg-gray-900 text-white dark:bg-white dark:text-gray-900
|
|
||||||
opacity-0 group-hover:opacity-100
|
|
||||||
transition-opacity duration-200 pointer-events-none"> <span data-tooltip-text="light" class="hidden">Light</span> <span data-tooltip-text="dark" class="hidden">Dark</span> <span data-tooltip-text="auto" class="hidden">System</span> </div> </div> <script type="module">function r(){const c=document.querySelectorAll("[data-theme-toggle]");function n(){const e=localStorage.getItem("theme");return e==="dark"||e==="light"||e==="auto"?e:"auto"}function i(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function d(e){return e==="auto"?i():e}function s(e){document.querySelectorAll("[data-theme-icon]").forEach(t=>{const a=t.dataset.themeIcon;t.classList.toggle("hidden",a!==e)}),document.querySelectorAll("[data-tooltip-text]").forEach(t=>{const a=t.dataset.tooltipText;t.classList.toggle("hidden",a!==e)})}function o(e){d(e)==="dark"?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark"),s(e)}function u(e){localStorage.setItem("theme",e),o(e)}function l(){const e=n();return e==="light"?"dark":e==="dark"?"auto":"light"}const f=n();o(f),c.forEach(e=>{e.dataset.initialized||(e.dataset.initialized="true",e.addEventListener("click",()=>{u(l())}))}),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{n()==="auto"&&o("auto")})}r();document.addEventListener("astro:after-swap",r);</script> <a href="https://github.com/jimeh/common-flow" target="_blank" rel="noopener noreferrer" class="p-2 rounded-lg transition-colors
|
|
||||||
text-gray-500 dark:text-neutral-500
|
|
||||||
hover:text-gray-950 dark:hover:text-neutral-50
|
|
||||||
hover:bg-gray-100 dark:hover:bg-neutral-800" aria-label="View on GitHub"> <svg width="1em" height="1em" class="w-5 h-5" data-icon="simple-icons:github"> <symbol id="ai:simple-icons:github" viewBox="0 0 24 24"><path fill="currentColor" d="M12 .297c-6.63 0-12 5.373-12 12c0 5.303 3.438 9.8 8.205 11.385c.6.113.82-.258.82-.577c0-.285-.01-1.04-.015-2.04c-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729c1.205.084 1.838 1.236 1.838 1.236c1.07 1.835 2.809 1.305 3.495.998c.108-.776.417-1.305.76-1.605c-2.665-.3-5.466-1.332-5.466-5.93c0-1.31.465-2.38 1.235-3.22c-.135-.303-.54-1.523.105-3.176c0 0 1.005-.322 3.3 1.23c.96-.267 1.98-.399 3-.405c1.02.006 2.04.138 3 .405c2.28-1.552 3.285-1.23 3.285-1.23c.645 1.653.24 2.873.12 3.176c.765.84 1.23 1.91 1.23 3.22c0 4.61-2.805 5.625-5.475 5.92c.42.36.81 1.096.81 2.22c0 1.606-.015 2.896-.015 3.286c0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"/></symbol><use href="#ai:simple-icons:github"></use> </svg> </a> <!-- Mobile menu button --> <button id="mobile-menu-btn" class="md:hidden p-2 rounded-lg
|
|
||||||
text-gray-500 dark:text-neutral-500
|
|
||||||
hover:bg-gray-100 dark:hover:bg-neutral-800" aria-label="Toggle menu"> <svg width="1em" height="1em" class="w-5 h-5" data-icon="heroicons:bars-3"> <symbol id="ai:heroicons:bars-3" viewBox="0 0 24 24"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5"/></symbol><use href="#ai:heroicons:bars-3"></use> </svg> </button> </div> </div> <!-- Mobile Navigation --> <nav id="mobile-nav" class="md:hidden hidden border-t border-gray-200 dark:border-neutral-800"> <div class="px-4 py-3 space-y-1 text-center"> <div class="py-2 flex justify-center"> <div class="relative" data-version-selector> <!-- Trigger button --> <button type="button" data-version-trigger aria-haspopup="listbox" aria-expanded="false" class="flex items-center gap-1.5 px-2.5 py-1.5 text-sm font-mono
|
|
||||||
border border-gray-200 dark:border-neutral-700
|
|
||||||
rounded-md bg-transparent cursor-pointer transition-colors
|
|
||||||
text-gray-600 dark:text-neutral-400
|
|
||||||
hover:border-sky-600 hover:text-gray-950 dark:hover:text-neutral-50"> <span>v1.0.0-rc.2</span> <svg width="1em" height="1em" viewBox="0 0 24 24" data-arrow-icon="true" class="w-3.5 h-3.5 transition-transform duration-150" data-icon="heroicons:chevron-down"> <use href="#ai:heroicons:chevron-down"></use> </svg> </button> <!-- Dropdown menu --> <div data-version-dropdown role="listbox" aria-label="Select version" class="absolute top-full left-0 mt-2 min-w-full p-1.5 z-50
|
|
||||||
bg-gray-50 dark:bg-neutral-900
|
|
||||||
border border-gray-200 dark:border-neutral-700
|
|
||||||
rounded-lg shadow-lg
|
|
||||||
opacity-0 invisible -translate-y-1 transition-all duration-150
|
|
||||||
data-[open]:opacity-100 data-[open]:visible data-[open]:translate-y-0"> <a href="/spec/1.0.0-rc.5" role="option" aria-selected="false" class="block px-3 py-2 font-mono text-sm rounded transition-colors text-gray-600 dark:text-neutral-400 hover:bg-gray-100 dark:hover:bg-neutral-800 hover:text-gray-950 dark:hover:text-neutral-50">
|
|
||||||
v1.0.0-rc.5 </a><a href="/spec/1.0.0-rc.4" role="option" aria-selected="false" class="block px-3 py-2 font-mono text-sm rounded transition-colors text-gray-600 dark:text-neutral-400 hover:bg-gray-100 dark:hover:bg-neutral-800 hover:text-gray-950 dark:hover:text-neutral-50">
|
|
||||||
v1.0.0-rc.4 </a><a href="/spec/1.0.0-rc.3" role="option" aria-selected="false" class="block px-3 py-2 font-mono text-sm rounded transition-colors text-gray-600 dark:text-neutral-400 hover:bg-gray-100 dark:hover:bg-neutral-800 hover:text-gray-950 dark:hover:text-neutral-50">
|
|
||||||
v1.0.0-rc.3 </a><a href="/spec/1.0.0-rc.2" role="option" aria-selected="true" class="block px-3 py-2 font-mono text-sm rounded transition-colors text-gray-600 dark:text-neutral-400 hover:bg-gray-100 dark:hover:bg-neutral-800 hover:text-gray-950 dark:hover:text-neutral-50 bg-sky-500/15 dark:bg-sky-500/20 text-sky-600 dark:text-sky-400">
|
|
||||||
v1.0.0-rc.2 </a><a href="/spec/1.0.0-rc.1" role="option" aria-selected="false" class="block px-3 py-2 font-mono text-sm rounded transition-colors text-gray-600 dark:text-neutral-400 hover:bg-gray-100 dark:hover:bg-neutral-800 hover:text-gray-950 dark:hover:text-neutral-50">
|
|
||||||
v1.0.0-rc.1 </a> </div> </div> </div> <a href="#about" class="nav-link flex items-center justify-center gap-1.5 py-2
|
|
||||||
text-gray-600 dark:text-neutral-400 hover:text-sky-600" data-nav-link data-section-id="about"> <svg width="1em" height="1em" viewBox="0 0 24 24" class="w-4 h-4" data-icon="heroicons:information-circle"> <use href="#ai:heroicons:information-circle"></use> </svg> About </a><a href="#spec" class="nav-link flex items-center justify-center gap-1.5 py-2
|
|
||||||
text-gray-600 dark:text-neutral-400 hover:text-sky-600" data-nav-link data-section-id="spec"> <svg width="1em" height="1em" viewBox="0 0 24 24" class="w-4 h-4" data-icon="heroicons:document-text"> <use href="#ai:heroicons:document-text"></use> </svg> Spec </a><a href="#faq" class="nav-link flex items-center justify-center gap-1.5 py-2
|
|
||||||
text-gray-600 dark:text-neutral-400 hover:text-sky-600" data-nav-link data-section-id="faq"> <svg width="1em" height="1em" viewBox="0 0 24 24" class="w-4 h-4" data-icon="heroicons:question-mark-circle"> <use href="#ai:heroicons:question-mark-circle"></use> </svg> FAQ </a> </div> </nav> </header> <script type="module" src="/_astro/Header.astro_astro_type_script_index_0_lang.ClIJVJFM.js"></script> <main> <section id="hero" class="relative min-h-[75vh] flex flex-col items-center justify-center
|
|
||||||
px-6 pt-16 pb-24 overflow-hidden"> <!-- Background gradient/texture --> <div class="absolute inset-0 bg-gradient-to-b
|
|
||||||
from-gray-100 to-gray-50
|
|
||||||
dark:from-neutral-900 dark:to-neutral-950"></div> <!-- Subtle grid pattern with fade --> <div class="absolute inset-0 opacity-[0.06] dark:opacity-[0.12]
|
|
||||||
bg-[linear-gradient(theme(colors.gray.950)_1px,transparent_1px),linear-gradient(90deg,theme(colors.gray.950)_1px,transparent_1px)]
|
|
||||||
dark:bg-[linear-gradient(theme(colors.neutral.600)_1px,transparent_1px),linear-gradient(90deg,theme(colors.neutral.600)_1px,transparent_1px)]
|
|
||||||
bg-[size:60px_60px] bg-center
|
|
||||||
[-webkit-mask-image:linear-gradient(to_bottom,black_20%,transparent_80%)]
|
|
||||||
[mask-image:linear-gradient(to_bottom,black_20%,transparent_80%)]"></div> <!-- Top bar with version & theme --> <div class="absolute top-0 inset-x-0 z-20 flex items-center justify-between
|
|
||||||
px-6 py-4 animate-fade-in-down"> <div class="flex items-center gap-3"> <div class="relative" data-version-selector> <!-- Trigger button --> <button type="button" data-version-trigger aria-haspopup="listbox" aria-expanded="false" class="flex items-center gap-1.5 px-2.5 py-1.5 text-sm font-mono
|
|
||||||
border border-gray-200 dark:border-neutral-700
|
|
||||||
rounded-md bg-transparent cursor-pointer transition-colors
|
|
||||||
text-gray-600 dark:text-neutral-400
|
|
||||||
hover:border-sky-600 hover:text-gray-950 dark:hover:text-neutral-50"> <span>v1.0.0-rc.2</span> <svg width="1em" height="1em" viewBox="0 0 24 24" data-arrow-icon="true" class="w-3.5 h-3.5 transition-transform duration-150" data-icon="heroicons:chevron-down"> <use href="#ai:heroicons:chevron-down"></use> </svg> </button> <!-- Dropdown menu --> <div data-version-dropdown role="listbox" aria-label="Select version" class="absolute top-full left-0 mt-2 min-w-full p-1.5 z-50
|
|
||||||
bg-gray-50 dark:bg-neutral-900
|
|
||||||
border border-gray-200 dark:border-neutral-700
|
|
||||||
rounded-lg shadow-lg
|
|
||||||
opacity-0 invisible -translate-y-1 transition-all duration-150
|
|
||||||
data-[open]:opacity-100 data-[open]:visible data-[open]:translate-y-0"> <a href="/spec/1.0.0-rc.5" role="option" aria-selected="false" class="block px-3 py-2 font-mono text-sm rounded transition-colors text-gray-600 dark:text-neutral-400 hover:bg-gray-100 dark:hover:bg-neutral-800 hover:text-gray-950 dark:hover:text-neutral-50">
|
|
||||||
v1.0.0-rc.5 </a><a href="/spec/1.0.0-rc.4" role="option" aria-selected="false" class="block px-3 py-2 font-mono text-sm rounded transition-colors text-gray-600 dark:text-neutral-400 hover:bg-gray-100 dark:hover:bg-neutral-800 hover:text-gray-950 dark:hover:text-neutral-50">
|
|
||||||
v1.0.0-rc.4 </a><a href="/spec/1.0.0-rc.3" role="option" aria-selected="false" class="block px-3 py-2 font-mono text-sm rounded transition-colors text-gray-600 dark:text-neutral-400 hover:bg-gray-100 dark:hover:bg-neutral-800 hover:text-gray-950 dark:hover:text-neutral-50">
|
|
||||||
v1.0.0-rc.3 </a><a href="/spec/1.0.0-rc.2" role="option" aria-selected="true" class="block px-3 py-2 font-mono text-sm rounded transition-colors text-gray-600 dark:text-neutral-400 hover:bg-gray-100 dark:hover:bg-neutral-800 hover:text-gray-950 dark:hover:text-neutral-50 bg-sky-500/15 dark:bg-sky-500/20 text-sky-600 dark:text-sky-400">
|
|
||||||
v1.0.0-rc.2 </a><a href="/spec/1.0.0-rc.1" role="option" aria-selected="false" class="block px-3 py-2 font-mono text-sm rounded transition-colors text-gray-600 dark:text-neutral-400 hover:bg-gray-100 dark:hover:bg-neutral-800 hover:text-gray-950 dark:hover:text-neutral-50">
|
|
||||||
v1.0.0-rc.1 </a> </div> </div> </div> <div class="flex items-center gap-2"> <div class="relative group"> <button data-theme-toggle type="button" class="p-2 rounded-lg cursor-pointer transition-colors duration-200
|
|
||||||
text-gray-500 dark:text-neutral-500
|
|
||||||
hover:text-gray-950 dark:hover:text-neutral-50
|
|
||||||
hover:bg-gray-100 dark:hover:bg-neutral-800" aria-label="Toggle theme"> <svg width="1em" height="1em" viewBox="0 0 24 24" data-theme-icon="light" class="hidden w-5 h-5" data-icon="heroicons:sun"> <use href="#ai:heroicons:sun"></use> </svg> <svg width="1em" height="1em" viewBox="0 0 24 24" data-theme-icon="dark" class="hidden w-5 h-5" data-icon="heroicons:moon"> <use href="#ai:heroicons:moon"></use> </svg> <svg width="1em" height="1em" viewBox="0 0 24 24" data-theme-icon="auto" class="hidden w-5 h-5" data-icon="heroicons:computer-desktop"> <use href="#ai:heroicons:computer-desktop"></use> </svg> </button> <!-- Tooltip --> <div class="absolute left-1/2 -translate-x-1/2 top-full mt-2
|
|
||||||
px-2 py-1 text-xs font-medium whitespace-nowrap rounded-md shadow-sm
|
|
||||||
bg-gray-900 text-white dark:bg-white dark:text-gray-900
|
|
||||||
opacity-0 group-hover:opacity-100
|
|
||||||
transition-opacity duration-200 pointer-events-none"> <span data-tooltip-text="light" class="hidden">Light</span> <span data-tooltip-text="dark" class="hidden">Dark</span> <span data-tooltip-text="auto" class="hidden">System</span> </div> </div> <a href="https://github.com/jimeh/common-flow" target="_blank" rel="noopener noreferrer" class="p-2 rounded-lg transition-colors
|
|
||||||
text-gray-500 dark:text-neutral-500
|
|
||||||
hover:text-gray-950 dark:hover:text-neutral-50
|
|
||||||
hover:bg-white/50 dark:hover:bg-neutral-800/50" aria-label="View on GitHub"> <svg width="1em" height="1em" viewBox="0 0 24 24" class="w-5 h-5" data-icon="simple-icons:github"> <use href="#ai:simple-icons:github"></use> </svg> </a> </div> </div> <!-- Main content --> <div class="relative z-10 w-full max-w-4xl mx-auto text-center"> <!-- Title --> <h1 class="animate-fade-in-up mb-4
|
|
||||||
text-gray-950 dark:text-neutral-50">
|
|
||||||
Git Common-Flow
|
|
||||||
</h1> <!-- Tagline --> <p class="animate-fade-in-up delay-100
|
|
||||||
text-lg sm:text-xl max-w-2xl mx-auto mb-8
|
|
||||||
text-gray-600 dark:text-neutral-400">
|
|
||||||
A sensible git workflow for teams who ship
|
|
||||||
</p> <!-- Version badge --> <div class="animate-fade-in-up delay-200 mb-10"> <span class="inline-flex items-center px-3 py-1 font-mono text-xs font-medium
|
|
||||||
rounded-full border
|
|
||||||
bg-gray-100 border-gray-200 text-gray-500
|
|
||||||
dark:bg-neutral-800/50 dark:border-neutral-700 dark:text-neutral-400">
|
|
||||||
v1.0.0-rc.2 </span> </div> <!-- SVG Diagram --> <div class="animate-fade-in-up delay-300
|
|
||||||
relative mx-auto mb-12 p-4 sm:p-8
|
|
||||||
bg-white dark:bg-neutral-900
|
|
||||||
rounded-2xl shadow-lg dark:shadow-none
|
|
||||||
border border-gray-200 dark:border-neutral-800"> <img src="/spec/1.0.0-rc.2.svg" alt="Git Common-Flow diagram" class="w-full h-auto max-w-3xl mx-auto
|
|
||||||
dark:invert dark:hue-rotate-180 dark:contrast-90"> </div> <!-- Navigation links --> <nav class="animate-fade-in-up delay-400
|
|
||||||
flex flex-wrap items-center justify-center gap-4"> <a href="#about" class="inline-flex items-center justify-center gap-2 px-6 py-3
|
|
||||||
text-base font-medium rounded-lg transition-all cursor-pointer
|
|
||||||
text-gray-600 dark:text-neutral-400
|
|
||||||
hover:bg-gray-100 hover:text-gray-950
|
|
||||||
dark:hover:bg-neutral-800 dark:hover:text-neutral-50">
|
|
||||||
About
|
|
||||||
</a> <a href="#spec" class="inline-flex items-center justify-center gap-2 px-6 py-3
|
|
||||||
text-base font-medium rounded-lg transition-all cursor-pointer
|
|
||||||
bg-sky-600 text-white
|
|
||||||
hover:bg-sky-500 hover:-translate-y-0.5 hover:shadow-md">
|
|
||||||
Read the Spec
|
|
||||||
</a> <a href="#faq" class="inline-flex items-center justify-center gap-2 px-6 py-3
|
|
||||||
text-base font-medium rounded-lg transition-all cursor-pointer
|
|
||||||
text-gray-600 dark:text-neutral-400
|
|
||||||
hover:bg-gray-100 hover:text-gray-950
|
|
||||||
dark:hover:bg-neutral-800 dark:hover:text-neutral-50">
|
|
||||||
FAQ
|
|
||||||
</a> </nav> </div> <!-- Scroll indicator --> <a href="#about" class="absolute bottom-8 left-1/2 -translate-x-1/2
|
|
||||||
animate-fade-in delay-700
|
|
||||||
text-gray-500 dark:text-neutral-500
|
|
||||||
hover:text-sky-600 transition-colors" aria-label="Scroll to content"> <svg width="1em" height="1em" class="w-6 h-6 animate-bounce-subtle" data-icon="heroicons:arrow-down"> <symbol id="ai:heroicons:arrow-down" viewBox="0 0 24 24"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M19.5 13.5L12 21m0 0l-7.5-7.5M12 21V3"/></symbol><use href="#ai:heroicons:arrow-down"></use> </svg> </a> </section> <section id="about" class="py-20 sm:py-28"> <div class="section-container"> <div class="max-w-3xl mx-auto"> <div class="mb-12 text-center"> <h2 class="text-3xl sm:text-4xl mb-4">About Common-Flow</h2> <p class="text-lg text-gray-600 dark:text-neutral-400"> A practical git workflow that combines the best of GitHub Flow with versioned releases </p> </div> <!-- Introduction --> <div class="prose-spec mb-12"></div> <!-- Summary as feature cards --> <div class="mb-16"> <h3 class="text-xl font-display font-semibold mb-6
|
|
||||||
text-gray-950 dark:text-neutral-50">
|
|
||||||
Key Principles
|
|
||||||
</h3> <div class="prose-spec"><p>Common-Flow is an attempt to gather a sensible selection of the most common
|
|
||||||
usage patterns of git into a single and concise specification. It is based on
|
|
||||||
the <a href="http://scottchacon.com/2011/08/31/github-flow.html">original variant</a>
|
|
||||||
of <a href="https://guides.github.com/introduction/flow/">GitHub Flow</a>, while taking
|
|
||||||
into account how a lot of open source projects use git.</p>
|
|
||||||
<p>TL;DR: Common-Flow is basically GitHub Flow with the addition of versioned
|
|
||||||
releases, maintenance releases for old versions, and without the requirement to
|
|
||||||
deploy to production all the time.</p></div> </div> <!-- Feedback & License --> <div class="pt-8 border-t border-gray-200 dark:border-neutral-800"> <div class="grid sm:grid-cols-2 gap-8"> <div> <h4 class="text-sm font-semibold uppercase tracking-wider mb-3
|
|
||||||
text-gray-500 dark:text-neutral-500">
|
|
||||||
Feedback
|
|
||||||
</h4> <p class="text-gray-600 dark:text-neutral-400">
|
|
||||||
Please <a href="https://github.com/jimeh/common-flow/issues" class="text-sky-600 hover:text-sky-400" target="_blank" rel="noopener noreferrer">open an issue on GitHub</a>.
|
|
||||||
</p> </div> <div> <h4 class="text-sm font-semibold uppercase tracking-wider mb-3
|
|
||||||
text-gray-500 dark:text-neutral-500">
|
|
||||||
License
|
|
||||||
</h4> <div class="text-gray-600 dark:text-neutral-400"><p><a href="http://creativecommons.org/licenses/by/3.0/">Creative Commons - CC BY 3.0</a></p></div> </div> </div> </div> </div> </div> </section> <section id="spec" class="py-20 sm:py-28"> <div class="section-container"> <div class="mb-12 text-center max-w-3xl mx-auto"> <h2 class="text-3xl sm:text-4xl mb-4">The Specification</h2> <p class="text-lg text-gray-600 dark:text-neutral-400"> The complete Git Common-Flow specification </p> </div> <!-- Content with sidebar --> <div class="lg:flex lg:gap-8"> <!-- Sidebar --> <div class="lg:w-64 lg:flex-shrink-0"> <aside id="spec-sidebar" class="hidden lg:block lg:sticky lg:top-24 lg:self-start
|
|
||||||
lg:max-h-[calc(100vh-8rem)] lg:overflow-y-auto
|
|
||||||
lg:pr-8 lg:mr-8 lg:border-r border-gray-200 dark:border-neutral-800"> <nav class="space-y-1 py-2"> <div class="text-xs font-semibold uppercase tracking-wider mb-4
|
|
||||||
text-gray-500 dark:text-neutral-500">
|
|
||||||
Table of Contents
|
|
||||||
</div> <a href="#terminology" class="sidebar-link block py-2 px-4 text-sm rounded-md transition-colors text-gray-500 hover:text-gray-950 hover:bg-gray-100 dark:text-neutral-500 dark:hover:text-neutral-50 dark:hover:bg-neutral-800" data-sidebar-link data-section-id="terminology"> <span>Terminology</span> </a><a href="#specification" class="sidebar-link block py-2 px-4 text-sm rounded-md transition-colors text-gray-500 hover:text-gray-950 hover:bg-gray-100 dark:text-neutral-500 dark:hover:text-neutral-50 dark:hover:bg-neutral-800" data-sidebar-link data-section-id="specification"> <span>Specification</span> </a><a href="#spec-the-master-branch" class="sidebar-link block py-2 px-4 text-sm rounded-md transition-colors text-gray-500 hover:text-gray-950 hover:bg-gray-100 dark:text-neutral-500 dark:hover:text-neutral-50 dark:hover:bg-neutral-800 pl-6 text-[0.8125rem] flex" data-sidebar-link data-section-id="spec-the-master-branch"> <span class="shrink-0 w-6 text-gray-400 dark:text-neutral-600"> 1. </span> <span>The Master Branch</span> </a><a href="#spec-change-branches" class="sidebar-link block py-2 px-4 text-sm rounded-md transition-colors text-gray-500 hover:text-gray-950 hover:bg-gray-100 dark:text-neutral-500 dark:hover:text-neutral-50 dark:hover:bg-neutral-800 pl-6 text-[0.8125rem] flex" data-sidebar-link data-section-id="spec-change-branches"> <span class="shrink-0 w-6 text-gray-400 dark:text-neutral-600"> 2. </span> <span>Change Branches</span> </a><a href="#spec-pull-requests" class="sidebar-link block py-2 px-4 text-sm rounded-md transition-colors text-gray-500 hover:text-gray-950 hover:bg-gray-100 dark:text-neutral-500 dark:hover:text-neutral-50 dark:hover:bg-neutral-800 pl-6 text-[0.8125rem] flex" data-sidebar-link data-section-id="spec-pull-requests"> <span class="shrink-0 w-6 text-gray-400 dark:text-neutral-600"> 3. </span> <span>Pull Requests</span> </a><a href="#spec-versioning" class="sidebar-link block py-2 px-4 text-sm rounded-md transition-colors text-gray-500 hover:text-gray-950 hover:bg-gray-100 dark:text-neutral-500 dark:hover:text-neutral-50 dark:hover:bg-neutral-800 pl-6 text-[0.8125rem] flex" data-sidebar-link data-section-id="spec-versioning"> <span class="shrink-0 w-6 text-gray-400 dark:text-neutral-600"> 4. </span> <span>Versioning</span> </a><a href="#spec-releases" class="sidebar-link block py-2 px-4 text-sm rounded-md transition-colors text-gray-500 hover:text-gray-950 hover:bg-gray-100 dark:text-neutral-500 dark:hover:text-neutral-50 dark:hover:bg-neutral-800 pl-6 text-[0.8125rem] flex" data-sidebar-link data-section-id="spec-releases"> <span class="shrink-0 w-6 text-gray-400 dark:text-neutral-600"> 5. </span> <span>Releases</span> </a><a href="#spec-release-branches" class="sidebar-link block py-2 px-4 text-sm rounded-md transition-colors text-gray-500 hover:text-gray-950 hover:bg-gray-100 dark:text-neutral-500 dark:hover:text-neutral-50 dark:hover:bg-neutral-800 pl-6 text-[0.8125rem] flex" data-sidebar-link data-section-id="spec-release-branches"> <span class="shrink-0 w-6 text-gray-400 dark:text-neutral-600"> 6. </span> <span>Release Branches</span> </a><a href="#spec-bug-fixes-rollback" class="sidebar-link block py-2 px-4 text-sm rounded-md transition-colors text-gray-500 hover:text-gray-950 hover:bg-gray-100 dark:text-neutral-500 dark:hover:text-neutral-50 dark:hover:bg-neutral-800 pl-6 text-[0.8125rem] flex" data-sidebar-link data-section-id="spec-bug-fixes-rollback"> <span class="shrink-0 w-6 text-gray-400 dark:text-neutral-600"> 7. </span> <span>Bug Fixes & Rollback</span> </a><a href="#spec-git-best-practices" class="sidebar-link block py-2 px-4 text-sm rounded-md transition-colors text-gray-500 hover:text-gray-950 hover:bg-gray-100 dark:text-neutral-500 dark:hover:text-neutral-50 dark:hover:bg-neutral-800 pl-6 text-[0.8125rem] flex" data-sidebar-link data-section-id="spec-git-best-practices"> <span class="shrink-0 w-6 text-gray-400 dark:text-neutral-600"> 8. </span> <span>Git Best Practices</span> </a> </nav> </aside> <!-- Mobile floating button --> <button id="spec-toc-toggle" class="lg:hidden fixed bottom-6 right-6 z-40
|
|
||||||
w-12 h-12 rounded-full shadow-lg
|
|
||||||
bg-sky-600 text-white
|
|
||||||
flex items-center justify-center
|
|
||||||
hover:bg-sky-500
|
|
||||||
transition-all duration-200" aria-label="Jump to section"> <svg width="1em" height="1em" class="w-5 h-5" data-icon="heroicons:bars-3-bottom-left"> <symbol id="ai:heroicons:bars-3-bottom-left" viewBox="0 0 24 24"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25H12"/></symbol><use href="#ai:heroicons:bars-3-bottom-left"></use> </svg> </button> <!-- Mobile TOC drawer --> <div id="spec-toc-drawer" class="lg:hidden fixed inset-0 z-50 hidden" data-toc-drawer> <!-- Backdrop --> <div class="absolute inset-0 bg-black/50" data-toc-backdrop></div> <!-- Drawer --> <div class="absolute bottom-0 inset-x-0 max-h-[70vh] overflow-y-auto
|
|
||||||
bg-gray-50 dark:bg-neutral-950
|
|
||||||
rounded-t-2xl shadow-xl p-6"> <div class="flex items-center justify-between mb-4"> <span class="text-sm font-semibold uppercase tracking-wider
|
|
||||||
text-gray-500 dark:text-neutral-500">
|
|
||||||
Jump to Section
|
|
||||||
</span> <button class="p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-neutral-800" data-toc-close aria-label="Close"> <svg width="1em" height="1em" class="w-5 h-5" data-icon="heroicons:x-mark"> <symbol id="ai:heroicons:x-mark" viewBox="0 0 24 24"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M6 18L18 6M6 6l12 12"/></symbol><use href="#ai:heroicons:x-mark"></use> </svg> </button> </div> <nav class="space-y-1"> <a href="#terminology" class="sidebar-link block py-2 px-4 text-sm rounded-md transition-colors text-gray-500 hover:text-gray-950 hover:bg-gray-100 dark:text-neutral-500 dark:hover:text-neutral-50 dark:hover:bg-neutral-800" data-toc-link> <span>Terminology</span> </a><a href="#specification" class="sidebar-link block py-2 px-4 text-sm rounded-md transition-colors text-gray-500 hover:text-gray-950 hover:bg-gray-100 dark:text-neutral-500 dark:hover:text-neutral-50 dark:hover:bg-neutral-800" data-toc-link> <span>Specification</span> </a><a href="#spec-the-master-branch" class="sidebar-link block py-2 px-4 text-sm rounded-md transition-colors text-gray-500 hover:text-gray-950 hover:bg-gray-100 dark:text-neutral-500 dark:hover:text-neutral-50 dark:hover:bg-neutral-800 pl-6 text-[0.8125rem] flex" data-toc-link> <span class="shrink-0 w-6 text-gray-400 dark:text-neutral-600"> 1. </span> <span>The Master Branch</span> </a><a href="#spec-change-branches" class="sidebar-link block py-2 px-4 text-sm rounded-md transition-colors text-gray-500 hover:text-gray-950 hover:bg-gray-100 dark:text-neutral-500 dark:hover:text-neutral-50 dark:hover:bg-neutral-800 pl-6 text-[0.8125rem] flex" data-toc-link> <span class="shrink-0 w-6 text-gray-400 dark:text-neutral-600"> 2. </span> <span>Change Branches</span> </a><a href="#spec-pull-requests" class="sidebar-link block py-2 px-4 text-sm rounded-md transition-colors text-gray-500 hover:text-gray-950 hover:bg-gray-100 dark:text-neutral-500 dark:hover:text-neutral-50 dark:hover:bg-neutral-800 pl-6 text-[0.8125rem] flex" data-toc-link> <span class="shrink-0 w-6 text-gray-400 dark:text-neutral-600"> 3. </span> <span>Pull Requests</span> </a><a href="#spec-versioning" class="sidebar-link block py-2 px-4 text-sm rounded-md transition-colors text-gray-500 hover:text-gray-950 hover:bg-gray-100 dark:text-neutral-500 dark:hover:text-neutral-50 dark:hover:bg-neutral-800 pl-6 text-[0.8125rem] flex" data-toc-link> <span class="shrink-0 w-6 text-gray-400 dark:text-neutral-600"> 4. </span> <span>Versioning</span> </a><a href="#spec-releases" class="sidebar-link block py-2 px-4 text-sm rounded-md transition-colors text-gray-500 hover:text-gray-950 hover:bg-gray-100 dark:text-neutral-500 dark:hover:text-neutral-50 dark:hover:bg-neutral-800 pl-6 text-[0.8125rem] flex" data-toc-link> <span class="shrink-0 w-6 text-gray-400 dark:text-neutral-600"> 5. </span> <span>Releases</span> </a><a href="#spec-release-branches" class="sidebar-link block py-2 px-4 text-sm rounded-md transition-colors text-gray-500 hover:text-gray-950 hover:bg-gray-100 dark:text-neutral-500 dark:hover:text-neutral-50 dark:hover:bg-neutral-800 pl-6 text-[0.8125rem] flex" data-toc-link> <span class="shrink-0 w-6 text-gray-400 dark:text-neutral-600"> 6. </span> <span>Release Branches</span> </a><a href="#spec-bug-fixes-rollback" class="sidebar-link block py-2 px-4 text-sm rounded-md transition-colors text-gray-500 hover:text-gray-950 hover:bg-gray-100 dark:text-neutral-500 dark:hover:text-neutral-50 dark:hover:bg-neutral-800 pl-6 text-[0.8125rem] flex" data-toc-link> <span class="shrink-0 w-6 text-gray-400 dark:text-neutral-600"> 7. </span> <span>Bug Fixes & Rollback</span> </a><a href="#spec-git-best-practices" class="sidebar-link block py-2 px-4 text-sm rounded-md transition-colors text-gray-500 hover:text-gray-950 hover:bg-gray-100 dark:text-neutral-500 dark:hover:text-neutral-50 dark:hover:bg-neutral-800 pl-6 text-[0.8125rem] flex" data-toc-link> <span class="shrink-0 w-6 text-gray-400 dark:text-neutral-600"> 8. </span> <span>Git Best Practices</span> </a> </nav> </div> </div> <script type="module" src="/_astro/SpecSidebar.astro_astro_type_script_index_0_lang.BQBj5HuJ.js"></script> </div> <!-- Main content --> <div class="flex-1 min-w-0"> <article class="prose-spec"> <!-- Terminology --> <section id="terminology"> <h2>Terminology</h2> <ul>
|
|
||||||
<li><strong>Master Branch</strong> - Must always have passing tests, is considered bleeding
|
|
||||||
edge, and must be named <code>master</code>.</li>
|
|
||||||
<li><strong>Change Branches</strong> - Any branch that introduces changes like a new feature, a
|
|
||||||
bug fix, etc.</li>
|
|
||||||
<li><strong>Source Branch</strong> - The branch that a change branch was created from. New
|
|
||||||
changes in the source branch should be incorporated into the change branch via
|
|
||||||
rebasing.</li>
|
|
||||||
<li><strong>Merge Target</strong> - A branch that is the intended merge target for a change
|
|
||||||
branch. Typically the merge target branch will be the same as the source
|
|
||||||
branch.</li>
|
|
||||||
<li><strong>Pull Request</strong> - A means of requesting that a change branch is merged in to
|
|
||||||
its merge target, allowing others to review, discuss and approve the changes.</li>
|
|
||||||
<li><strong>Release</strong> - Consists of a version bump commit, and a git tag named according
|
|
||||||
to the new version string placed on said commit.</li>
|
|
||||||
<li><strong>Release Branches</strong> - Used both for short-term preparations of a release, and
|
|
||||||
also for long-term maintenance of older version.</li>
|
|
||||||
</ul> </section> <!-- Main specification --> <section id="specification"> <h2>Specification</h2> <p>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD",
|
|
||||||
"SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be
|
|
||||||
interpreted as described in <a href="https://tools.ietf.org/html/rfc2119">RFC 2119</a>.</p>
|
|
||||||
<ol>
|
|
||||||
<li id="spec-the-master-branch">The Master Branch
|
|
||||||
<ol>
|
|
||||||
<li>A branch named "master" MUST exist and it MUST be referred to as the
|
|
||||||
"master branch".</li>
|
|
||||||
<li>The master branch MUST be considered bleeding edge.</li>
|
|
||||||
<li>The master branch MUST always be in a non-broken state with its test
|
|
||||||
suite passing.</li>
|
|
||||||
<li>The master branch SHOULD always be in a "as near as possibly ready for
|
|
||||||
release/production" state to reduce any friction with creating a new
|
|
||||||
release.</li>
|
|
||||||
</ol>
|
|
||||||
</li>
|
|
||||||
<li id="spec-change-branches">Change Branches
|
|
||||||
<ol>
|
|
||||||
<li>Each change (feature, bugfix, etc.) MUST be performed on separate
|
|
||||||
branches that SHOULD be referred to as "change branches". All change
|
|
||||||
branches MUST have descriptive names. It is RECOMMENDED that you commit
|
|
||||||
often locally, and you SHOULD regularly push your work to the same named
|
|
||||||
branch on the remote server.</li>
|
|
||||||
<li>You MUST create separate change branches for each distinctly different
|
|
||||||
change. You MUST NOT include multiple unrelated changes into a single
|
|
||||||
change branch.</li>
|
|
||||||
<li>When a change branch is created, the branch that it is created from
|
|
||||||
SHOULD be referred to as the "source branch". Each change branch also
|
|
||||||
needs a designated "merge target" branch, typically this will be the same
|
|
||||||
as the source branch.</li>
|
|
||||||
<li>Change branches MUST be regularly updated with any changes from their
|
|
||||||
source branch. This MUST be done by rebasing the change branch on top of
|
|
||||||
the source branch.</li>
|
|
||||||
<li>After rebasing a change branch on top of its source branch you MUST push
|
|
||||||
the change branch to the remote server. This will require you to do a
|
|
||||||
force push, and you SHOULD use the "--force-with-lease" git push option.</li>
|
|
||||||
</ol>
|
|
||||||
</li>
|
|
||||||
<li id="spec-pull-requests">Pull Requests
|
|
||||||
<ol>
|
|
||||||
<li>To merge a change branch into its merge target, you MUST open a "pull
|
|
||||||
request" (or equivalent) so others can review and approve your changes.</li>
|
|
||||||
<li>A pull request MUST only be merged when the change branch is up-to-date
|
|
||||||
with its source branch, the test suite is passing, and you and others are
|
|
||||||
happy with the change. This is especially important if the merge target
|
|
||||||
is the master branch.</li>
|
|
||||||
<li>To get feedback, help, or generally just discuss a change branch with
|
|
||||||
others, the RECOMMENDED way to do so is by creating a pull request and
|
|
||||||
discuss the changes with others there.</li>
|
|
||||||
</ol>
|
|
||||||
</li>
|
|
||||||
<li id="spec-versioning">Versioning
|
|
||||||
<ol>
|
|
||||||
<li>The project MUST have its version hard-coded somewhere in the
|
|
||||||
code-base. It is RECOMMENDED that this is done in a file called "VERSION"
|
|
||||||
located in the root of the project.</li>
|
|
||||||
<li>If you are using a "VERSION" file in the root of the project, this MUST
|
|
||||||
only contain the exact version string.</li>
|
|
||||||
<li>The version string SHOULD follow the Semantic Versioning
|
|
||||||
(<a href="http://semver.org/">http://semver.org/</a>) format. Use of Semantic Versioning is OPTIONAL,
|
|
||||||
but the version string MUST NOT have a "v" prefix. For example "v2.11.4"
|
|
||||||
is bad, and "2.11.4" is good.</li>
|
|
||||||
</ol>
|
|
||||||
</li>
|
|
||||||
<li id="spec-releases">Releases
|
|
||||||
<ol>
|
|
||||||
<li>To create a new release, you MUST create a "version bump" commit which
|
|
||||||
changes the hard-coded version string of the project. The version bump
|
|
||||||
commit MUST have a git tag created on it and named as the exact version
|
|
||||||
string.</li>
|
|
||||||
<li>If you are not using a release branch, then the version bump commit MUST
|
|
||||||
be created directly on the master branch.</li>
|
|
||||||
<li>The version bump commit MUST have a commit message title of "Bump version
|
|
||||||
to VERSION". For example, if the new version string is "2.11.4", the
|
|
||||||
first line of the commit message MUST read: "Bump version to 2.11.4"</li>
|
|
||||||
<li>The release tag on the version bump commit MUST be named exactly the same
|
|
||||||
as the version string. The tag name can OPTIONALLY be prefixed with
|
|
||||||
"v". For example the tag name can be either "2.11.4" or "v2.11.4". You
|
|
||||||
MUST not use a mix of "v" prefixed and non-prefixed tags. Pick one form
|
|
||||||
and stick to it.</li>
|
|
||||||
<li>It is RECOMMENDED that release tags are lightweight tags, but you can
|
|
||||||
OPTIONALLY use annotated tags if you want to include changelog
|
|
||||||
information in the release tag itself.</li>
|
|
||||||
<li>If you use annotated release tags, the first line of the annotation MUST
|
|
||||||
read "Release VERSION". For example for version "2.11.4" the first line
|
|
||||||
of the tag annotation would read "Release 2.11.4". The second line must
|
|
||||||
be blank, and the changelog MUST start on the third line.</li>
|
|
||||||
</ol>
|
|
||||||
</li>
|
|
||||||
<li id="spec-release-branches">Release Branches
|
|
||||||
<ol>
|
|
||||||
<li>Any branch that has a name starting with "release-" SHOULD be referred to
|
|
||||||
as a "release branch".</li>
|
|
||||||
<li>Use of release branches is OPTIONAL.</li>
|
|
||||||
<li>Changes in a release branch SHOULD typically come from work being
|
|
||||||
done against the master branch. Meaning changes SHOULD only trickle
|
|
||||||
downwards from the master branch. If a change needs to trickle back up
|
|
||||||
into the master branch, that work should have happened against the master
|
|
||||||
branch in the first place. One exception to this is version bump commits.</li>
|
|
||||||
<li>There are two types of release branches; short-term, and long-term.</li>
|
|
||||||
<li>Short-Term Release Branches
|
|
||||||
<ol>
|
|
||||||
<li>Used for creating a specific versioned release.</li>
|
|
||||||
<li>A short-term release branch is RECOMMENDED if there is a lengthy
|
|
||||||
pre-release verification process to avoid a code freeze on the master
|
|
||||||
branch.</li>
|
|
||||||
<li>MUST have a name of "release-VERSION". For example for version
|
|
||||||
"2.11.4" the release branch name MUST be "release-2.11.4".</li>
|
|
||||||
<li>When using a short-term release branch, the version bump commit and
|
|
||||||
release tag MUST be made directly on the release branch itself.</li>
|
|
||||||
<li>Only very minor changes should be performed on a short-term release
|
|
||||||
branch directly. Any larger changes SHOULD be done in the master
|
|
||||||
branch, and SHOULD be pulled into the release branch by rebasing it
|
|
||||||
on top of the master branch the same way a change branch pulls in
|
|
||||||
updates from its source branch.</li>
|
|
||||||
<li>After the version bump commit and release tag have been created, the
|
|
||||||
release branch MUST be merged back into its source branch and then
|
|
||||||
deleted. Typically the source branch will be the master branch.</li>
|
|
||||||
</ol>
|
|
||||||
</li>
|
|
||||||
<li>Long-Term Release Branches
|
|
||||||
<ol>
|
|
||||||
<li>Used for work on versions which are not currently part of the master
|
|
||||||
branch. Typically this is useful when you need to create a new
|
|
||||||
maintenance release for a older version.</li>
|
|
||||||
<li>The branch name MUST have a non-specific version number. For example
|
|
||||||
a long-term release branch for creating new 2.9.x releases would be
|
|
||||||
named "release-2.9".</li>
|
|
||||||
<li>To create a new release from a long-term release branch, you MUST
|
|
||||||
create a version bump commit and release tag directly on the release
|
|
||||||
branch.</li>
|
|
||||||
<li>A long-term release branch MUST be created from the relevant release
|
|
||||||
tag. For example if the master branch is on version 2.11.4 and there
|
|
||||||
is a security fix for all 2.9.x releases, the latest of which is
|
|
||||||
"2.9.7". Create a new branch called "release-2.9" off of the "2.9.7"
|
|
||||||
release tag. The security fix release will then end up being version
|
|
||||||
"2.9.8".</li>
|
|
||||||
</ol>
|
|
||||||
</li>
|
|
||||||
</ol>
|
|
||||||
</li>
|
|
||||||
<li id="spec-bug-fixes-rollback">Bug Fixes & Rollback
|
|
||||||
<ol>
|
|
||||||
<li>You MUST NOT under any circumstances force push to the master branch.</li>
|
|
||||||
<li>If a change branch which has been merged into the master branch is found
|
|
||||||
to have a bug in it, the bug fix work MUST be done as a new separate
|
|
||||||
change branch and MUST follow the same workflow as any other change
|
|
||||||
branch.</li>
|
|
||||||
<li>If a change branch is wrongfully merged into master, or for any other
|
|
||||||
reason the merge must be undone, you MUST undo the merge by reverting the
|
|
||||||
merge commit itself. Effectively creating a new commit that reverses all
|
|
||||||
the relevant changes.</li>
|
|
||||||
</ol>
|
|
||||||
</li>
|
|
||||||
<li id="spec-git-best-practices">Git Best Practices
|
|
||||||
<ol>
|
|
||||||
<li>All commit messages SHOULD follow the Commit Guidelines and format from
|
|
||||||
the official git
|
|
||||||
documentation:
|
|
||||||
<a href="https://git-scm.com/book/en/v2/Distributed-Git-Contributing-to-a-Project">https://git-scm.com/book/en/v2/Distributed-Git-Contributing-to-a-Project</a></li>
|
|
||||||
<li>You SHOULD never blindly commit all changes with "git commit -a". It is
|
|
||||||
RECOMMENDED you use "git add -i" to add individual changes to the staging
|
|
||||||
area so you are fully aware of what you are committing.</li>
|
|
||||||
<li>You SHOULD always use "--force-with-lease" when doing a force push. The
|
|
||||||
regular "--force" option is dangerous and destructive. More
|
|
||||||
information:
|
|
||||||
<a href="https://developer.atlassian.com/blog/2015/04/force-with-lease/">https://developer.atlassian.com/blog/2015/04/force-with-lease/</a></li>
|
|
||||||
<li>You SHOULD understand and be comfortable with
|
|
||||||
rebasing: <a href="https://git-scm.com/book/en/v2/Git-Branching-Rebasing">https://git-scm.com/book/en/v2/Git-Branching-Rebasing</a></li>
|
|
||||||
<li>It is RECOMMENDED that you always do "git pull --rebase" instead of "git
|
|
||||||
pull" to avoid unnecessary merge commits. You can make this the default
|
|
||||||
behavior of "git pull" with "git config --global pull.rebase true".</li>
|
|
||||||
<li>It is RECOMMENDED that all branches be merged using "git merge --no-ff".
|
|
||||||
This makes sure the reference to the original branch is kept in the
|
|
||||||
commits, allows one to revert a merge by reverting a single merge commit,
|
|
||||||
and creates a merge commit to mark the integration of the branch with
|
|
||||||
master.</li>
|
|
||||||
</ol>
|
|
||||||
</li>
|
|
||||||
</ol> </section> </article> </div> </div> </div> </section> <section id="faq" class="py-20 sm:py-28"> <div class="section-container"> <div class="max-w-3xl mx-auto"> <div class="mb-12 text-center"> <h2 class="text-3xl sm:text-4xl mb-4">FAQ</h2> <p class="text-lg text-gray-600 dark:text-neutral-400"> Common questions about Git Common-Flow </p> </div> <!-- FAQ Items --> <div class="space-y-0"> </div> </div> </div> </section> <script type="module">function n(){document.querySelectorAll("[data-faq-item]").forEach(r=>{const t=r.querySelector("[data-faq-trigger]"),a=r.querySelector("[data-faq-content]"),s=r.querySelector("[data-faq-icon]");!t||!a||!s||t.addEventListener("click",()=>{const e=t.getAttribute("aria-expanded")==="true";t.setAttribute("aria-expanded",e?"false":"true"),a.classList.toggle("grid-rows-[1fr]",!e),a.classList.toggle("grid-rows-[0fr]",e),s.classList.toggle("rotate-180",!e)})})}n();document.addEventListener("astro:after-swap",n);</script> </main> <footer class="pt-12 pb-6 my-28 text-sm
|
|
||||||
text-gray-500 dark:text-neutral-500
|
|
||||||
border-t border-gray-200 dark:border-neutral-800"> <div class="section-container flex flex-col sm:flex-row
|
|
||||||
sm:justify-between sm:items-center gap-2"> <p>
|
|
||||||
License:
|
|
||||||
<a href="https://creativecommons.org/licenses/by/4.0/" class="hover:text-sky-600" target="_blank" rel="noopener noreferrer"> CC BY 4.0 </a> </p> <p> Git Common-Flow by
|
|
||||||
<a href="https://jimeh.me/" class="hover:text-sky-600" target="_blank" rel="noopener noreferrer"> Jim Myhrberg </a> </p> </div> </footer> <!-- Re-init theme on Astro page transitions --> <script type="module">document.addEventListener("astro:after-swap",()=>{const e=localStorage.getItem("theme"),t=window.matchMedia("(prefers-color-scheme: dark)").matches;e==="dark"||e!=="light"&&t?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")});</script> </body> </html>
|
|
||||||
|
Before Width: | Height: | Size: 18 KiB |
@@ -1,386 +0,0 @@
|
|||||||
<!DOCTYPE html><html lang="en"> <head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><link rel="canonical" href="https://commonflow.org/spec/1.0.0-rc.3/"><title>Git Common-Flow 1.0.0-rc.3 | Git Common-Flow</title><meta name="description" content="An attempt to gather a sensible selection of the most common usage patterns of git into a single and concise specification."><meta name="author" content="Jim Myhrberg"><!-- Open Graph --><meta property="og:title" content="Git Common-Flow 1.0.0-rc.3 | Git Common-Flow"><meta property="og:description" content="An attempt to gather a sensible selection of the most common usage patterns of git into a single and concise specification."><meta property="og:type" content="website"><meta property="og:url" content="https://commonflow.org/spec/1.0.0-rc.3/"><!-- Twitter --><meta name="twitter:card" content="summary"><meta name="twitter:title" content="Git Common-Flow 1.0.0-rc.3 | Git Common-Flow"><meta name="twitter:description" content="An attempt to gather a sensible selection of the most common usage patterns of git into a single and concise specification."><!-- Favicon --><link rel="icon" href="/favicon.ico" sizes="32x32"><link rel="icon" href="/favicon.svg" type="image/svg+xml"><link rel="apple-touch-icon" href="/apple-touch-icon.png"><!-- Prevent flash of wrong theme --><script>
|
|
||||||
(function () {
|
|
||||||
const mode = localStorage.getItem("theme");
|
|
||||||
const prefersDark = window.matchMedia(
|
|
||||||
"(prefers-color-scheme: dark)",
|
|
||||||
).matches;
|
|
||||||
if (mode === "dark" || (mode !== "light" && prefersDark)) {
|
|
||||||
document.documentElement.classList.add("dark");
|
|
||||||
}
|
|
||||||
})();
|
|
||||||
</script><link rel="stylesheet" href="/_astro/index.DF_wxGza.css"></head> <body class="min-h-screen"> <header id="site-header" class="fixed top-0 inset-x-0 z-50 border-b border-transparent
|
|
||||||
translate-y-[-100%] transition-transform duration-300
|
|
||||||
backdrop-blur-xl bg-gray-50/85 dark:bg-neutral-950/85"> <div class="max-w-6xl mx-auto px-4 sm:px-6 h-16 flex items-center justify-between"> <!-- Logo / Title + Version --> <div class="flex items-center gap-3"> <a href="#hero" class="flex items-center gap-3 no-underline
|
|
||||||
text-gray-950 dark:text-neutral-50
|
|
||||||
hover:text-sky-600 transition-colors"> <span class="font-display font-bold text-lg tracking-tight">
|
|
||||||
Git Common-Flow
|
|
||||||
</span> </a> <div class="hidden md:block"> <div class="relative" data-version-selector> <!-- Trigger button --> <button type="button" data-version-trigger aria-haspopup="listbox" aria-expanded="false" class="flex items-center gap-1.5 px-2.5 py-1.5 text-sm font-mono
|
|
||||||
border border-gray-200 dark:border-neutral-700
|
|
||||||
rounded-md bg-transparent cursor-pointer transition-colors
|
|
||||||
text-gray-600 dark:text-neutral-400
|
|
||||||
hover:border-sky-600 hover:text-gray-950 dark:hover:text-neutral-50"> <span>v1.0.0-rc.3</span> <svg width="1em" height="1em" data-arrow-icon="true" class="w-3.5 h-3.5 transition-transform duration-150" data-icon="heroicons:chevron-down"> <symbol id="ai:heroicons:chevron-down" viewBox="0 0 24 24"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="m19.5 8.25l-7.5 7.5l-7.5-7.5"/></symbol><use href="#ai:heroicons:chevron-down"></use> </svg> </button> <!-- Dropdown menu --> <div data-version-dropdown role="listbox" aria-label="Select version" class="absolute top-full left-0 mt-2 min-w-full p-1.5 z-50
|
|
||||||
bg-gray-50 dark:bg-neutral-900
|
|
||||||
border border-gray-200 dark:border-neutral-700
|
|
||||||
rounded-lg shadow-lg
|
|
||||||
opacity-0 invisible -translate-y-1 transition-all duration-150
|
|
||||||
data-[open]:opacity-100 data-[open]:visible data-[open]:translate-y-0"> <a href="/spec/1.0.0-rc.5" role="option" aria-selected="false" class="block px-3 py-2 font-mono text-sm rounded transition-colors text-gray-600 dark:text-neutral-400 hover:bg-gray-100 dark:hover:bg-neutral-800 hover:text-gray-950 dark:hover:text-neutral-50">
|
|
||||||
v1.0.0-rc.5 </a><a href="/spec/1.0.0-rc.4" role="option" aria-selected="false" class="block px-3 py-2 font-mono text-sm rounded transition-colors text-gray-600 dark:text-neutral-400 hover:bg-gray-100 dark:hover:bg-neutral-800 hover:text-gray-950 dark:hover:text-neutral-50">
|
|
||||||
v1.0.0-rc.4 </a><a href="/spec/1.0.0-rc.3" role="option" aria-selected="true" class="block px-3 py-2 font-mono text-sm rounded transition-colors text-gray-600 dark:text-neutral-400 hover:bg-gray-100 dark:hover:bg-neutral-800 hover:text-gray-950 dark:hover:text-neutral-50 bg-sky-500/15 dark:bg-sky-500/20 text-sky-600 dark:text-sky-400">
|
|
||||||
v1.0.0-rc.3 </a><a href="/spec/1.0.0-rc.2" role="option" aria-selected="false" class="block px-3 py-2 font-mono text-sm rounded transition-colors text-gray-600 dark:text-neutral-400 hover:bg-gray-100 dark:hover:bg-neutral-800 hover:text-gray-950 dark:hover:text-neutral-50">
|
|
||||||
v1.0.0-rc.2 </a><a href="/spec/1.0.0-rc.1" role="option" aria-selected="false" class="block px-3 py-2 font-mono text-sm rounded transition-colors text-gray-600 dark:text-neutral-400 hover:bg-gray-100 dark:hover:bg-neutral-800 hover:text-gray-950 dark:hover:text-neutral-50">
|
|
||||||
v1.0.0-rc.1 </a> </div> </div> <script type="module">function c(){document.querySelectorAll("[data-version-selector]").forEach(e=>{if(e.dataset.initialized)return;e.dataset.initialized="true";const t=e.querySelector("[data-version-trigger]"),a=e.querySelector("[data-version-dropdown]"),n=e.querySelector("[data-arrow-icon]");if(!t||!a)return;const l=()=>{a.dataset.open="true",t.setAttribute("aria-expanded","true"),n&&(n.style.transform="rotate(180deg)")},o=()=>{delete a.dataset.open,t.setAttribute("aria-expanded","false"),n&&(n.style.transform="")};t.addEventListener("click",r=>{r.stopPropagation();const u=a.dataset.open==="true";document.querySelectorAll("[data-version-dropdown][data-open]").forEach(s=>{delete s.dataset.open;const i=s.previousElementSibling;i?.setAttribute("aria-expanded","false");const d=i?.querySelector("[data-arrow-icon]");d&&(d.style.transform="")}),u?o():l()}),document.addEventListener("click",r=>{e.contains(r.target)||o()}),document.addEventListener("keydown",r=>{r.key==="Escape"&&a.dataset.open==="true"&&(o(),t.focus())})})}c();document.addEventListener("astro:after-swap",c);</script> </div> </div> <!-- Desktop Navigation --> <nav class="hidden md:flex items-center gap-1"> <a href="#about" class="nav-link inline-flex items-center gap-1.5 px-4 py-2 text-sm
|
|
||||||
font-medium rounded-lg transition-colors cursor-pointer
|
|
||||||
text-gray-600 dark:text-neutral-400
|
|
||||||
hover:bg-gray-100 hover:text-gray-950
|
|
||||||
dark:hover:bg-neutral-800 dark:hover:text-neutral-50" data-nav-link data-section-id="about"> <svg width="1em" height="1em" class="w-4 h-4" data-icon="heroicons:information-circle"> <symbol id="ai:heroicons:information-circle" viewBox="0 0 24 24"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="m11.25 11.25l.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0a9 9 0 0 1 18 0m-9-3.75h.008v.008H12z"/></symbol><use href="#ai:heroicons:information-circle"></use> </svg> About </a><a href="#spec" class="nav-link inline-flex items-center gap-1.5 px-4 py-2 text-sm
|
|
||||||
font-medium rounded-lg transition-colors cursor-pointer
|
|
||||||
text-gray-600 dark:text-neutral-400
|
|
||||||
hover:bg-gray-100 hover:text-gray-950
|
|
||||||
dark:hover:bg-neutral-800 dark:hover:text-neutral-50" data-nav-link data-section-id="spec"> <svg width="1em" height="1em" class="w-4 h-4" data-icon="heroicons:document-text"> <symbol id="ai:heroicons:document-text" viewBox="0 0 24 24"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9"/></symbol><use href="#ai:heroicons:document-text"></use> </svg> Spec </a><a href="#faq" class="nav-link inline-flex items-center gap-1.5 px-4 py-2 text-sm
|
|
||||||
font-medium rounded-lg transition-colors cursor-pointer
|
|
||||||
text-gray-600 dark:text-neutral-400
|
|
||||||
hover:bg-gray-100 hover:text-gray-950
|
|
||||||
dark:hover:bg-neutral-800 dark:hover:text-neutral-50" data-nav-link data-section-id="faq"> <svg width="1em" height="1em" class="w-4 h-4" data-icon="heroicons:question-mark-circle"> <symbol id="ai:heroicons:question-mark-circle" viewBox="0 0 24 24"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M9.879 7.519c1.172-1.025 3.071-1.025 4.243 0c1.171 1.025 1.171 2.687 0 3.712q-.308.268-.67.442c-.746.361-1.452.999-1.452 1.827v.75M21 12a9 9 0 1 1-18 0a9 9 0 0 1 18 0m-9 5.25h.008v.008H12z"/></symbol><use href="#ai:heroicons:question-mark-circle"></use> </svg> FAQ </a> </nav> <!-- Right side: Theme, GitHub --> <div class="flex items-center gap-3"> <div class="relative group"> <button data-theme-toggle type="button" class="p-2 rounded-lg cursor-pointer transition-colors duration-200
|
|
||||||
text-gray-500 dark:text-neutral-500
|
|
||||||
hover:text-gray-950 dark:hover:text-neutral-50
|
|
||||||
hover:bg-gray-100 dark:hover:bg-neutral-800" aria-label="Toggle theme"> <svg width="1em" height="1em" data-theme-icon="light" class="hidden w-5 h-5" data-icon="heroicons:sun"> <symbol id="ai:heroicons:sun" viewBox="0 0 24 24"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M12 3v2.25m6.364.386l-1.591 1.591M21 12h-2.25m-.386 6.364l-1.591-1.591M12 18.75V21m-4.773-4.227l-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 1 1-7.5 0a3.75 3.75 0 0 1 7.5 0"/></symbol><use href="#ai:heroicons:sun"></use> </svg> <svg width="1em" height="1em" data-theme-icon="dark" class="hidden w-5 h-5" data-icon="heroicons:moon"> <symbol id="ai:heroicons:moon" viewBox="0 0 24 24"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M21.752 15.002A9.7 9.7 0 0 1 18 15.75A9.75 9.75 0 0 1 8.25 6c0-1.33.266-2.597.748-3.752A9.75 9.75 0 0 0 3 11.25A9.75 9.75 0 0 0 12.75 21a9.75 9.75 0 0 0 9.002-5.998"/></symbol><use href="#ai:heroicons:moon"></use> </svg> <svg width="1em" height="1em" data-theme-icon="auto" class="hidden w-5 h-5" data-icon="heroicons:computer-desktop"> <symbol id="ai:heroicons:computer-desktop" viewBox="0 0 24 24"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M9 17.25v1.007a3 3 0 0 1-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0 1 15 18.257V17.25m6-12V15a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 15V5.25m18 0A2.25 2.25 0 0 0 18.75 3H5.25A2.25 2.25 0 0 0 3 5.25m18 0V12a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 12V5.25"/></symbol><use href="#ai:heroicons:computer-desktop"></use> </svg> </button> <!-- Tooltip --> <div class="absolute left-1/2 -translate-x-1/2 top-full mt-2
|
|
||||||
px-2 py-1 text-xs font-medium whitespace-nowrap rounded-md shadow-sm
|
|
||||||
bg-gray-900 text-white dark:bg-white dark:text-gray-900
|
|
||||||
opacity-0 group-hover:opacity-100
|
|
||||||
transition-opacity duration-200 pointer-events-none"> <span data-tooltip-text="light" class="hidden">Light</span> <span data-tooltip-text="dark" class="hidden">Dark</span> <span data-tooltip-text="auto" class="hidden">System</span> </div> </div> <script type="module">function r(){const c=document.querySelectorAll("[data-theme-toggle]");function n(){const e=localStorage.getItem("theme");return e==="dark"||e==="light"||e==="auto"?e:"auto"}function i(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function d(e){return e==="auto"?i():e}function s(e){document.querySelectorAll("[data-theme-icon]").forEach(t=>{const a=t.dataset.themeIcon;t.classList.toggle("hidden",a!==e)}),document.querySelectorAll("[data-tooltip-text]").forEach(t=>{const a=t.dataset.tooltipText;t.classList.toggle("hidden",a!==e)})}function o(e){d(e)==="dark"?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark"),s(e)}function u(e){localStorage.setItem("theme",e),o(e)}function l(){const e=n();return e==="light"?"dark":e==="dark"?"auto":"light"}const f=n();o(f),c.forEach(e=>{e.dataset.initialized||(e.dataset.initialized="true",e.addEventListener("click",()=>{u(l())}))}),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{n()==="auto"&&o("auto")})}r();document.addEventListener("astro:after-swap",r);</script> <a href="https://github.com/jimeh/common-flow" target="_blank" rel="noopener noreferrer" class="p-2 rounded-lg transition-colors
|
|
||||||
text-gray-500 dark:text-neutral-500
|
|
||||||
hover:text-gray-950 dark:hover:text-neutral-50
|
|
||||||
hover:bg-gray-100 dark:hover:bg-neutral-800" aria-label="View on GitHub"> <svg width="1em" height="1em" class="w-5 h-5" data-icon="simple-icons:github"> <symbol id="ai:simple-icons:github" viewBox="0 0 24 24"><path fill="currentColor" d="M12 .297c-6.63 0-12 5.373-12 12c0 5.303 3.438 9.8 8.205 11.385c.6.113.82-.258.82-.577c0-.285-.01-1.04-.015-2.04c-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729c1.205.084 1.838 1.236 1.838 1.236c1.07 1.835 2.809 1.305 3.495.998c.108-.776.417-1.305.76-1.605c-2.665-.3-5.466-1.332-5.466-5.93c0-1.31.465-2.38 1.235-3.22c-.135-.303-.54-1.523.105-3.176c0 0 1.005-.322 3.3 1.23c.96-.267 1.98-.399 3-.405c1.02.006 2.04.138 3 .405c2.28-1.552 3.285-1.23 3.285-1.23c.645 1.653.24 2.873.12 3.176c.765.84 1.23 1.91 1.23 3.22c0 4.61-2.805 5.625-5.475 5.92c.42.36.81 1.096.81 2.22c0 1.606-.015 2.896-.015 3.286c0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"/></symbol><use href="#ai:simple-icons:github"></use> </svg> </a> <!-- Mobile menu button --> <button id="mobile-menu-btn" class="md:hidden p-2 rounded-lg
|
|
||||||
text-gray-500 dark:text-neutral-500
|
|
||||||
hover:bg-gray-100 dark:hover:bg-neutral-800" aria-label="Toggle menu"> <svg width="1em" height="1em" class="w-5 h-5" data-icon="heroicons:bars-3"> <symbol id="ai:heroicons:bars-3" viewBox="0 0 24 24"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5"/></symbol><use href="#ai:heroicons:bars-3"></use> </svg> </button> </div> </div> <!-- Mobile Navigation --> <nav id="mobile-nav" class="md:hidden hidden border-t border-gray-200 dark:border-neutral-800"> <div class="px-4 py-3 space-y-1 text-center"> <div class="py-2 flex justify-center"> <div class="relative" data-version-selector> <!-- Trigger button --> <button type="button" data-version-trigger aria-haspopup="listbox" aria-expanded="false" class="flex items-center gap-1.5 px-2.5 py-1.5 text-sm font-mono
|
|
||||||
border border-gray-200 dark:border-neutral-700
|
|
||||||
rounded-md bg-transparent cursor-pointer transition-colors
|
|
||||||
text-gray-600 dark:text-neutral-400
|
|
||||||
hover:border-sky-600 hover:text-gray-950 dark:hover:text-neutral-50"> <span>v1.0.0-rc.3</span> <svg width="1em" height="1em" viewBox="0 0 24 24" data-arrow-icon="true" class="w-3.5 h-3.5 transition-transform duration-150" data-icon="heroicons:chevron-down"> <use href="#ai:heroicons:chevron-down"></use> </svg> </button> <!-- Dropdown menu --> <div data-version-dropdown role="listbox" aria-label="Select version" class="absolute top-full left-0 mt-2 min-w-full p-1.5 z-50
|
|
||||||
bg-gray-50 dark:bg-neutral-900
|
|
||||||
border border-gray-200 dark:border-neutral-700
|
|
||||||
rounded-lg shadow-lg
|
|
||||||
opacity-0 invisible -translate-y-1 transition-all duration-150
|
|
||||||
data-[open]:opacity-100 data-[open]:visible data-[open]:translate-y-0"> <a href="/spec/1.0.0-rc.5" role="option" aria-selected="false" class="block px-3 py-2 font-mono text-sm rounded transition-colors text-gray-600 dark:text-neutral-400 hover:bg-gray-100 dark:hover:bg-neutral-800 hover:text-gray-950 dark:hover:text-neutral-50">
|
|
||||||
v1.0.0-rc.5 </a><a href="/spec/1.0.0-rc.4" role="option" aria-selected="false" class="block px-3 py-2 font-mono text-sm rounded transition-colors text-gray-600 dark:text-neutral-400 hover:bg-gray-100 dark:hover:bg-neutral-800 hover:text-gray-950 dark:hover:text-neutral-50">
|
|
||||||
v1.0.0-rc.4 </a><a href="/spec/1.0.0-rc.3" role="option" aria-selected="true" class="block px-3 py-2 font-mono text-sm rounded transition-colors text-gray-600 dark:text-neutral-400 hover:bg-gray-100 dark:hover:bg-neutral-800 hover:text-gray-950 dark:hover:text-neutral-50 bg-sky-500/15 dark:bg-sky-500/20 text-sky-600 dark:text-sky-400">
|
|
||||||
v1.0.0-rc.3 </a><a href="/spec/1.0.0-rc.2" role="option" aria-selected="false" class="block px-3 py-2 font-mono text-sm rounded transition-colors text-gray-600 dark:text-neutral-400 hover:bg-gray-100 dark:hover:bg-neutral-800 hover:text-gray-950 dark:hover:text-neutral-50">
|
|
||||||
v1.0.0-rc.2 </a><a href="/spec/1.0.0-rc.1" role="option" aria-selected="false" class="block px-3 py-2 font-mono text-sm rounded transition-colors text-gray-600 dark:text-neutral-400 hover:bg-gray-100 dark:hover:bg-neutral-800 hover:text-gray-950 dark:hover:text-neutral-50">
|
|
||||||
v1.0.0-rc.1 </a> </div> </div> </div> <a href="#about" class="nav-link flex items-center justify-center gap-1.5 py-2
|
|
||||||
text-gray-600 dark:text-neutral-400 hover:text-sky-600" data-nav-link data-section-id="about"> <svg width="1em" height="1em" viewBox="0 0 24 24" class="w-4 h-4" data-icon="heroicons:information-circle"> <use href="#ai:heroicons:information-circle"></use> </svg> About </a><a href="#spec" class="nav-link flex items-center justify-center gap-1.5 py-2
|
|
||||||
text-gray-600 dark:text-neutral-400 hover:text-sky-600" data-nav-link data-section-id="spec"> <svg width="1em" height="1em" viewBox="0 0 24 24" class="w-4 h-4" data-icon="heroicons:document-text"> <use href="#ai:heroicons:document-text"></use> </svg> Spec </a><a href="#faq" class="nav-link flex items-center justify-center gap-1.5 py-2
|
|
||||||
text-gray-600 dark:text-neutral-400 hover:text-sky-600" data-nav-link data-section-id="faq"> <svg width="1em" height="1em" viewBox="0 0 24 24" class="w-4 h-4" data-icon="heroicons:question-mark-circle"> <use href="#ai:heroicons:question-mark-circle"></use> </svg> FAQ </a> </div> </nav> </header> <script type="module" src="/_astro/Header.astro_astro_type_script_index_0_lang.ClIJVJFM.js"></script> <main> <section id="hero" class="relative min-h-[75vh] flex flex-col items-center justify-center
|
|
||||||
px-6 pt-16 pb-24 overflow-hidden"> <!-- Background gradient/texture --> <div class="absolute inset-0 bg-gradient-to-b
|
|
||||||
from-gray-100 to-gray-50
|
|
||||||
dark:from-neutral-900 dark:to-neutral-950"></div> <!-- Subtle grid pattern with fade --> <div class="absolute inset-0 opacity-[0.06] dark:opacity-[0.12]
|
|
||||||
bg-[linear-gradient(theme(colors.gray.950)_1px,transparent_1px),linear-gradient(90deg,theme(colors.gray.950)_1px,transparent_1px)]
|
|
||||||
dark:bg-[linear-gradient(theme(colors.neutral.600)_1px,transparent_1px),linear-gradient(90deg,theme(colors.neutral.600)_1px,transparent_1px)]
|
|
||||||
bg-[size:60px_60px] bg-center
|
|
||||||
[-webkit-mask-image:linear-gradient(to_bottom,black_20%,transparent_80%)]
|
|
||||||
[mask-image:linear-gradient(to_bottom,black_20%,transparent_80%)]"></div> <!-- Top bar with version & theme --> <div class="absolute top-0 inset-x-0 z-20 flex items-center justify-between
|
|
||||||
px-6 py-4 animate-fade-in-down"> <div class="flex items-center gap-3"> <div class="relative" data-version-selector> <!-- Trigger button --> <button type="button" data-version-trigger aria-haspopup="listbox" aria-expanded="false" class="flex items-center gap-1.5 px-2.5 py-1.5 text-sm font-mono
|
|
||||||
border border-gray-200 dark:border-neutral-700
|
|
||||||
rounded-md bg-transparent cursor-pointer transition-colors
|
|
||||||
text-gray-600 dark:text-neutral-400
|
|
||||||
hover:border-sky-600 hover:text-gray-950 dark:hover:text-neutral-50"> <span>v1.0.0-rc.3</span> <svg width="1em" height="1em" viewBox="0 0 24 24" data-arrow-icon="true" class="w-3.5 h-3.5 transition-transform duration-150" data-icon="heroicons:chevron-down"> <use href="#ai:heroicons:chevron-down"></use> </svg> </button> <!-- Dropdown menu --> <div data-version-dropdown role="listbox" aria-label="Select version" class="absolute top-full left-0 mt-2 min-w-full p-1.5 z-50
|
|
||||||
bg-gray-50 dark:bg-neutral-900
|
|
||||||
border border-gray-200 dark:border-neutral-700
|
|
||||||
rounded-lg shadow-lg
|
|
||||||
opacity-0 invisible -translate-y-1 transition-all duration-150
|
|
||||||
data-[open]:opacity-100 data-[open]:visible data-[open]:translate-y-0"> <a href="/spec/1.0.0-rc.5" role="option" aria-selected="false" class="block px-3 py-2 font-mono text-sm rounded transition-colors text-gray-600 dark:text-neutral-400 hover:bg-gray-100 dark:hover:bg-neutral-800 hover:text-gray-950 dark:hover:text-neutral-50">
|
|
||||||
v1.0.0-rc.5 </a><a href="/spec/1.0.0-rc.4" role="option" aria-selected="false" class="block px-3 py-2 font-mono text-sm rounded transition-colors text-gray-600 dark:text-neutral-400 hover:bg-gray-100 dark:hover:bg-neutral-800 hover:text-gray-950 dark:hover:text-neutral-50">
|
|
||||||
v1.0.0-rc.4 </a><a href="/spec/1.0.0-rc.3" role="option" aria-selected="true" class="block px-3 py-2 font-mono text-sm rounded transition-colors text-gray-600 dark:text-neutral-400 hover:bg-gray-100 dark:hover:bg-neutral-800 hover:text-gray-950 dark:hover:text-neutral-50 bg-sky-500/15 dark:bg-sky-500/20 text-sky-600 dark:text-sky-400">
|
|
||||||
v1.0.0-rc.3 </a><a href="/spec/1.0.0-rc.2" role="option" aria-selected="false" class="block px-3 py-2 font-mono text-sm rounded transition-colors text-gray-600 dark:text-neutral-400 hover:bg-gray-100 dark:hover:bg-neutral-800 hover:text-gray-950 dark:hover:text-neutral-50">
|
|
||||||
v1.0.0-rc.2 </a><a href="/spec/1.0.0-rc.1" role="option" aria-selected="false" class="block px-3 py-2 font-mono text-sm rounded transition-colors text-gray-600 dark:text-neutral-400 hover:bg-gray-100 dark:hover:bg-neutral-800 hover:text-gray-950 dark:hover:text-neutral-50">
|
|
||||||
v1.0.0-rc.1 </a> </div> </div> </div> <div class="flex items-center gap-2"> <div class="relative group"> <button data-theme-toggle type="button" class="p-2 rounded-lg cursor-pointer transition-colors duration-200
|
|
||||||
text-gray-500 dark:text-neutral-500
|
|
||||||
hover:text-gray-950 dark:hover:text-neutral-50
|
|
||||||
hover:bg-gray-100 dark:hover:bg-neutral-800" aria-label="Toggle theme"> <svg width="1em" height="1em" viewBox="0 0 24 24" data-theme-icon="light" class="hidden w-5 h-5" data-icon="heroicons:sun"> <use href="#ai:heroicons:sun"></use> </svg> <svg width="1em" height="1em" viewBox="0 0 24 24" data-theme-icon="dark" class="hidden w-5 h-5" data-icon="heroicons:moon"> <use href="#ai:heroicons:moon"></use> </svg> <svg width="1em" height="1em" viewBox="0 0 24 24" data-theme-icon="auto" class="hidden w-5 h-5" data-icon="heroicons:computer-desktop"> <use href="#ai:heroicons:computer-desktop"></use> </svg> </button> <!-- Tooltip --> <div class="absolute left-1/2 -translate-x-1/2 top-full mt-2
|
|
||||||
px-2 py-1 text-xs font-medium whitespace-nowrap rounded-md shadow-sm
|
|
||||||
bg-gray-900 text-white dark:bg-white dark:text-gray-900
|
|
||||||
opacity-0 group-hover:opacity-100
|
|
||||||
transition-opacity duration-200 pointer-events-none"> <span data-tooltip-text="light" class="hidden">Light</span> <span data-tooltip-text="dark" class="hidden">Dark</span> <span data-tooltip-text="auto" class="hidden">System</span> </div> </div> <a href="https://github.com/jimeh/common-flow" target="_blank" rel="noopener noreferrer" class="p-2 rounded-lg transition-colors
|
|
||||||
text-gray-500 dark:text-neutral-500
|
|
||||||
hover:text-gray-950 dark:hover:text-neutral-50
|
|
||||||
hover:bg-white/50 dark:hover:bg-neutral-800/50" aria-label="View on GitHub"> <svg width="1em" height="1em" viewBox="0 0 24 24" class="w-5 h-5" data-icon="simple-icons:github"> <use href="#ai:simple-icons:github"></use> </svg> </a> </div> </div> <!-- Main content --> <div class="relative z-10 w-full max-w-4xl mx-auto text-center"> <!-- Title --> <h1 class="animate-fade-in-up mb-4
|
|
||||||
text-gray-950 dark:text-neutral-50">
|
|
||||||
Git Common-Flow
|
|
||||||
</h1> <!-- Tagline --> <p class="animate-fade-in-up delay-100
|
|
||||||
text-lg sm:text-xl max-w-2xl mx-auto mb-8
|
|
||||||
text-gray-600 dark:text-neutral-400">
|
|
||||||
A sensible git workflow for teams who ship
|
|
||||||
</p> <!-- Version badge --> <div class="animate-fade-in-up delay-200 mb-10"> <span class="inline-flex items-center px-3 py-1 font-mono text-xs font-medium
|
|
||||||
rounded-full border
|
|
||||||
bg-gray-100 border-gray-200 text-gray-500
|
|
||||||
dark:bg-neutral-800/50 dark:border-neutral-700 dark:text-neutral-400">
|
|
||||||
v1.0.0-rc.3 </span> </div> <!-- SVG Diagram --> <div class="animate-fade-in-up delay-300
|
|
||||||
relative mx-auto mb-12 p-4 sm:p-8
|
|
||||||
bg-white dark:bg-neutral-900
|
|
||||||
rounded-2xl shadow-lg dark:shadow-none
|
|
||||||
border border-gray-200 dark:border-neutral-800"> <img src="/spec/1.0.0-rc.3.svg" alt="Git Common-Flow diagram" class="w-full h-auto max-w-3xl mx-auto
|
|
||||||
dark:invert dark:hue-rotate-180 dark:contrast-90"> </div> <!-- Navigation links --> <nav class="animate-fade-in-up delay-400
|
|
||||||
flex flex-wrap items-center justify-center gap-4"> <a href="#about" class="inline-flex items-center justify-center gap-2 px-6 py-3
|
|
||||||
text-base font-medium rounded-lg transition-all cursor-pointer
|
|
||||||
text-gray-600 dark:text-neutral-400
|
|
||||||
hover:bg-gray-100 hover:text-gray-950
|
|
||||||
dark:hover:bg-neutral-800 dark:hover:text-neutral-50">
|
|
||||||
About
|
|
||||||
</a> <a href="#spec" class="inline-flex items-center justify-center gap-2 px-6 py-3
|
|
||||||
text-base font-medium rounded-lg transition-all cursor-pointer
|
|
||||||
bg-sky-600 text-white
|
|
||||||
hover:bg-sky-500 hover:-translate-y-0.5 hover:shadow-md">
|
|
||||||
Read the Spec
|
|
||||||
</a> <a href="#faq" class="inline-flex items-center justify-center gap-2 px-6 py-3
|
|
||||||
text-base font-medium rounded-lg transition-all cursor-pointer
|
|
||||||
text-gray-600 dark:text-neutral-400
|
|
||||||
hover:bg-gray-100 hover:text-gray-950
|
|
||||||
dark:hover:bg-neutral-800 dark:hover:text-neutral-50">
|
|
||||||
FAQ
|
|
||||||
</a> </nav> </div> <!-- Scroll indicator --> <a href="#about" class="absolute bottom-8 left-1/2 -translate-x-1/2
|
|
||||||
animate-fade-in delay-700
|
|
||||||
text-gray-500 dark:text-neutral-500
|
|
||||||
hover:text-sky-600 transition-colors" aria-label="Scroll to content"> <svg width="1em" height="1em" class="w-6 h-6 animate-bounce-subtle" data-icon="heroicons:arrow-down"> <symbol id="ai:heroicons:arrow-down" viewBox="0 0 24 24"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M19.5 13.5L12 21m0 0l-7.5-7.5M12 21V3"/></symbol><use href="#ai:heroicons:arrow-down"></use> </svg> </a> </section> <section id="about" class="py-20 sm:py-28"> <div class="section-container"> <div class="max-w-3xl mx-auto"> <div class="mb-12 text-center"> <h2 class="text-3xl sm:text-4xl mb-4">About Common-Flow</h2> <p class="text-lg text-gray-600 dark:text-neutral-400"> A practical git workflow that combines the best of GitHub Flow with versioned releases </p> </div> <!-- Introduction --> <div class="prose-spec mb-12"></div> <!-- Summary as feature cards --> <div class="mb-16"> <h3 class="text-xl font-display font-semibold mb-6
|
|
||||||
text-gray-950 dark:text-neutral-50">
|
|
||||||
Key Principles
|
|
||||||
</h3> <div class="prose-spec"><p>Common-Flow is an attempt to gather a sensible selection of the most common
|
|
||||||
usage patterns of git into a single and concise specification. It is based on
|
|
||||||
the <a href="http://scottchacon.com/2011/08/31/github-flow.html">original variant</a>
|
|
||||||
of <a href="https://guides.github.com/introduction/flow/">GitHub Flow</a>, while taking
|
|
||||||
into account how a lot of open source projects use git.</p>
|
|
||||||
<p>In short, Common-Flow is essentially GitHub Flow with the addition of versioned
|
|
||||||
releases, optional release branches, and without the requirement to deploy to
|
|
||||||
production all the time.</p></div> </div> <!-- Feedback & License --> <div class="pt-8 border-t border-gray-200 dark:border-neutral-800"> <div class="grid sm:grid-cols-2 gap-8"> <div> <h4 class="text-sm font-semibold uppercase tracking-wider mb-3
|
|
||||||
text-gray-500 dark:text-neutral-500">
|
|
||||||
Feedback
|
|
||||||
</h4> <p class="text-gray-600 dark:text-neutral-400">
|
|
||||||
Please <a href="https://github.com/jimeh/common-flow/issues" class="text-sky-600 hover:text-sky-400" target="_blank" rel="noopener noreferrer">open an issue on GitHub</a>.
|
|
||||||
</p> </div> <div> <h4 class="text-sm font-semibold uppercase tracking-wider mb-3
|
|
||||||
text-gray-500 dark:text-neutral-500">
|
|
||||||
License
|
|
||||||
</h4> <div class="text-gray-600 dark:text-neutral-400"><p><a href="http://creativecommons.org/licenses/by/3.0/">Creative Commons - CC BY 3.0</a></p></div> </div> </div> </div> </div> </div> </section> <section id="spec" class="py-20 sm:py-28"> <div class="section-container"> <div class="mb-12 text-center max-w-3xl mx-auto"> <h2 class="text-3xl sm:text-4xl mb-4">The Specification</h2> <p class="text-lg text-gray-600 dark:text-neutral-400"> The complete Git Common-Flow specification </p> </div> <!-- Content with sidebar --> <div class="lg:flex lg:gap-8"> <!-- Sidebar --> <div class="lg:w-64 lg:flex-shrink-0"> <aside id="spec-sidebar" class="hidden lg:block lg:sticky lg:top-24 lg:self-start
|
|
||||||
lg:max-h-[calc(100vh-8rem)] lg:overflow-y-auto
|
|
||||||
lg:pr-8 lg:mr-8 lg:border-r border-gray-200 dark:border-neutral-800"> <nav class="space-y-1 py-2"> <div class="text-xs font-semibold uppercase tracking-wider mb-4
|
|
||||||
text-gray-500 dark:text-neutral-500">
|
|
||||||
Table of Contents
|
|
||||||
</div> <a href="#terminology" class="sidebar-link block py-2 px-4 text-sm rounded-md transition-colors text-gray-500 hover:text-gray-950 hover:bg-gray-100 dark:text-neutral-500 dark:hover:text-neutral-50 dark:hover:bg-neutral-800" data-sidebar-link data-section-id="terminology"> <span>Terminology</span> </a><a href="#specification" class="sidebar-link block py-2 px-4 text-sm rounded-md transition-colors text-gray-500 hover:text-gray-950 hover:bg-gray-100 dark:text-neutral-500 dark:hover:text-neutral-50 dark:hover:bg-neutral-800" data-sidebar-link data-section-id="specification"> <span>Specification</span> </a><a href="#spec-tldr" class="sidebar-link block py-2 px-4 text-sm rounded-md transition-colors text-gray-500 hover:text-gray-950 hover:bg-gray-100 dark:text-neutral-500 dark:hover:text-neutral-50 dark:hover:bg-neutral-800 pl-6 text-[0.8125rem] flex" data-sidebar-link data-section-id="spec-tldr"> <span class="shrink-0 w-6 text-gray-400 dark:text-neutral-600"> 1. </span> <span>TL;DR</span> </a><a href="#spec-the-master-branch" class="sidebar-link block py-2 px-4 text-sm rounded-md transition-colors text-gray-500 hover:text-gray-950 hover:bg-gray-100 dark:text-neutral-500 dark:hover:text-neutral-50 dark:hover:bg-neutral-800 pl-6 text-[0.8125rem] flex" data-sidebar-link data-section-id="spec-the-master-branch"> <span class="shrink-0 w-6 text-gray-400 dark:text-neutral-600"> 2. </span> <span>The Master Branch</span> </a><a href="#spec-change-branches" class="sidebar-link block py-2 px-4 text-sm rounded-md transition-colors text-gray-500 hover:text-gray-950 hover:bg-gray-100 dark:text-neutral-500 dark:hover:text-neutral-50 dark:hover:bg-neutral-800 pl-6 text-[0.8125rem] flex" data-sidebar-link data-section-id="spec-change-branches"> <span class="shrink-0 w-6 text-gray-400 dark:text-neutral-600"> 3. </span> <span>Change Branches</span> </a><a href="#spec-pull-requests" class="sidebar-link block py-2 px-4 text-sm rounded-md transition-colors text-gray-500 hover:text-gray-950 hover:bg-gray-100 dark:text-neutral-500 dark:hover:text-neutral-50 dark:hover:bg-neutral-800 pl-6 text-[0.8125rem] flex" data-sidebar-link data-section-id="spec-pull-requests"> <span class="shrink-0 w-6 text-gray-400 dark:text-neutral-600"> 4. </span> <span>Pull Requests</span> </a><a href="#spec-versioning" class="sidebar-link block py-2 px-4 text-sm rounded-md transition-colors text-gray-500 hover:text-gray-950 hover:bg-gray-100 dark:text-neutral-500 dark:hover:text-neutral-50 dark:hover:bg-neutral-800 pl-6 text-[0.8125rem] flex" data-sidebar-link data-section-id="spec-versioning"> <span class="shrink-0 w-6 text-gray-400 dark:text-neutral-600"> 5. </span> <span>Versioning</span> </a><a href="#spec-releases" class="sidebar-link block py-2 px-4 text-sm rounded-md transition-colors text-gray-500 hover:text-gray-950 hover:bg-gray-100 dark:text-neutral-500 dark:hover:text-neutral-50 dark:hover:bg-neutral-800 pl-6 text-[0.8125rem] flex" data-sidebar-link data-section-id="spec-releases"> <span class="shrink-0 w-6 text-gray-400 dark:text-neutral-600"> 6. </span> <span>Releases</span> </a><a href="#spec-release-branches" class="sidebar-link block py-2 px-4 text-sm rounded-md transition-colors text-gray-500 hover:text-gray-950 hover:bg-gray-100 dark:text-neutral-500 dark:hover:text-neutral-50 dark:hover:bg-neutral-800 pl-6 text-[0.8125rem] flex" data-sidebar-link data-section-id="spec-release-branches"> <span class="shrink-0 w-6 text-gray-400 dark:text-neutral-600"> 7. </span> <span>Release Branches</span> </a><a href="#spec-bug-fixes-rollback" class="sidebar-link block py-2 px-4 text-sm rounded-md transition-colors text-gray-500 hover:text-gray-950 hover:bg-gray-100 dark:text-neutral-500 dark:hover:text-neutral-50 dark:hover:bg-neutral-800 pl-6 text-[0.8125rem] flex" data-sidebar-link data-section-id="spec-bug-fixes-rollback"> <span class="shrink-0 w-6 text-gray-400 dark:text-neutral-600"> 8. </span> <span>Bug Fixes & Rollback</span> </a><a href="#spec-git-best-practices" class="sidebar-link block py-2 px-4 text-sm rounded-md transition-colors text-gray-500 hover:text-gray-950 hover:bg-gray-100 dark:text-neutral-500 dark:hover:text-neutral-50 dark:hover:bg-neutral-800 pl-6 text-[0.8125rem] flex" data-sidebar-link data-section-id="spec-git-best-practices"> <span class="shrink-0 w-6 text-gray-400 dark:text-neutral-600"> 9. </span> <span>Git Best Practices</span> </a> </nav> </aside> <!-- Mobile floating button --> <button id="spec-toc-toggle" class="lg:hidden fixed bottom-6 right-6 z-40
|
|
||||||
w-12 h-12 rounded-full shadow-lg
|
|
||||||
bg-sky-600 text-white
|
|
||||||
flex items-center justify-center
|
|
||||||
hover:bg-sky-500
|
|
||||||
transition-all duration-200" aria-label="Jump to section"> <svg width="1em" height="1em" class="w-5 h-5" data-icon="heroicons:bars-3-bottom-left"> <symbol id="ai:heroicons:bars-3-bottom-left" viewBox="0 0 24 24"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25H12"/></symbol><use href="#ai:heroicons:bars-3-bottom-left"></use> </svg> </button> <!-- Mobile TOC drawer --> <div id="spec-toc-drawer" class="lg:hidden fixed inset-0 z-50 hidden" data-toc-drawer> <!-- Backdrop --> <div class="absolute inset-0 bg-black/50" data-toc-backdrop></div> <!-- Drawer --> <div class="absolute bottom-0 inset-x-0 max-h-[70vh] overflow-y-auto
|
|
||||||
bg-gray-50 dark:bg-neutral-950
|
|
||||||
rounded-t-2xl shadow-xl p-6"> <div class="flex items-center justify-between mb-4"> <span class="text-sm font-semibold uppercase tracking-wider
|
|
||||||
text-gray-500 dark:text-neutral-500">
|
|
||||||
Jump to Section
|
|
||||||
</span> <button class="p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-neutral-800" data-toc-close aria-label="Close"> <svg width="1em" height="1em" class="w-5 h-5" data-icon="heroicons:x-mark"> <symbol id="ai:heroicons:x-mark" viewBox="0 0 24 24"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M6 18L18 6M6 6l12 12"/></symbol><use href="#ai:heroicons:x-mark"></use> </svg> </button> </div> <nav class="space-y-1"> <a href="#terminology" class="sidebar-link block py-2 px-4 text-sm rounded-md transition-colors text-gray-500 hover:text-gray-950 hover:bg-gray-100 dark:text-neutral-500 dark:hover:text-neutral-50 dark:hover:bg-neutral-800" data-toc-link> <span>Terminology</span> </a><a href="#specification" class="sidebar-link block py-2 px-4 text-sm rounded-md transition-colors text-gray-500 hover:text-gray-950 hover:bg-gray-100 dark:text-neutral-500 dark:hover:text-neutral-50 dark:hover:bg-neutral-800" data-toc-link> <span>Specification</span> </a><a href="#spec-tldr" class="sidebar-link block py-2 px-4 text-sm rounded-md transition-colors text-gray-500 hover:text-gray-950 hover:bg-gray-100 dark:text-neutral-500 dark:hover:text-neutral-50 dark:hover:bg-neutral-800 pl-6 text-[0.8125rem] flex" data-toc-link> <span class="shrink-0 w-6 text-gray-400 dark:text-neutral-600"> 1. </span> <span>TL;DR</span> </a><a href="#spec-the-master-branch" class="sidebar-link block py-2 px-4 text-sm rounded-md transition-colors text-gray-500 hover:text-gray-950 hover:bg-gray-100 dark:text-neutral-500 dark:hover:text-neutral-50 dark:hover:bg-neutral-800 pl-6 text-[0.8125rem] flex" data-toc-link> <span class="shrink-0 w-6 text-gray-400 dark:text-neutral-600"> 2. </span> <span>The Master Branch</span> </a><a href="#spec-change-branches" class="sidebar-link block py-2 px-4 text-sm rounded-md transition-colors text-gray-500 hover:text-gray-950 hover:bg-gray-100 dark:text-neutral-500 dark:hover:text-neutral-50 dark:hover:bg-neutral-800 pl-6 text-[0.8125rem] flex" data-toc-link> <span class="shrink-0 w-6 text-gray-400 dark:text-neutral-600"> 3. </span> <span>Change Branches</span> </a><a href="#spec-pull-requests" class="sidebar-link block py-2 px-4 text-sm rounded-md transition-colors text-gray-500 hover:text-gray-950 hover:bg-gray-100 dark:text-neutral-500 dark:hover:text-neutral-50 dark:hover:bg-neutral-800 pl-6 text-[0.8125rem] flex" data-toc-link> <span class="shrink-0 w-6 text-gray-400 dark:text-neutral-600"> 4. </span> <span>Pull Requests</span> </a><a href="#spec-versioning" class="sidebar-link block py-2 px-4 text-sm rounded-md transition-colors text-gray-500 hover:text-gray-950 hover:bg-gray-100 dark:text-neutral-500 dark:hover:text-neutral-50 dark:hover:bg-neutral-800 pl-6 text-[0.8125rem] flex" data-toc-link> <span class="shrink-0 w-6 text-gray-400 dark:text-neutral-600"> 5. </span> <span>Versioning</span> </a><a href="#spec-releases" class="sidebar-link block py-2 px-4 text-sm rounded-md transition-colors text-gray-500 hover:text-gray-950 hover:bg-gray-100 dark:text-neutral-500 dark:hover:text-neutral-50 dark:hover:bg-neutral-800 pl-6 text-[0.8125rem] flex" data-toc-link> <span class="shrink-0 w-6 text-gray-400 dark:text-neutral-600"> 6. </span> <span>Releases</span> </a><a href="#spec-release-branches" class="sidebar-link block py-2 px-4 text-sm rounded-md transition-colors text-gray-500 hover:text-gray-950 hover:bg-gray-100 dark:text-neutral-500 dark:hover:text-neutral-50 dark:hover:bg-neutral-800 pl-6 text-[0.8125rem] flex" data-toc-link> <span class="shrink-0 w-6 text-gray-400 dark:text-neutral-600"> 7. </span> <span>Release Branches</span> </a><a href="#spec-bug-fixes-rollback" class="sidebar-link block py-2 px-4 text-sm rounded-md transition-colors text-gray-500 hover:text-gray-950 hover:bg-gray-100 dark:text-neutral-500 dark:hover:text-neutral-50 dark:hover:bg-neutral-800 pl-6 text-[0.8125rem] flex" data-toc-link> <span class="shrink-0 w-6 text-gray-400 dark:text-neutral-600"> 8. </span> <span>Bug Fixes & Rollback</span> </a><a href="#spec-git-best-practices" class="sidebar-link block py-2 px-4 text-sm rounded-md transition-colors text-gray-500 hover:text-gray-950 hover:bg-gray-100 dark:text-neutral-500 dark:hover:text-neutral-50 dark:hover:bg-neutral-800 pl-6 text-[0.8125rem] flex" data-toc-link> <span class="shrink-0 w-6 text-gray-400 dark:text-neutral-600"> 9. </span> <span>Git Best Practices</span> </a> </nav> </div> </div> <script type="module" src="/_astro/SpecSidebar.astro_astro_type_script_index_0_lang.BQBj5HuJ.js"></script> </div> <!-- Main content --> <div class="flex-1 min-w-0"> <article class="prose-spec"> <!-- Terminology --> <section id="terminology"> <h2>Terminology</h2> <ul>
|
|
||||||
<li><strong>Master Branch</strong> - Must be named "master", must always have passing tests,
|
|
||||||
and is not guaranteed to always work in production environments.</li>
|
|
||||||
<li><strong>Change Branches</strong> - Any branch that introduces changes like a new feature, a
|
|
||||||
bug fix, etc.</li>
|
|
||||||
<li><strong>Source Branch</strong> - The branch that a change branch was created from. New
|
|
||||||
changes in the source branch should be incorporated into the change branch via
|
|
||||||
rebasing.</li>
|
|
||||||
<li><strong>Merge Target</strong> - A branch that is the intended merge target for a change
|
|
||||||
branch. Typically the merge target branch will be the same as the source
|
|
||||||
branch.</li>
|
|
||||||
<li><strong>Pull Request</strong> - A means of requesting that a change branch is merged in to
|
|
||||||
its merge target, allowing others to review, discuss and approve the changes.</li>
|
|
||||||
<li><strong>Release</strong> - May be considered safe to use in production
|
|
||||||
environments. Consists of a version bump commit, and a git tag named according
|
|
||||||
to the new version string placed on said commit.</li>
|
|
||||||
<li><strong>Release Branches</strong> - Used both for short-term preparations of a release, and
|
|
||||||
also for long-term maintenance of older version.</li>
|
|
||||||
</ul> </section> <!-- Main specification --> <section id="specification"> <h2>Specification</h2> <p>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD",
|
|
||||||
"SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be
|
|
||||||
interpreted as described in <a href="https://tools.ietf.org/html/rfc2119">RFC 2119</a>.</p>
|
|
||||||
<ol>
|
|
||||||
<li id="spec-tldr">TL;DR
|
|
||||||
<ol>
|
|
||||||
<li>Don't break the master branch.</li>
|
|
||||||
<li>A release is a git tag.</li>
|
|
||||||
</ol>
|
|
||||||
</li>
|
|
||||||
<li id="spec-the-master-branch">The Master Branch
|
|
||||||
<ol>
|
|
||||||
<li>A branch named "master" MUST exist and it MUST be referred to as the
|
|
||||||
"master branch".</li>
|
|
||||||
<li>The master branch MUST always be in a non-broken state with its test
|
|
||||||
suite passing.</li>
|
|
||||||
<li>The master branch IS NOT guaranteed to always work in production
|
|
||||||
environments. Despite test suites passing it may at times contain
|
|
||||||
unfinished work. Only releases may be considered safe for production use.</li>
|
|
||||||
<li>The master branch SHOULD always be in a "as near as possibly ready for
|
|
||||||
release/production" state to reduce any friction with creating a new
|
|
||||||
release.</li>
|
|
||||||
</ol>
|
|
||||||
</li>
|
|
||||||
<li id="spec-change-branches">Change Branches
|
|
||||||
<ol>
|
|
||||||
<li>Each change (feature, bugfix, etc.) MUST be performed on separate
|
|
||||||
branches that SHOULD be referred to as "change branches". All change
|
|
||||||
branches MUST have descriptive names. It is RECOMMENDED that you commit
|
|
||||||
often locally, and you SHOULD regularly push your work to the same named
|
|
||||||
branch on the remote server.</li>
|
|
||||||
<li>You MUST create separate change branches for each distinctly different
|
|
||||||
change. You MUST NOT include multiple unrelated changes into a single
|
|
||||||
change branch.</li>
|
|
||||||
<li>When a change branch is created, the branch that it is created from
|
|
||||||
SHOULD be referred to as the "source branch". Each change branch also
|
|
||||||
needs a designated "merge target" branch, typically this will be the same
|
|
||||||
as the source branch.</li>
|
|
||||||
<li>Change branches MUST be regularly updated with any changes from their
|
|
||||||
source branch. This MUST be done by rebasing the change branch on top of
|
|
||||||
the source branch.</li>
|
|
||||||
<li>After rebasing a change branch on top of its source branch you MUST push
|
|
||||||
the change branch to the remote server. This will require you to do a
|
|
||||||
force push, and you SHOULD use the "--force-with-lease" git push option.</li>
|
|
||||||
</ol>
|
|
||||||
</li>
|
|
||||||
<li id="spec-pull-requests">Pull Requests
|
|
||||||
<ol>
|
|
||||||
<li>To merge a change branch into its merge target, you MUST open a "pull
|
|
||||||
request" (or equivalent) so others can review and approve your changes.</li>
|
|
||||||
<li>A pull request MUST only be merged when the change branch is up-to-date
|
|
||||||
with its source branch, the test suite is passing, and you and others are
|
|
||||||
happy with the change. This is especially important if the merge target
|
|
||||||
is the master branch.</li>
|
|
||||||
<li>To get feedback, help, or generally just discuss a change branch with
|
|
||||||
others, the RECOMMENDED way to do so is by creating a pull request and
|
|
||||||
discuss the changes with others there.</li>
|
|
||||||
</ol>
|
|
||||||
</li>
|
|
||||||
<li id="spec-versioning">Versioning
|
|
||||||
<ol>
|
|
||||||
<li>The project MUST have its version hard-coded somewhere in the
|
|
||||||
code-base. It is RECOMMENDED that this is done in a file called "VERSION"
|
|
||||||
located in the root of the project.</li>
|
|
||||||
<li>If you are using a "VERSION" file in the root of the project, this MUST
|
|
||||||
only contain the exact version string.</li>
|
|
||||||
<li>The version string SHOULD follow the Semantic Versioning
|
|
||||||
(<a href="http://semver.org/">http://semver.org/</a>) format. Use of Semantic Versioning is OPTIONAL,
|
|
||||||
but the version string MUST NOT have a "v" prefix. For example "v2.11.4"
|
|
||||||
is bad, and "2.11.4" is good.</li>
|
|
||||||
</ol>
|
|
||||||
</li>
|
|
||||||
<li id="spec-releases">Releases
|
|
||||||
<ol>
|
|
||||||
<li>To create a new release, you MUST create a "version bump" commit which
|
|
||||||
changes the hard-coded version string of the project. The version bump
|
|
||||||
commit MUST have a git tag created on it and named as the exact version
|
|
||||||
string.</li>
|
|
||||||
<li>If you are not using a release branch, then the version bump commit MUST
|
|
||||||
be created directly on the master branch.</li>
|
|
||||||
<li>The version bump commit MUST have a commit message title of "Bump version
|
|
||||||
to VERSION". For example, if the new version string is "2.11.4", the
|
|
||||||
first line of the commit message MUST read: "Bump version to 2.11.4"</li>
|
|
||||||
<li>The release tag on the version bump commit MUST be named exactly the same
|
|
||||||
as the version string. The tag name can OPTIONALLY be prefixed with
|
|
||||||
"v". For example the tag name can be either "2.11.4" or "v2.11.4". You
|
|
||||||
MUST not use a mix of "v" prefixed and non-prefixed tags. Pick one form
|
|
||||||
and stick to it.</li>
|
|
||||||
<li>It is RECOMMENDED that release tags are lightweight tags, but you can
|
|
||||||
OPTIONALLY use annotated tags if you want to include changelog
|
|
||||||
information in the release tag itself.</li>
|
|
||||||
<li>If you use annotated release tags, the first line of the annotation MUST
|
|
||||||
read "Release VERSION". For example for version "2.11.4" the first line
|
|
||||||
of the tag annotation would read "Release 2.11.4". The second line must
|
|
||||||
be blank, and the changelog MUST start on the third line.</li>
|
|
||||||
</ol>
|
|
||||||
</li>
|
|
||||||
<li id="spec-release-branches">Release Branches
|
|
||||||
<ol>
|
|
||||||
<li>Any branch that has a name starting with "release-" SHOULD be referred to
|
|
||||||
as a "release branch".</li>
|
|
||||||
<li>Use of release branches is OPTIONAL.</li>
|
|
||||||
<li>Changes in a release branch SHOULD typically come from work being
|
|
||||||
done against the master branch. Meaning changes SHOULD only trickle
|
|
||||||
downwards from the master branch. If a change needs to trickle back up
|
|
||||||
into the master branch, that work should have happened against the master
|
|
||||||
branch in the first place. One exception to this is version bump commits.</li>
|
|
||||||
<li>There are two types of release branches; short-term, and long-term.</li>
|
|
||||||
<li>Short-Term Release Branches
|
|
||||||
<ol>
|
|
||||||
<li>Used for creating a specific versioned release.</li>
|
|
||||||
<li>A short-term release branch is RECOMMENDED if there is a lengthy
|
|
||||||
pre-release verification process to avoid a code freeze on the master
|
|
||||||
branch.</li>
|
|
||||||
<li>MUST have a name of "release-VERSION". For example for version
|
|
||||||
"2.11.4" the release branch name MUST be "release-2.11.4".</li>
|
|
||||||
<li>When using a short-term release branch, the version bump commit and
|
|
||||||
release tag MUST be made directly on the release branch itself.</li>
|
|
||||||
<li>Only very minor changes should be performed on a short-term release
|
|
||||||
branch directly. Any larger changes SHOULD be done in the master
|
|
||||||
branch, and SHOULD be pulled into the release branch by rebasing it
|
|
||||||
on top of the master branch the same way a change branch pulls in
|
|
||||||
updates from its source branch.</li>
|
|
||||||
<li>After the version bump commit and release tag have been created, the
|
|
||||||
release branch MUST be merged back into its source branch and then
|
|
||||||
deleted. Typically the source branch will be the master branch.</li>
|
|
||||||
</ol>
|
|
||||||
</li>
|
|
||||||
<li>Long-Term Release Branches
|
|
||||||
<ol>
|
|
||||||
<li>Used for work on versions which are not currently part of the master
|
|
||||||
branch. Typically this is useful when you need to create a new
|
|
||||||
maintenance release for a older version.</li>
|
|
||||||
<li>The branch name MUST have a non-specific version number. For example
|
|
||||||
a long-term release branch for creating new 2.9.x releases would be
|
|
||||||
named "release-2.9".</li>
|
|
||||||
<li>To create a new release from a long-term release branch, you MUST
|
|
||||||
create a version bump commit and release tag directly on the release
|
|
||||||
branch.</li>
|
|
||||||
<li>A long-term release branch MUST be created from the relevant release
|
|
||||||
tag. For example if the master branch is on version 2.11.4 and there
|
|
||||||
is a security fix for all 2.9.x releases, the latest of which is
|
|
||||||
"2.9.7". Create a new branch called "release-2.9" off of the "2.9.7"
|
|
||||||
release tag. The security fix release will then end up being version
|
|
||||||
"2.9.8".</li>
|
|
||||||
</ol>
|
|
||||||
</li>
|
|
||||||
</ol>
|
|
||||||
</li>
|
|
||||||
<li id="spec-bug-fixes-rollback">Bug Fixes & Rollback
|
|
||||||
<ol>
|
|
||||||
<li>You MUST NOT under any circumstances force push to the master branch.</li>
|
|
||||||
<li>If a change branch which has been merged into the master branch is found
|
|
||||||
to have a bug in it, the bug fix work MUST be done as a new separate
|
|
||||||
change branch and MUST follow the same workflow as any other change
|
|
||||||
branch.</li>
|
|
||||||
<li>If a change branch is wrongfully merged into master, or for any other
|
|
||||||
reason the merge must be undone, you MUST undo the merge by reverting the
|
|
||||||
merge commit itself. Effectively creating a new commit that reverses all
|
|
||||||
the relevant changes.</li>
|
|
||||||
</ol>
|
|
||||||
</li>
|
|
||||||
<li id="spec-git-best-practices">Git Best Practices
|
|
||||||
<ol>
|
|
||||||
<li>All commit messages SHOULD follow the Commit Guidelines and format from
|
|
||||||
the official git
|
|
||||||
documentation:
|
|
||||||
<a href="https://git-scm.com/book/en/v2/Distributed-Git-Contributing-to-a-Project#_commit_guidelines">https://git-scm.com/book/en/v2/Distributed-Git-Contributing-to-a-Project#_commit_guidelines</a></li>
|
|
||||||
<li>You SHOULD never blindly commit all changes with "git commit -a". It is
|
|
||||||
RECOMMENDED you use "git add -i" to add individual changes to the staging
|
|
||||||
area so you are fully aware of what you are committing.</li>
|
|
||||||
<li>You SHOULD always use "--force-with-lease" when doing a force push. The
|
|
||||||
regular "--force" option is dangerous and destructive. More
|
|
||||||
information:
|
|
||||||
<a href="https://developer.atlassian.com/blog/2015/04/force-with-lease/">https://developer.atlassian.com/blog/2015/04/force-with-lease/</a></li>
|
|
||||||
<li>You SHOULD understand and be comfortable with
|
|
||||||
rebasing: <a href="https://git-scm.com/book/en/v2/Git-Branching-Rebasing">https://git-scm.com/book/en/v2/Git-Branching-Rebasing</a></li>
|
|
||||||
<li>It is RECOMMENDED that you always do "git pull --rebase" instead of "git
|
|
||||||
pull" to avoid unnecessary merge commits. You can make this the default
|
|
||||||
behavior of "git pull" with "git config --global pull.rebase true".</li>
|
|
||||||
<li>It is RECOMMENDED that all branches be merged using "git merge --no-ff".
|
|
||||||
This makes sure the reference to the original branch is kept in the
|
|
||||||
commits, allows one to revert a merge by reverting a single merge commit,
|
|
||||||
and creates a merge commit to mark the integration of the branch with
|
|
||||||
master.</li>
|
|
||||||
</ol>
|
|
||||||
</li>
|
|
||||||
</ol> </section> </article> </div> </div> </div> </section> <section id="faq" class="py-20 sm:py-28"> <div class="section-container"> <div class="max-w-3xl mx-auto"> <div class="mb-12 text-center"> <h2 class="text-3xl sm:text-4xl mb-4">FAQ</h2> <p class="text-lg text-gray-600 dark:text-neutral-400"> Common questions about Git Common-Flow </p> </div> <!-- FAQ Items --> <div class="space-y-0"> </div> </div> </div> </section> <script type="module">function n(){document.querySelectorAll("[data-faq-item]").forEach(r=>{const t=r.querySelector("[data-faq-trigger]"),a=r.querySelector("[data-faq-content]"),s=r.querySelector("[data-faq-icon]");!t||!a||!s||t.addEventListener("click",()=>{const e=t.getAttribute("aria-expanded")==="true";t.setAttribute("aria-expanded",e?"false":"true"),a.classList.toggle("grid-rows-[1fr]",!e),a.classList.toggle("grid-rows-[0fr]",e),s.classList.toggle("rotate-180",!e)})})}n();document.addEventListener("astro:after-swap",n);</script> </main> <footer class="pt-12 pb-6 my-28 text-sm
|
|
||||||
text-gray-500 dark:text-neutral-500
|
|
||||||
border-t border-gray-200 dark:border-neutral-800"> <div class="section-container flex flex-col sm:flex-row
|
|
||||||
sm:justify-between sm:items-center gap-2"> <p>
|
|
||||||
License:
|
|
||||||
<a href="https://creativecommons.org/licenses/by/4.0/" class="hover:text-sky-600" target="_blank" rel="noopener noreferrer"> CC BY 4.0 </a> </p> <p> Git Common-Flow by
|
|
||||||
<a href="https://jimeh.me/" class="hover:text-sky-600" target="_blank" rel="noopener noreferrer"> Jim Myhrberg </a> </p> </div> </footer> <!-- Re-init theme on Astro page transitions --> <script type="module">document.addEventListener("astro:after-swap",()=>{const e=localStorage.getItem("theme"),t=window.matchMedia("(prefers-color-scheme: dark)").matches;e==="dark"||e!=="light"&&t?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")});</script> </body> </html>
|
|
||||||
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 18 KiB |
10102
package-lock.json
generated
Normal file
29
package.json
@@ -10,34 +10,37 @@
|
|||||||
"lint": "eslint .",
|
"lint": "eslint .",
|
||||||
"format": "prettier --write .",
|
"format": "prettier --write .",
|
||||||
"format:check": "prettier --check .",
|
"format:check": "prettier --check .",
|
||||||
"update": "bun scripts/update-specs.ts",
|
"update-specs": "tsx scripts/update-specs.ts",
|
||||||
"astro": "astro"
|
"astro": "astro"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@astrojs/sitemap": "^3.6.1",
|
"@astrojs/sitemap": "^3.7.0",
|
||||||
"@fontsource-variable/bricolage-grotesque": "^5.2.10",
|
|
||||||
"@fontsource-variable/dm-sans": "^5.2.8",
|
|
||||||
"@fontsource-variable/jetbrains-mono": "^5.2.8",
|
|
||||||
"@iconify-json/heroicons": "^1.2.3",
|
"@iconify-json/heroicons": "^1.2.3",
|
||||||
"@iconify-json/simple-icons": "^1.2.65",
|
"@iconify-json/simple-icons": "^1.2.69",
|
||||||
"astro": "^5.16.8",
|
"astro": "^5.17.1",
|
||||||
"astro-icon": "^1.1.5",
|
"astro-icon": "^1.1.5",
|
||||||
|
"rehype-autolink-headings": "^7.1.0",
|
||||||
|
"rehype-slug": "^6.0.0",
|
||||||
"rehype-stringify": "^10.0.1",
|
"rehype-stringify": "^10.0.1",
|
||||||
"remark-parse": "^11.0.0",
|
"remark-parse": "^11.0.0",
|
||||||
"remark-rehype": "^11.1.2",
|
"remark-rehype": "^11.1.2",
|
||||||
|
"semver": "^7.7.3",
|
||||||
"unified": "^11.0.5"
|
"unified": "^11.0.5"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@astrojs/check": "^0.9.6",
|
"@astrojs/check": "^0.9.6",
|
||||||
"@eslint/js": "^9.39.2",
|
"@eslint/js": "^10.0.1",
|
||||||
"@tailwindcss/typography": "^0.5.19",
|
"@tailwindcss/typography": "^0.5.19",
|
||||||
"@tailwindcss/vite": "^4.1.18",
|
"@tailwindcss/vite": "^4.2.0",
|
||||||
"eslint": "^9.39.2",
|
"@types/semver": "^7.7.1",
|
||||||
"eslint-plugin-astro": "^1.5.0",
|
"eslint": "^10.0.0",
|
||||||
"prettier": "^3.7.4",
|
"eslint-plugin-astro": "^1.6.0",
|
||||||
|
"prettier": "^3.8.1",
|
||||||
"prettier-plugin-astro": "^0.14.1",
|
"prettier-plugin-astro": "^0.14.1",
|
||||||
|
"svgo": "^4.0.0",
|
||||||
"tailwindcss": "^4.1.18",
|
"tailwindcss": "^4.1.18",
|
||||||
|
"tsx": "^4.21.0",
|
||||||
"typescript": "^5.9.3",
|
"typescript": "^5.9.3",
|
||||||
"typescript-eslint": "^8.52.0"
|
"typescript-eslint": "^8.56.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 18 KiB |
@@ -1,39 +1,93 @@
|
|||||||
/**
|
/**
|
||||||
* Fetches spec documents and diagrams from the common-flow GitHub repo
|
* Fetches spec documents and diagrams from the common-flow GitHub repo
|
||||||
* and writes them to the appropriate locations for Astro to consume.
|
* and writes them to the appropriate locations for Astro to consume.
|
||||||
|
*
|
||||||
|
* Versions are discovered from git tags and filtered based on config.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import { execSync } from "node:child_process";
|
||||||
import * as fs from "node:fs";
|
import * as fs from "node:fs";
|
||||||
import * as path from "node:path";
|
import * as path from "node:path";
|
||||||
|
import * as semver from "semver";
|
||||||
|
import { optimize as optimizeSvg, type Config as SvgoConfig } from "svgo";
|
||||||
|
import { config } from "../src/config";
|
||||||
|
|
||||||
const config = {
|
const updateConfig = {
|
||||||
currentVersion: "1.0.0-rc.5",
|
bodyTemplate: `---
|
||||||
versions: [
|
|
||||||
"1.0.0-rc.5",
|
|
||||||
"1.0.0-rc.4",
|
|
||||||
"1.0.0-rc.3",
|
|
||||||
"1.0.0-rc.2",
|
|
||||||
"1.0.0-rc.1",
|
|
||||||
],
|
|
||||||
update: {
|
|
||||||
urlTemplate:
|
|
||||||
"https://github.com/jimeh/common-flow/raw/{{version}}/{{file}}",
|
|
||||||
bodyTemplate: `---
|
|
||||||
title: {{title}}
|
title: {{title}}
|
||||||
version: {{version}}
|
version: {{version}}
|
||||||
---
|
---
|
||||||
{{content}}`,
|
{{content}}`,
|
||||||
imgTemplate:
|
outputDir: "src/content/spec",
|
||||||
'<img src="/spec/{{file}}" alt="{{title}} diagram" width="100%" />',
|
|
||||||
outputDir: "src/content/spec",
|
|
||||||
publicDir: "public/spec",
|
|
||||||
files: {
|
|
||||||
document: "common-flow.md",
|
|
||||||
diagram: "common-flow.svg",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// SVGO config: use removeDimensions to convert width/height to viewBox
|
||||||
|
// for responsive scaling while preserving aspect ratio
|
||||||
|
const svgoConfig: SvgoConfig = {
|
||||||
|
plugins: ["preset-default", "removeDimensions"],
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fetch all tags from the GitHub repository.
|
||||||
|
*/
|
||||||
|
function fetchTags(repository: string): string[] {
|
||||||
|
const repoUrl = `https://github.com/${repository}.git`;
|
||||||
|
console.log(`Fetching tags from ${repoUrl}...`);
|
||||||
|
|
||||||
|
try {
|
||||||
|
const result = execSync(`git ls-remote --tags ${repoUrl}`, {
|
||||||
|
encoding: "utf-8",
|
||||||
|
});
|
||||||
|
|
||||||
|
return result
|
||||||
|
.split("\n")
|
||||||
|
.filter(Boolean)
|
||||||
|
.map((line: string) => line.match(/refs\/tags\/(.+)$/)?.[1])
|
||||||
|
.filter(
|
||||||
|
(tag: string | undefined): tag is string =>
|
||||||
|
tag !== undefined && !tag.endsWith("^{}"),
|
||||||
|
);
|
||||||
|
} catch (error) {
|
||||||
|
throw new Error(
|
||||||
|
`Failed to fetch tags: ${error instanceof Error ? error.message : String(error)}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the prerelease type of a version (e.g., "rc", "draft", or null for
|
||||||
|
* stable).
|
||||||
|
*/
|
||||||
|
function getPrereleaseType(version: string): string | null {
|
||||||
|
const prerelease = semver.prerelease(version);
|
||||||
|
if (!prerelease) return null;
|
||||||
|
return String(prerelease[0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Filter tags based on discovery configuration.
|
||||||
|
* Stable versions are always included; prereleases only if their type is in
|
||||||
|
* the includePrereleaseTypes list.
|
||||||
|
*/
|
||||||
|
function filterVersions(tags: string[]): string[] {
|
||||||
|
const { includePrereleaseTypes, excludeVersions } = config.update.discovery;
|
||||||
|
|
||||||
|
return tags.filter((tag) => {
|
||||||
|
// Must be valid semver
|
||||||
|
if (!semver.valid(tag)) return false;
|
||||||
|
|
||||||
|
// Check explicit exclusions
|
||||||
|
if (excludeVersions.includes(tag)) return false;
|
||||||
|
|
||||||
|
// Stable versions are always included
|
||||||
|
const prereleaseType = getPrereleaseType(tag);
|
||||||
|
if (prereleaseType === null) return true;
|
||||||
|
|
||||||
|
// Prereleases only if their type is in the list
|
||||||
|
return includePrereleaseTypes.includes(prereleaseType);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function buildFileUrl(
|
function buildFileUrl(
|
||||||
fileType: "document" | "diagram",
|
fileType: "document" | "diagram",
|
||||||
version: string,
|
version: string,
|
||||||
@@ -65,19 +119,34 @@ function writeFile(filePath: string, content: string, comment = ""): void {
|
|||||||
console.log(` - ${filePath}${comment}`);
|
console.log(` - ${filePath}${comment}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
function removeAllSpecs(): void {
|
/**
|
||||||
console.log("\nRemoving existing spec files:");
|
* Remove spec files for versions not in the provided list.
|
||||||
|
* Files for versions in the list are left alone (they'll be overwritten).
|
||||||
|
*/
|
||||||
|
function removeStaleSpecs(versionsToKeep: string[]): void {
|
||||||
|
const keepSet = new Set(versionsToKeep);
|
||||||
|
let removedAny = false;
|
||||||
|
|
||||||
for (const dir of [config.update.outputDir, config.update.publicDir]) {
|
if (!fs.existsSync(updateConfig.outputDir)) return;
|
||||||
if (fs.existsSync(dir)) {
|
|
||||||
const files = fs.readdirSync(dir);
|
const files = fs.readdirSync(updateConfig.outputDir);
|
||||||
for (const file of files) {
|
for (const file of files) {
|
||||||
const filePath = path.join(dir, file);
|
// Extract version from filename (e.g., "1.0.0-rc.1.md" -> "1.0.0-rc.1")
|
||||||
fs.unlinkSync(filePath);
|
const version = path.basename(file, path.extname(file));
|
||||||
console.log(` ${filePath}`);
|
if (!keepSet.has(version)) {
|
||||||
|
if (!removedAny) {
|
||||||
|
console.log("\nRemoving stale spec files:");
|
||||||
|
removedAny = true;
|
||||||
}
|
}
|
||||||
|
const filePath = path.join(updateConfig.outputDir, file);
|
||||||
|
fs.unlinkSync(filePath);
|
||||||
|
console.log(` ${filePath}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!removedAny) {
|
||||||
|
console.log("\nNo stale spec files to remove.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
interface Spec {
|
interface Spec {
|
||||||
@@ -98,22 +167,23 @@ async function fetchSpec(version: string): Promise<Spec> {
|
|||||||
throw new Error(`Failed to fetch document for version ${version}`);
|
throw new Error(`Failed to fetch document for version ${version}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Replace {{version}} placeholder throughout the document
|
// Replace {{version}} placeholder with v-prefixed version
|
||||||
document = document.replaceAll("{{version}}", version);
|
document = document.replaceAll("{{version}}", `v${version}`);
|
||||||
|
|
||||||
// Extract title from first line (after version replacement)
|
// Handle setext-style H1 heading (title with === underline)
|
||||||
const title = document.split("\n", 1)[0];
|
const lines = document.split("\n");
|
||||||
|
if (lines.length >= 2 && /^=+$/.test(lines[1])) {
|
||||||
// If diagram exists, inject image tag after the title
|
// Adjust the underline length to match the title
|
||||||
if (diagram) {
|
lines[1] = "=".repeat(lines[0].length);
|
||||||
const imgTag = config.update.imgTemplate
|
document = lines.join("\n");
|
||||||
.replace("{{file}}", `${version}.svg`)
|
|
||||||
.replace("{{title}}", title);
|
|
||||||
document = document.replace(/^(.*\n=+\n)/, `$1\n${imgTag}\n`);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Extract title from first line (after version replacement)
|
||||||
|
// Handle both ATX-style (# Title) and setext-style (Title\n===) headings
|
||||||
|
const title = lines[0].replace(/^#\s+/, "");
|
||||||
|
|
||||||
// Build body with frontmatter
|
// Build body with frontmatter
|
||||||
const body = config.update.bodyTemplate
|
const body = updateConfig.bodyTemplate
|
||||||
.replace("{{content}}", document)
|
.replace("{{content}}", document)
|
||||||
.replace("{{title}}", title)
|
.replace("{{title}}", title)
|
||||||
.replace("{{version}}", version);
|
.replace("{{version}}", version);
|
||||||
@@ -127,29 +197,47 @@ async function fetchSpec(version: string): Promise<Spec> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function main(): Promise<void> {
|
async function main(): Promise<void> {
|
||||||
removeAllSpecs();
|
// 1. Discover and filter versions
|
||||||
|
const tags = fetchTags(config.update.repository);
|
||||||
|
console.log(`Found ${tags.length} tags`);
|
||||||
|
|
||||||
console.log("\nFetching configured spec versions:");
|
const filtered = filterVersions(tags);
|
||||||
|
const sorted = semver.rsort([...filtered]);
|
||||||
|
|
||||||
for (const version of config.versions) {
|
console.log(`\nIncluded ${sorted.length} versions after filtering:`);
|
||||||
|
console.log(` ${sorted.join(", ")}`);
|
||||||
|
|
||||||
|
if (sorted.length === 0) {
|
||||||
|
console.error("\nNo versions to process. Exiting.");
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2. Remove spec files for versions no longer in the list
|
||||||
|
removeStaleSpecs(sorted);
|
||||||
|
|
||||||
|
// 3. Fetch specs for all versions
|
||||||
|
console.log("\nFetching spec documents:");
|
||||||
|
|
||||||
|
for (const version of sorted) {
|
||||||
try {
|
try {
|
||||||
const spec = await fetchSpec(version);
|
const spec = await fetchSpec(version);
|
||||||
|
|
||||||
// Write markdown file to content collection
|
// Write markdown file to content collection
|
||||||
const mdPath = path.join(config.update.outputDir, `${version}.md`);
|
const mdPath = path.join(updateConfig.outputDir, `${version}.md`);
|
||||||
writeFile(mdPath, spec.body);
|
writeFile(mdPath, spec.body);
|
||||||
|
|
||||||
// Write SVG diagram to public directory
|
// Write SVG diagram next to markdown (with metadata stripped)
|
||||||
if (spec.diagram) {
|
if (spec.diagram) {
|
||||||
const svgPath = path.join(config.update.publicDir, `${version}.svg`);
|
const svgPath = path.join(updateConfig.outputDir, `${version}.svg`);
|
||||||
writeFile(svgPath, spec.diagram);
|
const optimizedSvg = optimizeSvg(spec.diagram, svgoConfig).data;
|
||||||
|
writeFile(svgPath, optimizedSvg);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(`Error processing version ${version}:`, error);
|
console.error(`Error processing version ${version}:`, error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log("\nDone! Run `bun run build` to rebuild the site.");
|
console.log("\nDone! Run `npm run build` to rebuild the site.");
|
||||||
}
|
}
|
||||||
|
|
||||||
main();
|
main();
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ import { config } from "../config";
|
|||||||
border-t border-gray-200 dark:border-neutral-800"
|
border-t border-gray-200 dark:border-neutral-800"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="section-container flex flex-col sm:flex-row
|
class="section-container flex flex-col items-center text-center
|
||||||
sm:justify-between sm:items-center gap-2"
|
sm:flex-row sm:justify-between sm:items-center sm:text-left gap-2"
|
||||||
>
|
>
|
||||||
<p>
|
<p>
|
||||||
License:
|
License:
|
||||||
|
|||||||
@@ -6,9 +6,10 @@ import { config } from "../config";
|
|||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
version: string;
|
version: string;
|
||||||
|
versions: string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
const { version } = Astro.props;
|
const { version, versions } = Astro.props;
|
||||||
|
|
||||||
const navItems = [
|
const navItems = [
|
||||||
{ id: "about", label: "About", icon: "heroicons:information-circle" },
|
{ id: "about", label: "About", icon: "heroicons:information-circle" },
|
||||||
@@ -29,7 +30,7 @@ const navItems = [
|
|||||||
<!-- Logo / Title + Version -->
|
<!-- Logo / Title + Version -->
|
||||||
<div class="flex items-center gap-3">
|
<div class="flex items-center gap-3">
|
||||||
<a
|
<a
|
||||||
href="#hero"
|
href="#top"
|
||||||
class="flex items-center gap-3 no-underline
|
class="flex items-center gap-3 no-underline
|
||||||
text-gray-950 dark:text-neutral-50
|
text-gray-950 dark:text-neutral-50
|
||||||
hover:text-sky-600 transition-colors"
|
hover:text-sky-600 transition-colors"
|
||||||
@@ -39,10 +40,7 @@ const navItems = [
|
|||||||
</span>
|
</span>
|
||||||
</a>
|
</a>
|
||||||
<div class="hidden md:block">
|
<div class="hidden md:block">
|
||||||
<VersionSelector
|
<VersionSelector currentVersion={version} versions={versions} />
|
||||||
currentVersion={version}
|
|
||||||
versions={Array.from(config.versions)}
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -104,10 +102,7 @@ const navItems = [
|
|||||||
>
|
>
|
||||||
<div class="px-4 py-3 space-y-1 text-center">
|
<div class="px-4 py-3 space-y-1 text-center">
|
||||||
<div class="py-2 flex justify-center">
|
<div class="py-2 flex justify-center">
|
||||||
<VersionSelector
|
<VersionSelector currentVersion={version} versions={versions} />
|
||||||
currentVersion={version}
|
|
||||||
versions={Array.from(config.versions)}
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
{
|
{
|
||||||
navItems.map((item) => (
|
navItems.map((item) => (
|
||||||
@@ -132,7 +127,7 @@ const navItems = [
|
|||||||
|
|
||||||
function initHeader() {
|
function initHeader() {
|
||||||
const header = document.getElementById("site-header");
|
const header = document.getElementById("site-header");
|
||||||
const hero = document.getElementById("hero");
|
const hero = document.getElementById("top");
|
||||||
const mobileMenuBtn = document.getElementById("mobile-menu-btn");
|
const mobileMenuBtn = document.getElementById("mobile-menu-btn");
|
||||||
const mobileNav = document.getElementById("mobile-nav");
|
const mobileNav = document.getElementById("mobile-nav");
|
||||||
|
|
||||||
|
|||||||
@@ -6,14 +6,34 @@ import { config } from "../config";
|
|||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
version: string;
|
version: string;
|
||||||
svgPath: string;
|
versions: string[];
|
||||||
|
svgContent?: string | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const { version, svgPath } = Astro.props;
|
const { version, versions, svgContent } = Astro.props;
|
||||||
|
|
||||||
|
const navItems = [
|
||||||
|
{ id: "about", label: "About", align: "end" },
|
||||||
|
{ id: "spec", label: "Read the Spec", primary: true },
|
||||||
|
{ id: "faq", label: "FAQ", align: "start" },
|
||||||
|
];
|
||||||
|
|
||||||
|
const baseClasses = `inline-flex items-center justify-center gap-2
|
||||||
|
px-4 py-2.5 sm:px-6 sm:py-3
|
||||||
|
text-sm sm:text-base font-medium rounded-lg
|
||||||
|
transition-all cursor-pointer`;
|
||||||
|
|
||||||
|
const primaryClasses = `bg-sky-600 text-white
|
||||||
|
hover:bg-sky-500 hover:-translate-y-0.5 hover:shadow-md`;
|
||||||
|
|
||||||
|
const secondaryClasses = `text-gray-600 dark:text-neutral-400
|
||||||
|
hover:bg-gray-100 hover:text-gray-950
|
||||||
|
dark:hover:bg-neutral-800 dark:hover:text-neutral-50`;
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
<section
|
<section
|
||||||
id="hero"
|
id="top"
|
||||||
class="relative min-h-[75vh] flex flex-col items-center justify-center
|
class="relative min-h-[75vh] flex flex-col items-center justify-center
|
||||||
px-6 pt-16 pb-24 overflow-hidden"
|
px-6 pt-16 pb-24 overflow-hidden"
|
||||||
>
|
>
|
||||||
@@ -42,10 +62,7 @@ const { version, svgPath } = Astro.props;
|
|||||||
px-6 py-4 animate-fade-in-down"
|
px-6 py-4 animate-fade-in-down"
|
||||||
>
|
>
|
||||||
<div class="flex items-center gap-3">
|
<div class="flex items-center gap-3">
|
||||||
<VersionSelector
|
<VersionSelector currentVersion={version} versions={versions} />
|
||||||
currentVersion={version}
|
|
||||||
versions={Array.from(config.versions)}
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="flex items-center gap-2">
|
<div class="flex items-center gap-2">
|
||||||
<ThemeToggle />
|
<ThemeToggle />
|
||||||
@@ -96,55 +113,44 @@ const { version, svgPath } = Astro.props;
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- SVG Diagram -->
|
<!-- SVG Diagram -->
|
||||||
<div
|
{
|
||||||
class="animate-fade-in-up delay-300
|
svgContent && (
|
||||||
relative mx-auto mb-12 p-4 sm:p-8
|
<div
|
||||||
bg-white dark:bg-neutral-900
|
class="animate-fade-in-up delay-300
|
||||||
rounded-2xl shadow-lg dark:shadow-none
|
relative mx-auto mb-12 py-8 px-6 sm:py-16 sm:px-14
|
||||||
border border-gray-200 dark:border-neutral-800"
|
bg-white dark:bg-neutral-900
|
||||||
>
|
rounded-2xl shadow-lg dark:shadow-none
|
||||||
<img
|
border border-gray-200 dark:border-neutral-800"
|
||||||
src={svgPath}
|
>
|
||||||
alt="Git Common-Flow diagram"
|
<div
|
||||||
class="w-full h-auto max-w-3xl mx-auto
|
class="w-full max-w-3xl mx-auto [&>svg]:w-full [&>svg]:h-auto
|
||||||
dark:invert dark:hue-rotate-180 dark:contrast-90"
|
dark:invert dark:hue-rotate-180 dark:contrast-90"
|
||||||
/>
|
set:html={svgContent}
|
||||||
</div>
|
/>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
<!-- Navigation links -->
|
<!-- Navigation links -->
|
||||||
<nav
|
<nav
|
||||||
class="animate-fade-in-up delay-400
|
class="animate-fade-in-up delay-400
|
||||||
flex flex-wrap items-center justify-center gap-4"
|
grid grid-cols-[1fr_auto_1fr] items-center gap-2 sm:gap-4"
|
||||||
>
|
>
|
||||||
<a
|
{
|
||||||
href="#about"
|
navItems.map((item) => (
|
||||||
class="inline-flex items-center justify-center gap-2 px-6 py-3
|
<a
|
||||||
text-base font-medium rounded-lg transition-all cursor-pointer
|
href={`#${item.id}`}
|
||||||
text-gray-600 dark:text-neutral-400
|
class:list={[
|
||||||
hover:bg-gray-100 hover:text-gray-950
|
baseClasses,
|
||||||
dark:hover:bg-neutral-800 dark:hover:text-neutral-50"
|
item.primary ? primaryClasses : secondaryClasses,
|
||||||
>
|
item.align === "end" && "justify-self-end",
|
||||||
About
|
item.align === "start" && "justify-self-start",
|
||||||
</a>
|
]}
|
||||||
<a
|
>
|
||||||
href="#spec"
|
{item.label}
|
||||||
class="inline-flex items-center justify-center gap-2 px-6 py-3
|
</a>
|
||||||
text-base font-medium rounded-lg transition-all cursor-pointer
|
))
|
||||||
bg-sky-600 text-white
|
}
|
||||||
hover:bg-sky-500 hover:-translate-y-0.5 hover:shadow-md"
|
|
||||||
>
|
|
||||||
Read the Spec
|
|
||||||
</a>
|
|
||||||
<a
|
|
||||||
href="#faq"
|
|
||||||
class="inline-flex items-center justify-center gap-2 px-6 py-3
|
|
||||||
text-base font-medium rounded-lg transition-all cursor-pointer
|
|
||||||
text-gray-600 dark:text-neutral-400
|
|
||||||
hover:bg-gray-100 hover:text-gray-950
|
|
||||||
dark:hover:bg-neutral-800 dark:hover:text-neutral-50"
|
|
||||||
>
|
|
||||||
FAQ
|
|
||||||
</a>
|
|
||||||
</nav>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -160,3 +166,34 @@ const { version, svgPath } = Astro.props;
|
|||||||
<Icon name="heroicons:arrow-down" class="w-6 h-6 animate-bounce-subtle" />
|
<Icon name="heroicons:arrow-down" class="w-6 h-6 animate-bounce-subtle" />
|
||||||
</a>
|
</a>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// Remove animation classes after they complete to prevent re-triggering
|
||||||
|
// on theme toggle.
|
||||||
|
const animationClasses = [
|
||||||
|
"animate-fade-in",
|
||||||
|
"animate-fade-in-up",
|
||||||
|
"animate-fade-in-down",
|
||||||
|
"animate-slide-in-left",
|
||||||
|
];
|
||||||
|
|
||||||
|
function cleanupAnimations() {
|
||||||
|
const selector = animationClasses.map((c) => `.${c}`).join(", ");
|
||||||
|
const animatedElements = document.querySelectorAll(selector);
|
||||||
|
|
||||||
|
animatedElements.forEach((el) => {
|
||||||
|
el.addEventListener(
|
||||||
|
"animationend",
|
||||||
|
() => {
|
||||||
|
animationClasses.forEach((cls) => el.classList.remove(cls));
|
||||||
|
// Also remove delay classes
|
||||||
|
el.className = el.className.replace(/\bdelay-\d+\b/g, "").trim();
|
||||||
|
},
|
||||||
|
{ once: true },
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
cleanupAnimations();
|
||||||
|
document.addEventListener("astro:after-swap", cleanupAnimations);
|
||||||
|
</script>
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
---
|
---
|
||||||
|
import { Icon } from "astro-icon/components";
|
||||||
import SectionHeader from "./SectionHeader.astro";
|
import SectionHeader from "./SectionHeader.astro";
|
||||||
import SpecSidebar from "./SpecSidebar.astro";
|
import SpecSidebar from "./SpecSidebar.astro";
|
||||||
import type { TocItem } from "../utils/parseSpecContent";
|
import type { TocItem } from "../utils/parseSpecContent";
|
||||||
@@ -8,9 +9,11 @@ interface Props {
|
|||||||
terminologyTitle: string;
|
terminologyTitle: string;
|
||||||
specification: string;
|
specification: string;
|
||||||
tocItems: TocItem[];
|
tocItems: TocItem[];
|
||||||
|
version: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const { terminology, terminologyTitle, specification, tocItems } = Astro.props;
|
const { terminology, terminologyTitle, specification, tocItems, version } =
|
||||||
|
Astro.props;
|
||||||
---
|
---
|
||||||
|
|
||||||
<section id="spec" class="py-20 sm:py-28">
|
<section id="spec" class="py-20 sm:py-28">
|
||||||
@@ -21,6 +24,20 @@ const { terminology, terminologyTitle, specification, tocItems } = Astro.props;
|
|||||||
class="max-w-3xl mx-auto"
|
class="max-w-3xl mx-auto"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<div class="flex justify-center mb-8 -mt-8">
|
||||||
|
<a
|
||||||
|
href={`/spec/${version}/md`}
|
||||||
|
class="inline-flex items-center gap-1.5 px-3 py-1.5 text-sm
|
||||||
|
font-medium rounded-lg transition-colors
|
||||||
|
text-gray-500 dark:text-neutral-500
|
||||||
|
hover:bg-gray-100 hover:text-gray-700
|
||||||
|
dark:hover:bg-neutral-800 dark:hover:text-neutral-300"
|
||||||
|
>
|
||||||
|
<Icon name="heroicons:code-bracket" class="w-4 h-4" />
|
||||||
|
View Markdown Version
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- Content with sidebar -->
|
<!-- Content with sidebar -->
|
||||||
<div class="lg:flex lg:gap-8">
|
<div class="lg:flex lg:gap-8">
|
||||||
<!-- Sidebar -->
|
<!-- Sidebar -->
|
||||||
@@ -47,3 +64,8 @@ const { terminology, terminologyTitle, specification, tocItems } = Astro.props;
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { initClauseHighlight } from "../scripts/clauseHighlight";
|
||||||
|
initClauseHighlight();
|
||||||
|
</script>
|
||||||
|
|||||||
@@ -12,21 +12,9 @@ import { Icon } from "astro-icon/components";
|
|||||||
hover:bg-gray-100 dark:hover:bg-neutral-800"
|
hover:bg-gray-100 dark:hover:bg-neutral-800"
|
||||||
aria-label="Toggle theme"
|
aria-label="Toggle theme"
|
||||||
>
|
>
|
||||||
<Icon
|
<Icon name="heroicons:sun" data-theme-icon="light" class="hidden w-5 h-5" />
|
||||||
name="heroicons:sun"
|
<Icon name="heroicons:moon" data-theme-icon="dark" class="hidden w-5 h-5" />
|
||||||
data-theme-icon="light"
|
<Icon name="sun-moon" data-theme-icon="auto" class="hidden w-5 h-5" />
|
||||||
class="hidden w-5 h-5"
|
|
||||||
/>
|
|
||||||
<Icon
|
|
||||||
name="heroicons:moon"
|
|
||||||
data-theme-icon="dark"
|
|
||||||
class="hidden w-5 h-5"
|
|
||||||
/>
|
|
||||||
<Icon
|
|
||||||
name="heroicons:computer-desktop"
|
|
||||||
data-theme-icon="auto"
|
|
||||||
class="hidden w-5 h-5"
|
|
||||||
/>
|
|
||||||
</button>
|
</button>
|
||||||
<!-- Tooltip -->
|
<!-- Tooltip -->
|
||||||
<div
|
<div
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ const { currentVersion, versions } = Astro.props;
|
|||||||
data-version-dropdown
|
data-version-dropdown
|
||||||
role="listbox"
|
role="listbox"
|
||||||
aria-label="Select version"
|
aria-label="Select version"
|
||||||
class="absolute top-full left-0 mt-2 min-w-full p-1.5 z-50
|
class="absolute top-full left-0 mt-2 w-max min-w-full p-1.5 z-50
|
||||||
bg-gray-50 dark:bg-neutral-900
|
bg-gray-50 dark:bg-neutral-900
|
||||||
border border-gray-200 dark:border-neutral-700
|
border border-gray-200 dark:border-neutral-700
|
||||||
rounded-lg shadow-lg
|
rounded-lg shadow-lg
|
||||||
|
|||||||
@@ -13,23 +13,25 @@ export const config = {
|
|||||||
url: "https://creativecommons.org/licenses/by/4.0/",
|
url: "https://creativecommons.org/licenses/by/4.0/",
|
||||||
},
|
},
|
||||||
|
|
||||||
currentVersion: "1.0.0-rc.5",
|
// Optional override for current version (null = auto-detect from specs)
|
||||||
versions: [
|
currentVersionOverride: null as string | null,
|
||||||
"1.0.0-rc.5",
|
|
||||||
"1.0.0-rc.4",
|
|
||||||
"1.0.0-rc.3",
|
|
||||||
"1.0.0-rc.2",
|
|
||||||
"1.0.0-rc.1",
|
|
||||||
],
|
|
||||||
|
|
||||||
// Used by update script
|
// Used by update script
|
||||||
update: {
|
update: {
|
||||||
|
repository: "jimeh/common-flow",
|
||||||
urlTemplate:
|
urlTemplate:
|
||||||
"https://github.com/jimeh/common-flow/raw/{{version}}/{{file}}",
|
"https://github.com/jimeh/common-flow/raw/{{version}}/{{file}}",
|
||||||
files: {
|
files: {
|
||||||
document: "common-flow.md",
|
document: "common-flow.md",
|
||||||
diagram: "common-flow.svg",
|
diagram: "common-flow.svg",
|
||||||
},
|
},
|
||||||
|
// Version discovery settings
|
||||||
|
discovery: {
|
||||||
|
// Prerelease types to include (stable versions are always included)
|
||||||
|
includePrereleaseTypes: ["rc"] as string[],
|
||||||
|
// Explicit versions to exclude
|
||||||
|
excludeVersions: [] as string[],
|
||||||
|
},
|
||||||
},
|
},
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,12 @@ import { defineCollection, z } from "astro:content";
|
|||||||
import { glob } from "astro/loaders";
|
import { glob } from "astro/loaders";
|
||||||
|
|
||||||
const spec = defineCollection({
|
const spec = defineCollection({
|
||||||
loader: glob({ pattern: "**/*.md", base: "./src/content/spec" }),
|
loader: glob({
|
||||||
|
pattern: "**/*.md",
|
||||||
|
base: "./src/content/spec",
|
||||||
|
// Use filename (without extension) as ID to preserve version strings
|
||||||
|
generateId: ({ entry }) => entry.replace(/\.md$/, ""),
|
||||||
|
}),
|
||||||
schema: z.object({
|
schema: z.object({
|
||||||
title: z.string(),
|
title: z.string(),
|
||||||
version: z.string(),
|
version: z.string(),
|
||||||
|
|||||||
@@ -2,12 +2,11 @@
|
|||||||
title: Git Common-Flow 1.0.0-rc.1
|
title: Git Common-Flow 1.0.0-rc.1
|
||||||
version: 1.0.0-rc.1
|
version: 1.0.0-rc.1
|
||||||
---
|
---
|
||||||
|
Git Common-Flow 1.0.0-rc.1
|
||||||
|
==========================
|
||||||
|
|
||||||
# Git Common-Flow 1.0.0-rc.1
|
Summary
|
||||||
|
-------
|
||||||
<img src="/spec/1.0.0-rc.1.svg" alt="Git Common-Flow 1.0.0-rc.1 diagram" width="100%" />
|
|
||||||
|
|
||||||
## Summary
|
|
||||||
|
|
||||||
Common-Flow is an attempt to gather a sensible selection of the most common
|
Common-Flow is an attempt to gather a sensible selection of the most common
|
||||||
usage patterns of git into a single and concise specification. It is based on
|
usage patterns of git into a single and concise specification. It is based on
|
||||||
@@ -19,7 +18,8 @@ TL;DR: Common-Flow is basically GitHub Flow with the addition of versioned
|
|||||||
releases, maintenance releases for old versions, and without the requirement to
|
releases, maintenance releases for old versions, and without the requirement to
|
||||||
deploy to production all the time.
|
deploy to production all the time.
|
||||||
|
|
||||||
## Terminology
|
Terminology
|
||||||
|
-----------
|
||||||
|
|
||||||
- **Master Branch** - Must always have passing tests, is considered bleeding
|
- **Master Branch** - Must always have passing tests, is considered bleeding
|
||||||
edge, and must be named `master`.
|
edge, and must be named `master`.
|
||||||
@@ -43,129 +43,131 @@ deploy to production all the time.
|
|||||||
commit and release tag are on a maintenance branch instead of the master
|
commit and release tag are on a maintenance branch instead of the master
|
||||||
branch.
|
branch.
|
||||||
|
|
||||||
## Git Common-Flow Specification (Common-Flow)
|
Git Common-Flow Specification (Common-Flow)
|
||||||
|
-------------------------------------------
|
||||||
|
|
||||||
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD",
|
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD",
|
||||||
"SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be
|
"SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be
|
||||||
interpreted as described in [RFC 2119](https://tools.ietf.org/html/rfc2119).
|
interpreted as described in [RFC 2119](https://tools.ietf.org/html/rfc2119).
|
||||||
|
|
||||||
1. The Master Branch
|
1. The Master Branch
|
||||||
1. A branch named "master" MUST exist and it MUST be referred to as the
|
1. A branch named "master" MUST exist and it MUST be referred to as the
|
||||||
"master branch".
|
"master branch".
|
||||||
2. The master branch MUST be considered bleeding edge.
|
2. The master branch MUST be considered bleeding edge.
|
||||||
3. The master branch MUST always be in a non-broken state with its test
|
3. The master branch MUST always be in a non-broken state with its test
|
||||||
suite passing.
|
suite passing.
|
||||||
4. The master branch SHOULD always be in a "as near as possible ready for
|
4. The master branch SHOULD always be in a "as near as possible ready for
|
||||||
release/production" state to reduce the friction of creating a new
|
release/production" state to reduce the friction of creating a new
|
||||||
release.
|
release.
|
||||||
2. Changes
|
2. Changes
|
||||||
1. Changes MUST be performed on a separate branch that SHOULD be referred to
|
1. Changes MUST be performed on a separate branch that SHOULD be referred to
|
||||||
as a "change branch". All change branches MUST have descriptive names. It
|
as a "change branch". All change branches MUST have descriptive names. It
|
||||||
is RECOMMENDED that you commit often locally, and you SHOULD regularly
|
is RECOMMENDED that you commit often locally, and you SHOULD regularly
|
||||||
push your work to the same named branch on the remote server.
|
push your work to the same named branch on the remote server.
|
||||||
2. When a change branch is created, the branch that it is created from
|
2. When a change branch is created, the branch that it is created from
|
||||||
SHOULD be referred to as the "source branch". Each change branch also
|
SHOULD be referred to as the "source branch". Each change branch also
|
||||||
needs a designated "merge target branch", typically this will be the same
|
needs a designated "merge target branch", typically this will be the same
|
||||||
as the source branch.
|
as the source branch.
|
||||||
3. Change branches MUST be regularly updated with any changes from their
|
3. Change branches MUST be regularly updated with any changes from their
|
||||||
source branch. This MUST be done by rebasing the change branch on top of
|
source branch. This MUST be done by rebasing the change branch on top of
|
||||||
the source branch. To be clear you MUST NOT merge a source branch into a
|
the source branch. To be clear you MUST NOT merge a source branch into a
|
||||||
change branch.
|
change branch.
|
||||||
4. After rebasing a change branch on top of its source branch you MUST push
|
4. After rebasing a change branch on top of its source branch you MUST push
|
||||||
the change branch to the remote server. This will require you do a force
|
the change branch to the remote server. This will require you do a force
|
||||||
push, and you SHOULD use the "--force-with-lease" git push option.
|
push, and you SHOULD use the "--force-with-lease" git push option.
|
||||||
5. To merge a change branch into its merge target branch, you MUST open a
|
5. To merge a change branch into its merge target branch, you MUST open a
|
||||||
"pull request" (or equivalent) so others can review and approve your
|
"pull request" (or equivalent) so others can review and approve your
|
||||||
changes.
|
changes.
|
||||||
6. A pull request MUST only be merged when the change branch is up-to-date
|
6. A pull request MUST only be merged when the change branch is up-to-date
|
||||||
with its source branch, the test suite is passing, and you and others are
|
with its source branch, the test suite is passing, and you and others are
|
||||||
happy with the change. This is especially important if the merge target
|
happy with the change. This is especially important if the merge target
|
||||||
is the master branch.
|
is the master branch.
|
||||||
7. To get feedback, help, or generally just discuss a change branch with
|
7. To get feedback, help, or generally just discuss a change branch with
|
||||||
others, it is RECOMMENDED you do this by creating a pull request and
|
others, it is RECOMMENDED you do this by creating a pull request and
|
||||||
discuss the changes with others there.
|
discuss the changes with others there.
|
||||||
3. Git Best Practices
|
3. Git Best Practices
|
||||||
1. All commit messages SHOULD follow the Commit Guidelines and format from
|
1. All commit messages SHOULD follow the Commit Guidelines and format from
|
||||||
the official git
|
the official git
|
||||||
documentation:
|
documentation:
|
||||||
<https://git-scm.com/book/en/v2/Distributed-Git-Contributing-to-a-Project>
|
<https://git-scm.com/book/en/v2/Distributed-Git-Contributing-to-a-Project>
|
||||||
2. You SHOULD always use "--force-with-lease" when doing a force push. The
|
2. You SHOULD always use "--force-with-lease" when doing a force push. The
|
||||||
plain "--force" option is dangerous and destructive. More
|
plain "--force" option is dangerous and destructive. More
|
||||||
information:
|
information:
|
||||||
<https://developer.atlassian.com/blog/2015/04/force-with-lease/>
|
<https://developer.atlassian.com/blog/2015/04/force-with-lease/>
|
||||||
3. You SHOULD understand and be comfortable with
|
3. You SHOULD understand and be comfortable with
|
||||||
rebasing: <https://git-scm.com/book/en/v2/Git-Branching-Rebasing>
|
rebasing: <https://git-scm.com/book/en/v2/Git-Branching-Rebasing>
|
||||||
4. It is RECOMMENDED that you always do "git pull --rebase" instead of "git
|
4. It is RECOMMENDED that you always do "git pull --rebase" instead of "git
|
||||||
pull" to avoid unnecessary merge commits. You can make this the default
|
pull" to avoid unnecessary merge commits. You can make this the default
|
||||||
behavior of "git pull" with "git config --global pull.rebase true".
|
behavior of "git pull" with "git config --global pull.rebase true".
|
||||||
5. It is RECOMMENDED that all branches be merged using "git merge --no-ff".
|
5. It is RECOMMENDED that all branches be merged using "git merge --no-ff".
|
||||||
This makes sure the reference to the original branch is kept in the commits,
|
This makes sure the reference to the original branch is kept in the commits,
|
||||||
allows one to revert a merge by reverting a single merge commit, and creates
|
allows one to revert a merge by reverting a single merge commit, and creates
|
||||||
a merge commit to mark the integration of the branch with master.
|
a merge commit to mark the integration of the branch with master.
|
||||||
4. Versioning
|
4. Versioning
|
||||||
1. The project MUST have its version hard-coded somewhere in the
|
1. The project MUST have its version hard-coded somewhere in the
|
||||||
code-base. It is RECOMMENDED that this is done in a file called "VERSION"
|
code-base. It is RECOMMENDED that this is done in a file called "VERSION"
|
||||||
located in the root of the project.
|
located in the root of the project.
|
||||||
2. If you are using a "VERSION" file in the root of the project, this MUST
|
2. If you are using a "VERSION" file in the root of the project, this MUST
|
||||||
only contain the exact version string.
|
only contain the exact version string.
|
||||||
3. The version string SHOULD follow the Semantic Versioning
|
3. The version string SHOULD follow the Semantic Versioning
|
||||||
(<http://semver.org/>) format. Use of Semantic Versioning is OPTIONAL,
|
(<http://semver.org/>) format. Use of Semantic Versioning is OPTIONAL,
|
||||||
but the version string MUST NOT have a "v" prefix. For example "v2.11.4"
|
but the version string MUST NOT have a "v" prefix. For example "v2.11.4"
|
||||||
is bad, and "2.11.4" is good.
|
is bad, and "2.11.4" is good.
|
||||||
5. Releases
|
5. Releases
|
||||||
1. To create a new release, you MUST create a "version bump" commit directly
|
1. To create a new release, you MUST create a "version bump" commit directly
|
||||||
on the master branch which changes the hard-coded version value of the
|
on the master branch which changes the hard-coded version value of the
|
||||||
project. The version bump commit MUST have a git tag created on it and
|
project. The version bump commit MUST have a git tag created on it and
|
||||||
named as the exact version string.
|
named as the exact version string.
|
||||||
2. A version bump commit MUST have a commit message title of "Bump version
|
2. A version bump commit MUST have a commit message title of "Bump version
|
||||||
to VERSION". For example, if the new version string is "2.11.4", the
|
to VERSION". For example, if the new version string is "2.11.4", the
|
||||||
first line of the commit message MUST read: "Bump version to 2.11.4"
|
first line of the commit message MUST read: "Bump version to 2.11.4"
|
||||||
3. The release tag on the version bump commit MUST be named exactly the same
|
3. The release tag on the version bump commit MUST be named exactly the same
|
||||||
as the version string. The tag name can OPTIONALLY be prefixed with
|
as the version string. The tag name can OPTIONALLY be prefixed with
|
||||||
"v". For example the tag name can be either "2.11.4" or "v2.11.4".
|
"v". For example the tag name can be either "2.11.4" or "v2.11.4".
|
||||||
4. It is RECOMMENDED that release tags are lightweight tags, but you can
|
4. It is RECOMMENDED that release tags are lightweight tags, but you can
|
||||||
OPTIONALLY use annotated tags if you want to include changelog
|
OPTIONALLY use annotated tags if you want to include changelog
|
||||||
information in the release tag itself.
|
information in the release tag itself.
|
||||||
5. If you use annotated release tags, the first line of the annotation MUST
|
5. If you use annotated release tags, the first line of the annotation MUST
|
||||||
read "Release VERSION". For example for version "2.11.4" the first line
|
read "Release VERSION". For example for version "2.11.4" the first line
|
||||||
of the tag annotation would read "Release 2.11.4". The second line must
|
of the tag annotation would read "Release 2.11.4". The second line must
|
||||||
be blank, and the changelog MUST start on the third line.
|
be blank, and the changelog MUST start on the third line.
|
||||||
6. Bug Fixes & Rollback
|
6. Bug Fixes & Rollback
|
||||||
1. You MUST NOT under any circumstances force push to the master branch.
|
1. You MUST NOT under any circumstances force push to the master branch.
|
||||||
2. If a change branch which has been merged in to the master branch is found
|
2. If a change branch which has been merged in to the master branch is found
|
||||||
to have a bug in it, the bug fix work MUST be done as a new separate
|
to have a bug in it, the bug fix work MUST be done as a new separate
|
||||||
change branch and MUST follow the same workflow as any other change
|
change branch and MUST follow the same workflow as any other change
|
||||||
branch.
|
branch.
|
||||||
3. If a change branch is wrongfully merged in to master, or for any other
|
3. If a change branch is wrongfully merged in to master, or for any other
|
||||||
reason the merge must be undone, you MUST undo the merge by reverting the
|
reason the merge must be undone, you MUST undo the merge by reverting the
|
||||||
merge commit itself. Effectively creating a new commit that reverses all
|
merge commit itself. Effectively creating a new commit that reverses all
|
||||||
the relevant changes.
|
the relevant changes.
|
||||||
7. Maintenance Releases
|
7. Maintenance Releases
|
||||||
1. Any branch that has a name starting with "stable-" SHOULD be referred to
|
1. Any branch that has a name starting with "stable-" SHOULD be referred to
|
||||||
as a "maintenance branch".
|
as a "maintenance branch".
|
||||||
2. Maintenance branches are used for managing new releases of older
|
2. Maintenance branches are used for managing new releases of older
|
||||||
versions. Typically this is used to provide security updates for older
|
versions. Typically this is used to provide security updates for older
|
||||||
versions when the master branch has moved on to a point that a new
|
versions when the master branch has moved on to a point that a new
|
||||||
release for the old version cannot be made from the master branch.
|
release for the old version cannot be made from the master branch.
|
||||||
3. A "maintenance release" is identical to a regular release, except the
|
3. A "maintenance release" is identical to a regular release, except the
|
||||||
version bump commit and the release tag are placed on the maintenance
|
version bump commit and the release tag are placed on the maintenance
|
||||||
branch instead of on the master branch.
|
branch instead of on the master branch.
|
||||||
4. A maintenance branch SHOULD follow a "stable-X.Y" naming pattern, where
|
3. A maintenance branch SHOULD follow a "stable-X.Y" naming pattern, where
|
||||||
"X" is the MAJOR version and "Y" is the minor version.
|
"X" is the MAJOR version and "Y" is the minor version.
|
||||||
5. A maintenance branch MUST be created from the relevant release tag. For
|
4. A maintenance branch MUST be created from the relevant release tag. For
|
||||||
example if there is a security fix for all 2.9.x releases, the latest of
|
example if there is a security fix for all 2.9.x releases, the latest of
|
||||||
which is "2.9.7", we create a new branch called "stable-2.9" off of the
|
which is "2.9.7", we create a new branch called "stable-2.9" off of the
|
||||||
"2.9.7" release tag. The security fix release will then end up being
|
"2.9.7" release tag. The security fix release will then end up being
|
||||||
version "2.9.8".
|
version "2.9.8".
|
||||||
6. When working on a maintenance release, the relevant maintenance branch
|
5. When working on a maintenance release, the relevant maintenance branch
|
||||||
MUST be thought of as the master branch for that maintenance work.
|
MUST be thought of as the master branch for that maintenance work.
|
||||||
7. Changes in a maintenance branch SHOULD typically come from work being
|
6. Changes in a maintenance branch SHOULD typically come from work being
|
||||||
done against the master branch. Meaning changes SHOULD only trickle
|
done against the master branch. Meaning changes SHOULD only trickle
|
||||||
downwards from the master branch. If a change needs to trickle back up
|
downwards from the master branch. If a change needs to trickle back up
|
||||||
into the master branch, that work should have happened against the master
|
into the master branch, that work should have happened against the master
|
||||||
branch in the first place.
|
branch in the first place.
|
||||||
|
|
||||||
## About
|
About
|
||||||
|
-----
|
||||||
|
|
||||||
The Git Common-Flow specification is authored
|
The Git Common-Flow specification is authored
|
||||||
by [Jim Myhrberg](http://jimeh.me).
|
by [Jim Myhrberg](http://jimeh.me).
|
||||||
@@ -173,6 +175,7 @@ by [Jim Myhrberg](http://jimeh.me).
|
|||||||
If you'd like to leave feedback,
|
If you'd like to leave feedback,
|
||||||
please [open an issue on GitHub](https://github.com/jimeh/common-flow/issues).
|
please [open an issue on GitHub](https://github.com/jimeh/common-flow/issues).
|
||||||
|
|
||||||
## License
|
License
|
||||||
|
-------
|
||||||
|
|
||||||
[Creative Commons - CC BY 3.0](http://creativecommons.org/licenses/by/3.0/)
|
[Creative Commons - CC BY 3.0](http://creativecommons.org/licenses/by/3.0/)
|
||||||
|
|||||||
1
src/content/spec/1.0.0-rc.1.svg
Normal file
|
After Width: | Height: | Size: 13 KiB |
@@ -1,13 +1,12 @@
|
|||||||
---
|
---
|
||||||
title: Git Common-Flow 1.0.0-rc.2
|
title: Git Common-Flow v1.0.0-rc.2
|
||||||
version: 1.0.0-rc.2
|
version: 1.0.0-rc.2
|
||||||
---
|
---
|
||||||
|
Git Common-Flow v1.0.0-rc.2
|
||||||
|
===========================
|
||||||
|
|
||||||
# Git Common-Flow 1.0.0-rc.2
|
Summary
|
||||||
|
-------
|
||||||
<img src="/spec/1.0.0-rc.2.svg" alt="Git Common-Flow 1.0.0-rc.2 diagram" width="100%" />
|
|
||||||
|
|
||||||
## Summary
|
|
||||||
|
|
||||||
Common-Flow is an attempt to gather a sensible selection of the most common
|
Common-Flow is an attempt to gather a sensible selection of the most common
|
||||||
usage patterns of git into a single and concise specification. It is based on
|
usage patterns of git into a single and concise specification. It is based on
|
||||||
@@ -19,7 +18,8 @@ TL;DR: Common-Flow is basically GitHub Flow with the addition of versioned
|
|||||||
releases, maintenance releases for old versions, and without the requirement to
|
releases, maintenance releases for old versions, and without the requirement to
|
||||||
deploy to production all the time.
|
deploy to production all the time.
|
||||||
|
|
||||||
## Terminology
|
Terminology
|
||||||
|
-----------
|
||||||
|
|
||||||
- **Master Branch** - Must always have passing tests, is considered bleeding
|
- **Master Branch** - Must always have passing tests, is considered bleeding
|
||||||
edge, and must be named `master`.
|
edge, and must be named `master`.
|
||||||
@@ -38,159 +38,161 @@ deploy to production all the time.
|
|||||||
- **Release Branches** - Used both for short-term preparations of a release, and
|
- **Release Branches** - Used both for short-term preparations of a release, and
|
||||||
also for long-term maintenance of older version.
|
also for long-term maintenance of older version.
|
||||||
|
|
||||||
## Git Common-Flow Specification (Common-Flow)
|
Git Common-Flow Specification (Common-Flow)
|
||||||
|
-------------------------------------------
|
||||||
|
|
||||||
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD",
|
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD",
|
||||||
"SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be
|
"SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be
|
||||||
interpreted as described in [RFC 2119](https://tools.ietf.org/html/rfc2119).
|
interpreted as described in [RFC 2119](https://tools.ietf.org/html/rfc2119).
|
||||||
|
|
||||||
1. The Master Branch
|
1. The Master Branch
|
||||||
1. A branch named "master" MUST exist and it MUST be referred to as the
|
1. A branch named "master" MUST exist and it MUST be referred to as the
|
||||||
"master branch".
|
"master branch".
|
||||||
2. The master branch MUST be considered bleeding edge.
|
2. The master branch MUST be considered bleeding edge.
|
||||||
3. The master branch MUST always be in a non-broken state with its test
|
3. The master branch MUST always be in a non-broken state with its test
|
||||||
suite passing.
|
suite passing.
|
||||||
4. The master branch SHOULD always be in a "as near as possibly ready for
|
4. The master branch SHOULD always be in a "as near as possibly ready for
|
||||||
release/production" state to reduce any friction with creating a new
|
release/production" state to reduce any friction with creating a new
|
||||||
release.
|
release.
|
||||||
2. Change Branches
|
2. Change Branches
|
||||||
1. Each change (feature, bugfix, etc.) MUST be performed on separate
|
1. Each change (feature, bugfix, etc.) MUST be performed on separate
|
||||||
branches that SHOULD be referred to as "change branches". All change
|
branches that SHOULD be referred to as "change branches". All change
|
||||||
branches MUST have descriptive names. It is RECOMMENDED that you commit
|
branches MUST have descriptive names. It is RECOMMENDED that you commit
|
||||||
often locally, and you SHOULD regularly push your work to the same named
|
often locally, and you SHOULD regularly push your work to the same named
|
||||||
branch on the remote server.
|
branch on the remote server.
|
||||||
2. You MUST create separate change branches for each distinctly different
|
2. You MUST create separate change branches for each distinctly different
|
||||||
change. You MUST NOT include multiple unrelated changes into a single
|
change. You MUST NOT include multiple unrelated changes into a single
|
||||||
change branch.
|
change branch.
|
||||||
3. When a change branch is created, the branch that it is created from
|
3. When a change branch is created, the branch that it is created from
|
||||||
SHOULD be referred to as the "source branch". Each change branch also
|
SHOULD be referred to as the "source branch". Each change branch also
|
||||||
needs a designated "merge target" branch, typically this will be the same
|
needs a designated "merge target" branch, typically this will be the same
|
||||||
as the source branch.
|
as the source branch.
|
||||||
4. Change branches MUST be regularly updated with any changes from their
|
4. Change branches MUST be regularly updated with any changes from their
|
||||||
source branch. This MUST be done by rebasing the change branch on top of
|
source branch. This MUST be done by rebasing the change branch on top of
|
||||||
the source branch.
|
the source branch.
|
||||||
5. After rebasing a change branch on top of its source branch you MUST push
|
5. After rebasing a change branch on top of its source branch you MUST push
|
||||||
the change branch to the remote server. This will require you to do a
|
the change branch to the remote server. This will require you to do a
|
||||||
force push, and you SHOULD use the "--force-with-lease" git push option.
|
force push, and you SHOULD use the "--force-with-lease" git push option.
|
||||||
3. Pull Requests
|
3. Pull Requests
|
||||||
1. To merge a change branch into its merge target, you MUST open a "pull
|
1. To merge a change branch into its merge target, you MUST open a "pull
|
||||||
request" (or equivalent) so others can review and approve your changes.
|
request" (or equivalent) so others can review and approve your changes.
|
||||||
2. A pull request MUST only be merged when the change branch is up-to-date
|
2. A pull request MUST only be merged when the change branch is up-to-date
|
||||||
with its source branch, the test suite is passing, and you and others are
|
with its source branch, the test suite is passing, and you and others are
|
||||||
happy with the change. This is especially important if the merge target
|
happy with the change. This is especially important if the merge target
|
||||||
is the master branch.
|
is the master branch.
|
||||||
3. To get feedback, help, or generally just discuss a change branch with
|
3. To get feedback, help, or generally just discuss a change branch with
|
||||||
others, the RECOMMENDED way to do so is by creating a pull request and
|
others, the RECOMMENDED way to do so is by creating a pull request and
|
||||||
discuss the changes with others there.
|
discuss the changes with others there.
|
||||||
4. Versioning
|
4. Versioning
|
||||||
1. The project MUST have its version hard-coded somewhere in the
|
1. The project MUST have its version hard-coded somewhere in the
|
||||||
code-base. It is RECOMMENDED that this is done in a file called "VERSION"
|
code-base. It is RECOMMENDED that this is done in a file called "VERSION"
|
||||||
located in the root of the project.
|
located in the root of the project.
|
||||||
2. If you are using a "VERSION" file in the root of the project, this MUST
|
2. If you are using a "VERSION" file in the root of the project, this MUST
|
||||||
only contain the exact version string.
|
only contain the exact version string.
|
||||||
3. The version string SHOULD follow the Semantic Versioning
|
3. The version string SHOULD follow the Semantic Versioning
|
||||||
(<http://semver.org/>) format. Use of Semantic Versioning is OPTIONAL,
|
(<http://semver.org/>) format. Use of Semantic Versioning is OPTIONAL,
|
||||||
but the version string MUST NOT have a "v" prefix. For example "v2.11.4"
|
but the version string MUST NOT have a "v" prefix. For example "v2.11.4"
|
||||||
is bad, and "2.11.4" is good.
|
is bad, and "2.11.4" is good.
|
||||||
5. Releases
|
5. Releases
|
||||||
1. To create a new release, you MUST create a "version bump" commit which
|
1. To create a new release, you MUST create a "version bump" commit which
|
||||||
changes the hard-coded version string of the project. The version bump
|
changes the hard-coded version string of the project. The version bump
|
||||||
commit MUST have a git tag created on it and named as the exact version
|
commit MUST have a git tag created on it and named as the exact version
|
||||||
string.
|
string.
|
||||||
2. If you are not using a release branch, then the version bump commit MUST
|
2. If you are not using a release branch, then the version bump commit MUST
|
||||||
be created directly on the master branch.
|
be created directly on the master branch.
|
||||||
3. The version bump commit MUST have a commit message title of "Bump version
|
3. The version bump commit MUST have a commit message title of "Bump version
|
||||||
to VERSION". For example, if the new version string is "2.11.4", the
|
to VERSION". For example, if the new version string is "2.11.4", the
|
||||||
first line of the commit message MUST read: "Bump version to 2.11.4"
|
first line of the commit message MUST read: "Bump version to 2.11.4"
|
||||||
4. The release tag on the version bump commit MUST be named exactly the same
|
4. The release tag on the version bump commit MUST be named exactly the same
|
||||||
as the version string. The tag name can OPTIONALLY be prefixed with
|
as the version string. The tag name can OPTIONALLY be prefixed with
|
||||||
"v". For example the tag name can be either "2.11.4" or "v2.11.4". You
|
"v". For example the tag name can be either "2.11.4" or "v2.11.4". You
|
||||||
MUST not use a mix of "v" prefixed and non-prefixed tags. Pick one form
|
MUST not use a mix of "v" prefixed and non-prefixed tags. Pick one form
|
||||||
and stick to it.
|
and stick to it.
|
||||||
5. It is RECOMMENDED that release tags are lightweight tags, but you can
|
5. It is RECOMMENDED that release tags are lightweight tags, but you can
|
||||||
OPTIONALLY use annotated tags if you want to include changelog
|
OPTIONALLY use annotated tags if you want to include changelog
|
||||||
information in the release tag itself.
|
information in the release tag itself.
|
||||||
6. If you use annotated release tags, the first line of the annotation MUST
|
6. If you use annotated release tags, the first line of the annotation MUST
|
||||||
read "Release VERSION". For example for version "2.11.4" the first line
|
read "Release VERSION". For example for version "2.11.4" the first line
|
||||||
of the tag annotation would read "Release 2.11.4". The second line must
|
of the tag annotation would read "Release 2.11.4". The second line must
|
||||||
be blank, and the changelog MUST start on the third line.
|
be blank, and the changelog MUST start on the third line.
|
||||||
6. Release Branches
|
6. Release Branches
|
||||||
1. Any branch that has a name starting with "release-" SHOULD be referred to
|
1. Any branch that has a name starting with "release-" SHOULD be referred to
|
||||||
as a "release branch".
|
as a "release branch".
|
||||||
2. Use of release branches is OPTIONAL.
|
2. Use of release branches is OPTIONAL.
|
||||||
3. Changes in a release branch SHOULD typically come from work being
|
3. Changes in a release branch SHOULD typically come from work being
|
||||||
done against the master branch. Meaning changes SHOULD only trickle
|
done against the master branch. Meaning changes SHOULD only trickle
|
||||||
downwards from the master branch. If a change needs to trickle back up
|
downwards from the master branch. If a change needs to trickle back up
|
||||||
into the master branch, that work should have happened against the master
|
into the master branch, that work should have happened against the master
|
||||||
branch in the first place. One exception to this is version bump commits.
|
branch in the first place. One exception to this is version bump commits.
|
||||||
4. There are two types of release branches; short-term, and long-term.
|
4. There are two types of release branches; short-term, and long-term.
|
||||||
5. Short-Term Release Branches
|
5. Short-Term Release Branches
|
||||||
1. Used for creating a specific versioned release.
|
1. Used for creating a specific versioned release.
|
||||||
2. A short-term release branch is RECOMMENDED if there is a lengthy
|
2. A short-term release branch is RECOMMENDED if there is a lengthy
|
||||||
pre-release verification process to avoid a code freeze on the master
|
pre-release verification process to avoid a code freeze on the master
|
||||||
branch.
|
branch.
|
||||||
3. MUST have a name of "release-VERSION". For example for version
|
3. MUST have a name of "release-VERSION". For example for version
|
||||||
"2.11.4" the release branch name MUST be "release-2.11.4".
|
"2.11.4" the release branch name MUST be "release-2.11.4".
|
||||||
4. When using a short-term release branch, the version bump commit and
|
4. When using a short-term release branch, the version bump commit and
|
||||||
release tag MUST be made directly on the release branch itself.
|
release tag MUST be made directly on the release branch itself.
|
||||||
5. Only very minor changes should be performed on a short-term release
|
5. Only very minor changes should be performed on a short-term release
|
||||||
branch directly. Any larger changes SHOULD be done in the master
|
branch directly. Any larger changes SHOULD be done in the master
|
||||||
branch, and SHOULD be pulled into the release branch by rebasing it
|
branch, and SHOULD be pulled into the release branch by rebasing it
|
||||||
on top of the master branch the same way a change branch pulls in
|
on top of the master branch the same way a change branch pulls in
|
||||||
updates from its source branch.
|
updates from its source branch.
|
||||||
6. After the version bump commit and release tag have been created, the
|
6. After the version bump commit and release tag have been created, the
|
||||||
release branch MUST be merged back into its source branch and then
|
release branch MUST be merged back into its source branch and then
|
||||||
deleted. Typically the source branch will be the master branch.
|
deleted. Typically the source branch will be the master branch.
|
||||||
6. Long-Term Release Branches
|
6. Long-Term Release Branches
|
||||||
1. Used for work on versions which are not currently part of the master
|
1. Used for work on versions which are not currently part of the master
|
||||||
branch. Typically this is useful when you need to create a new
|
branch. Typically this is useful when you need to create a new
|
||||||
maintenance release for a older version.
|
maintenance release for a older version.
|
||||||
2. The branch name MUST have a non-specific version number. For example
|
2. The branch name MUST have a non-specific version number. For example
|
||||||
a long-term release branch for creating new 2.9.x releases would be
|
a long-term release branch for creating new 2.9.x releases would be
|
||||||
named "release-2.9".
|
named "release-2.9".
|
||||||
3. To create a new release from a long-term release branch, you MUST
|
3. To create a new release from a long-term release branch, you MUST
|
||||||
create a version bump commit and release tag directly on the release
|
create a version bump commit and release tag directly on the release
|
||||||
branch.
|
branch.
|
||||||
4. A long-term release branch MUST be created from the relevant release
|
4. A long-term release branch MUST be created from the relevant release
|
||||||
tag. For example if the master branch is on version 2.11.4 and there
|
tag. For example if the master branch is on version 2.11.4 and there
|
||||||
is a security fix for all 2.9.x releases, the latest of which is
|
is a security fix for all 2.9.x releases, the latest of which is
|
||||||
"2.9.7". Create a new branch called "release-2.9" off of the "2.9.7"
|
"2.9.7". Create a new branch called "release-2.9" off of the "2.9.7"
|
||||||
release tag. The security fix release will then end up being version
|
release tag. The security fix release will then end up being version
|
||||||
"2.9.8".
|
"2.9.8".
|
||||||
7. Bug Fixes & Rollback
|
7. Bug Fixes & Rollback
|
||||||
1. You MUST NOT under any circumstances force push to the master branch.
|
1. You MUST NOT under any circumstances force push to the master branch.
|
||||||
2. If a change branch which has been merged into the master branch is found
|
2. If a change branch which has been merged into the master branch is found
|
||||||
to have a bug in it, the bug fix work MUST be done as a new separate
|
to have a bug in it, the bug fix work MUST be done as a new separate
|
||||||
change branch and MUST follow the same workflow as any other change
|
change branch and MUST follow the same workflow as any other change
|
||||||
branch.
|
branch.
|
||||||
3. If a change branch is wrongfully merged into master, or for any other
|
3. If a change branch is wrongfully merged into master, or for any other
|
||||||
reason the merge must be undone, you MUST undo the merge by reverting the
|
reason the merge must be undone, you MUST undo the merge by reverting the
|
||||||
merge commit itself. Effectively creating a new commit that reverses all
|
merge commit itself. Effectively creating a new commit that reverses all
|
||||||
the relevant changes.
|
the relevant changes.
|
||||||
8. Git Best Practices
|
8. Git Best Practices
|
||||||
1. All commit messages SHOULD follow the Commit Guidelines and format from
|
1. All commit messages SHOULD follow the Commit Guidelines and format from
|
||||||
the official git
|
the official git
|
||||||
documentation:
|
documentation:
|
||||||
<https://git-scm.com/book/en/v2/Distributed-Git-Contributing-to-a-Project>
|
<https://git-scm.com/book/en/v2/Distributed-Git-Contributing-to-a-Project>
|
||||||
2. You SHOULD never blindly commit all changes with "git commit -a". It is
|
2. You SHOULD never blindly commit all changes with "git commit -a". It is
|
||||||
RECOMMENDED you use "git add -i" to add individual changes to the staging
|
RECOMMENDED you use "git add -i" to add individual changes to the staging
|
||||||
area so you are fully aware of what you are committing.
|
area so you are fully aware of what you are committing.
|
||||||
3. You SHOULD always use "--force-with-lease" when doing a force push. The
|
3. You SHOULD always use "--force-with-lease" when doing a force push. The
|
||||||
regular "--force" option is dangerous and destructive. More
|
regular "--force" option is dangerous and destructive. More
|
||||||
information:
|
information:
|
||||||
<https://developer.atlassian.com/blog/2015/04/force-with-lease/>
|
<https://developer.atlassian.com/blog/2015/04/force-with-lease/>
|
||||||
4. You SHOULD understand and be comfortable with
|
4. You SHOULD understand and be comfortable with
|
||||||
rebasing: <https://git-scm.com/book/en/v2/Git-Branching-Rebasing>
|
rebasing: <https://git-scm.com/book/en/v2/Git-Branching-Rebasing>
|
||||||
5. It is RECOMMENDED that you always do "git pull --rebase" instead of "git
|
5. It is RECOMMENDED that you always do "git pull --rebase" instead of "git
|
||||||
pull" to avoid unnecessary merge commits. You can make this the default
|
pull" to avoid unnecessary merge commits. You can make this the default
|
||||||
behavior of "git pull" with "git config --global pull.rebase true".
|
behavior of "git pull" with "git config --global pull.rebase true".
|
||||||
6. It is RECOMMENDED that all branches be merged using "git merge --no-ff".
|
6. It is RECOMMENDED that all branches be merged using "git merge --no-ff".
|
||||||
This makes sure the reference to the original branch is kept in the
|
This makes sure the reference to the original branch is kept in the
|
||||||
commits, allows one to revert a merge by reverting a single merge commit,
|
commits, allows one to revert a merge by reverting a single merge commit,
|
||||||
and creates a merge commit to mark the integration of the branch with
|
and creates a merge commit to mark the integration of the branch with
|
||||||
master.
|
master.
|
||||||
|
|
||||||
## About
|
About
|
||||||
|
-----
|
||||||
|
|
||||||
The Git Common-Flow specification is authored
|
The Git Common-Flow specification is authored
|
||||||
by [Jim Myhrberg](http://jimeh.me).
|
by [Jim Myhrberg](http://jimeh.me).
|
||||||
@@ -198,6 +200,7 @@ by [Jim Myhrberg](http://jimeh.me).
|
|||||||
If you'd like to leave feedback,
|
If you'd like to leave feedback,
|
||||||
please [open an issue on GitHub](https://github.com/jimeh/common-flow/issues).
|
please [open an issue on GitHub](https://github.com/jimeh/common-flow/issues).
|
||||||
|
|
||||||
## License
|
License
|
||||||
|
-------
|
||||||
|
|
||||||
[Creative Commons - CC BY 3.0](http://creativecommons.org/licenses/by/3.0/)
|
[Creative Commons - CC BY 3.0](http://creativecommons.org/licenses/by/3.0/)
|
||||||
|
|||||||
1
src/content/spec/1.0.0-rc.2.svg
Normal file
|
After Width: | Height: | Size: 13 KiB |
@@ -1,13 +1,12 @@
|
|||||||
---
|
---
|
||||||
title: Git Common-Flow 1.0.0-rc.3
|
title: Git Common-Flow v1.0.0-rc.3
|
||||||
version: 1.0.0-rc.3
|
version: 1.0.0-rc.3
|
||||||
---
|
---
|
||||||
|
Git Common-Flow v1.0.0-rc.3
|
||||||
|
===========================
|
||||||
|
|
||||||
# Git Common-Flow 1.0.0-rc.3
|
Summary
|
||||||
|
-------
|
||||||
<img src="/spec/1.0.0-rc.3.svg" alt="Git Common-Flow 1.0.0-rc.3 diagram" width="100%" />
|
|
||||||
|
|
||||||
## Summary
|
|
||||||
|
|
||||||
Common-Flow is an attempt to gather a sensible selection of the most common
|
Common-Flow is an attempt to gather a sensible selection of the most common
|
||||||
usage patterns of git into a single and concise specification. It is based on
|
usage patterns of git into a single and concise specification. It is based on
|
||||||
@@ -19,7 +18,8 @@ In short, Common-Flow is essentially GitHub Flow with the addition of versioned
|
|||||||
releases, optional release branches, and without the requirement to deploy to
|
releases, optional release branches, and without the requirement to deploy to
|
||||||
production all the time.
|
production all the time.
|
||||||
|
|
||||||
## Terminology
|
Terminology
|
||||||
|
-----------
|
||||||
|
|
||||||
- **Master Branch** - Must be named "master", must always have passing tests,
|
- **Master Branch** - Must be named "master", must always have passing tests,
|
||||||
and is not guaranteed to always work in production environments.
|
and is not guaranteed to always work in production environments.
|
||||||
@@ -39,164 +39,166 @@ production all the time.
|
|||||||
- **Release Branches** - Used both for short-term preparations of a release, and
|
- **Release Branches** - Used both for short-term preparations of a release, and
|
||||||
also for long-term maintenance of older version.
|
also for long-term maintenance of older version.
|
||||||
|
|
||||||
## Git Common-Flow Specification (Common-Flow)
|
Git Common-Flow Specification (Common-Flow)
|
||||||
|
-------------------------------------------
|
||||||
|
|
||||||
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD",
|
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD",
|
||||||
"SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be
|
"SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be
|
||||||
interpreted as described in [RFC 2119](https://tools.ietf.org/html/rfc2119).
|
interpreted as described in [RFC 2119](https://tools.ietf.org/html/rfc2119).
|
||||||
|
|
||||||
1. TL;DR
|
1. TL;DR
|
||||||
1. Don't break the master branch.
|
1. Don't break the master branch.
|
||||||
2. A release is a git tag.
|
2. A release is a git tag.
|
||||||
2. The Master Branch
|
2. The Master Branch
|
||||||
1. A branch named "master" MUST exist and it MUST be referred to as the
|
1. A branch named "master" MUST exist and it MUST be referred to as the
|
||||||
"master branch".
|
"master branch".
|
||||||
2. The master branch MUST always be in a non-broken state with its test
|
2. The master branch MUST always be in a non-broken state with its test
|
||||||
suite passing.
|
suite passing.
|
||||||
3. The master branch IS NOT guaranteed to always work in production
|
4. The master branch IS NOT guaranteed to always work in production
|
||||||
environments. Despite test suites passing it may at times contain
|
environments. Despite test suites passing it may at times contain
|
||||||
unfinished work. Only releases may be considered safe for production use.
|
unfinished work. Only releases may be considered safe for production use.
|
||||||
4. The master branch SHOULD always be in a "as near as possibly ready for
|
5. The master branch SHOULD always be in a "as near as possibly ready for
|
||||||
release/production" state to reduce any friction with creating a new
|
release/production" state to reduce any friction with creating a new
|
||||||
release.
|
release.
|
||||||
3. Change Branches
|
3. Change Branches
|
||||||
1. Each change (feature, bugfix, etc.) MUST be performed on separate
|
1. Each change (feature, bugfix, etc.) MUST be performed on separate
|
||||||
branches that SHOULD be referred to as "change branches". All change
|
branches that SHOULD be referred to as "change branches". All change
|
||||||
branches MUST have descriptive names. It is RECOMMENDED that you commit
|
branches MUST have descriptive names. It is RECOMMENDED that you commit
|
||||||
often locally, and you SHOULD regularly push your work to the same named
|
often locally, and you SHOULD regularly push your work to the same named
|
||||||
branch on the remote server.
|
branch on the remote server.
|
||||||
2. You MUST create separate change branches for each distinctly different
|
2. You MUST create separate change branches for each distinctly different
|
||||||
change. You MUST NOT include multiple unrelated changes into a single
|
change. You MUST NOT include multiple unrelated changes into a single
|
||||||
change branch.
|
change branch.
|
||||||
3. When a change branch is created, the branch that it is created from
|
3. When a change branch is created, the branch that it is created from
|
||||||
SHOULD be referred to as the "source branch". Each change branch also
|
SHOULD be referred to as the "source branch". Each change branch also
|
||||||
needs a designated "merge target" branch, typically this will be the same
|
needs a designated "merge target" branch, typically this will be the same
|
||||||
as the source branch.
|
as the source branch.
|
||||||
4. Change branches MUST be regularly updated with any changes from their
|
4. Change branches MUST be regularly updated with any changes from their
|
||||||
source branch. This MUST be done by rebasing the change branch on top of
|
source branch. This MUST be done by rebasing the change branch on top of
|
||||||
the source branch.
|
the source branch.
|
||||||
5. After rebasing a change branch on top of its source branch you MUST push
|
5. After rebasing a change branch on top of its source branch you MUST push
|
||||||
the change branch to the remote server. This will require you to do a
|
the change branch to the remote server. This will require you to do a
|
||||||
force push, and you SHOULD use the "--force-with-lease" git push option.
|
force push, and you SHOULD use the "--force-with-lease" git push option.
|
||||||
4. Pull Requests
|
4. Pull Requests
|
||||||
1. To merge a change branch into its merge target, you MUST open a "pull
|
1. To merge a change branch into its merge target, you MUST open a "pull
|
||||||
request" (or equivalent) so others can review and approve your changes.
|
request" (or equivalent) so others can review and approve your changes.
|
||||||
2. A pull request MUST only be merged when the change branch is up-to-date
|
2. A pull request MUST only be merged when the change branch is up-to-date
|
||||||
with its source branch, the test suite is passing, and you and others are
|
with its source branch, the test suite is passing, and you and others are
|
||||||
happy with the change. This is especially important if the merge target
|
happy with the change. This is especially important if the merge target
|
||||||
is the master branch.
|
is the master branch.
|
||||||
3. To get feedback, help, or generally just discuss a change branch with
|
3. To get feedback, help, or generally just discuss a change branch with
|
||||||
others, the RECOMMENDED way to do so is by creating a pull request and
|
others, the RECOMMENDED way to do so is by creating a pull request and
|
||||||
discuss the changes with others there.
|
discuss the changes with others there.
|
||||||
5. Versioning
|
5. Versioning
|
||||||
1. The project MUST have its version hard-coded somewhere in the
|
1. The project MUST have its version hard-coded somewhere in the
|
||||||
code-base. It is RECOMMENDED that this is done in a file called "VERSION"
|
code-base. It is RECOMMENDED that this is done in a file called "VERSION"
|
||||||
located in the root of the project.
|
located in the root of the project.
|
||||||
2. If you are using a "VERSION" file in the root of the project, this MUST
|
2. If you are using a "VERSION" file in the root of the project, this MUST
|
||||||
only contain the exact version string.
|
only contain the exact version string.
|
||||||
3. The version string SHOULD follow the Semantic Versioning
|
3. The version string SHOULD follow the Semantic Versioning
|
||||||
(<http://semver.org/>) format. Use of Semantic Versioning is OPTIONAL,
|
(<http://semver.org/>) format. Use of Semantic Versioning is OPTIONAL,
|
||||||
but the version string MUST NOT have a "v" prefix. For example "v2.11.4"
|
but the version string MUST NOT have a "v" prefix. For example "v2.11.4"
|
||||||
is bad, and "2.11.4" is good.
|
is bad, and "2.11.4" is good.
|
||||||
6. Releases
|
6. Releases
|
||||||
1. To create a new release, you MUST create a "version bump" commit which
|
1. To create a new release, you MUST create a "version bump" commit which
|
||||||
changes the hard-coded version string of the project. The version bump
|
changes the hard-coded version string of the project. The version bump
|
||||||
commit MUST have a git tag created on it and named as the exact version
|
commit MUST have a git tag created on it and named as the exact version
|
||||||
string.
|
string.
|
||||||
2. If you are not using a release branch, then the version bump commit MUST
|
2. If you are not using a release branch, then the version bump commit MUST
|
||||||
be created directly on the master branch.
|
be created directly on the master branch.
|
||||||
3. The version bump commit MUST have a commit message title of "Bump version
|
3. The version bump commit MUST have a commit message title of "Bump version
|
||||||
to VERSION". For example, if the new version string is "2.11.4", the
|
to VERSION". For example, if the new version string is "2.11.4", the
|
||||||
first line of the commit message MUST read: "Bump version to 2.11.4"
|
first line of the commit message MUST read: "Bump version to 2.11.4"
|
||||||
4. The release tag on the version bump commit MUST be named exactly the same
|
4. The release tag on the version bump commit MUST be named exactly the same
|
||||||
as the version string. The tag name can OPTIONALLY be prefixed with
|
as the version string. The tag name can OPTIONALLY be prefixed with
|
||||||
"v". For example the tag name can be either "2.11.4" or "v2.11.4". You
|
"v". For example the tag name can be either "2.11.4" or "v2.11.4". You
|
||||||
MUST not use a mix of "v" prefixed and non-prefixed tags. Pick one form
|
MUST not use a mix of "v" prefixed and non-prefixed tags. Pick one form
|
||||||
and stick to it.
|
and stick to it.
|
||||||
5. It is RECOMMENDED that release tags are lightweight tags, but you can
|
5. It is RECOMMENDED that release tags are lightweight tags, but you can
|
||||||
OPTIONALLY use annotated tags if you want to include changelog
|
OPTIONALLY use annotated tags if you want to include changelog
|
||||||
information in the release tag itself.
|
information in the release tag itself.
|
||||||
6. If you use annotated release tags, the first line of the annotation MUST
|
6. If you use annotated release tags, the first line of the annotation MUST
|
||||||
read "Release VERSION". For example for version "2.11.4" the first line
|
read "Release VERSION". For example for version "2.11.4" the first line
|
||||||
of the tag annotation would read "Release 2.11.4". The second line must
|
of the tag annotation would read "Release 2.11.4". The second line must
|
||||||
be blank, and the changelog MUST start on the third line.
|
be blank, and the changelog MUST start on the third line.
|
||||||
7. Release Branches
|
7. Release Branches
|
||||||
1. Any branch that has a name starting with "release-" SHOULD be referred to
|
1. Any branch that has a name starting with "release-" SHOULD be referred to
|
||||||
as a "release branch".
|
as a "release branch".
|
||||||
2. Use of release branches is OPTIONAL.
|
2. Use of release branches is OPTIONAL.
|
||||||
3. Changes in a release branch SHOULD typically come from work being
|
3. Changes in a release branch SHOULD typically come from work being
|
||||||
done against the master branch. Meaning changes SHOULD only trickle
|
done against the master branch. Meaning changes SHOULD only trickle
|
||||||
downwards from the master branch. If a change needs to trickle back up
|
downwards from the master branch. If a change needs to trickle back up
|
||||||
into the master branch, that work should have happened against the master
|
into the master branch, that work should have happened against the master
|
||||||
branch in the first place. One exception to this is version bump commits.
|
branch in the first place. One exception to this is version bump commits.
|
||||||
4. There are two types of release branches; short-term, and long-term.
|
4. There are two types of release branches; short-term, and long-term.
|
||||||
5. Short-Term Release Branches
|
5. Short-Term Release Branches
|
||||||
1. Used for creating a specific versioned release.
|
1. Used for creating a specific versioned release.
|
||||||
2. A short-term release branch is RECOMMENDED if there is a lengthy
|
2. A short-term release branch is RECOMMENDED if there is a lengthy
|
||||||
pre-release verification process to avoid a code freeze on the master
|
pre-release verification process to avoid a code freeze on the master
|
||||||
branch.
|
branch.
|
||||||
3. MUST have a name of "release-VERSION". For example for version
|
3. MUST have a name of "release-VERSION". For example for version
|
||||||
"2.11.4" the release branch name MUST be "release-2.11.4".
|
"2.11.4" the release branch name MUST be "release-2.11.4".
|
||||||
4. When using a short-term release branch, the version bump commit and
|
4. When using a short-term release branch, the version bump commit and
|
||||||
release tag MUST be made directly on the release branch itself.
|
release tag MUST be made directly on the release branch itself.
|
||||||
5. Only very minor changes should be performed on a short-term release
|
5. Only very minor changes should be performed on a short-term release
|
||||||
branch directly. Any larger changes SHOULD be done in the master
|
branch directly. Any larger changes SHOULD be done in the master
|
||||||
branch, and SHOULD be pulled into the release branch by rebasing it
|
branch, and SHOULD be pulled into the release branch by rebasing it
|
||||||
on top of the master branch the same way a change branch pulls in
|
on top of the master branch the same way a change branch pulls in
|
||||||
updates from its source branch.
|
updates from its source branch.
|
||||||
6. After the version bump commit and release tag have been created, the
|
6. After the version bump commit and release tag have been created, the
|
||||||
release branch MUST be merged back into its source branch and then
|
release branch MUST be merged back into its source branch and then
|
||||||
deleted. Typically the source branch will be the master branch.
|
deleted. Typically the source branch will be the master branch.
|
||||||
6. Long-Term Release Branches
|
6. Long-Term Release Branches
|
||||||
1. Used for work on versions which are not currently part of the master
|
1. Used for work on versions which are not currently part of the master
|
||||||
branch. Typically this is useful when you need to create a new
|
branch. Typically this is useful when you need to create a new
|
||||||
maintenance release for a older version.
|
maintenance release for a older version.
|
||||||
2. The branch name MUST have a non-specific version number. For example
|
2. The branch name MUST have a non-specific version number. For example
|
||||||
a long-term release branch for creating new 2.9.x releases would be
|
a long-term release branch for creating new 2.9.x releases would be
|
||||||
named "release-2.9".
|
named "release-2.9".
|
||||||
3. To create a new release from a long-term release branch, you MUST
|
3. To create a new release from a long-term release branch, you MUST
|
||||||
create a version bump commit and release tag directly on the release
|
create a version bump commit and release tag directly on the release
|
||||||
branch.
|
branch.
|
||||||
4. A long-term release branch MUST be created from the relevant release
|
4. A long-term release branch MUST be created from the relevant release
|
||||||
tag. For example if the master branch is on version 2.11.4 and there
|
tag. For example if the master branch is on version 2.11.4 and there
|
||||||
is a security fix for all 2.9.x releases, the latest of which is
|
is a security fix for all 2.9.x releases, the latest of which is
|
||||||
"2.9.7". Create a new branch called "release-2.9" off of the "2.9.7"
|
"2.9.7". Create a new branch called "release-2.9" off of the "2.9.7"
|
||||||
release tag. The security fix release will then end up being version
|
release tag. The security fix release will then end up being version
|
||||||
"2.9.8".
|
"2.9.8".
|
||||||
8. Bug Fixes & Rollback
|
8. Bug Fixes & Rollback
|
||||||
1. You MUST NOT under any circumstances force push to the master branch.
|
1. You MUST NOT under any circumstances force push to the master branch.
|
||||||
2. If a change branch which has been merged into the master branch is found
|
2. If a change branch which has been merged into the master branch is found
|
||||||
to have a bug in it, the bug fix work MUST be done as a new separate
|
to have a bug in it, the bug fix work MUST be done as a new separate
|
||||||
change branch and MUST follow the same workflow as any other change
|
change branch and MUST follow the same workflow as any other change
|
||||||
branch.
|
branch.
|
||||||
3. If a change branch is wrongfully merged into master, or for any other
|
3. If a change branch is wrongfully merged into master, or for any other
|
||||||
reason the merge must be undone, you MUST undo the merge by reverting the
|
reason the merge must be undone, you MUST undo the merge by reverting the
|
||||||
merge commit itself. Effectively creating a new commit that reverses all
|
merge commit itself. Effectively creating a new commit that reverses all
|
||||||
the relevant changes.
|
the relevant changes.
|
||||||
9. Git Best Practices
|
9. Git Best Practices
|
||||||
1. All commit messages SHOULD follow the Commit Guidelines and format from
|
1. All commit messages SHOULD follow the Commit Guidelines and format from
|
||||||
the official git
|
the official git
|
||||||
documentation:
|
documentation:
|
||||||
<https://git-scm.com/book/en/v2/Distributed-Git-Contributing-to-a-Project#_commit_guidelines>
|
<https://git-scm.com/book/en/v2/Distributed-Git-Contributing-to-a-Project#_commit_guidelines>
|
||||||
2. You SHOULD never blindly commit all changes with "git commit -a". It is
|
2. You SHOULD never blindly commit all changes with "git commit -a". It is
|
||||||
RECOMMENDED you use "git add -i" to add individual changes to the staging
|
RECOMMENDED you use "git add -i" to add individual changes to the staging
|
||||||
area so you are fully aware of what you are committing.
|
area so you are fully aware of what you are committing.
|
||||||
3. You SHOULD always use "--force-with-lease" when doing a force push. The
|
3. You SHOULD always use "--force-with-lease" when doing a force push. The
|
||||||
regular "--force" option is dangerous and destructive. More
|
regular "--force" option is dangerous and destructive. More
|
||||||
information:
|
information:
|
||||||
<https://developer.atlassian.com/blog/2015/04/force-with-lease/>
|
<https://developer.atlassian.com/blog/2015/04/force-with-lease/>
|
||||||
4. You SHOULD understand and be comfortable with
|
4. You SHOULD understand and be comfortable with
|
||||||
rebasing: <https://git-scm.com/book/en/v2/Git-Branching-Rebasing>
|
rebasing: <https://git-scm.com/book/en/v2/Git-Branching-Rebasing>
|
||||||
5. It is RECOMMENDED that you always do "git pull --rebase" instead of "git
|
5. It is RECOMMENDED that you always do "git pull --rebase" instead of "git
|
||||||
pull" to avoid unnecessary merge commits. You can make this the default
|
pull" to avoid unnecessary merge commits. You can make this the default
|
||||||
behavior of "git pull" with "git config --global pull.rebase true".
|
behavior of "git pull" with "git config --global pull.rebase true".
|
||||||
6. It is RECOMMENDED that all branches be merged using "git merge --no-ff".
|
6. It is RECOMMENDED that all branches be merged using "git merge --no-ff".
|
||||||
This makes sure the reference to the original branch is kept in the
|
This makes sure the reference to the original branch is kept in the
|
||||||
commits, allows one to revert a merge by reverting a single merge commit,
|
commits, allows one to revert a merge by reverting a single merge commit,
|
||||||
and creates a merge commit to mark the integration of the branch with
|
and creates a merge commit to mark the integration of the branch with
|
||||||
master.
|
master.
|
||||||
|
|
||||||
## About
|
About
|
||||||
|
-----
|
||||||
|
|
||||||
The Git Common-Flow specification is authored
|
The Git Common-Flow specification is authored
|
||||||
by [Jim Myhrberg](http://jimeh.me).
|
by [Jim Myhrberg](http://jimeh.me).
|
||||||
@@ -204,6 +206,7 @@ by [Jim Myhrberg](http://jimeh.me).
|
|||||||
If you'd like to leave feedback,
|
If you'd like to leave feedback,
|
||||||
please [open an issue on GitHub](https://github.com/jimeh/common-flow/issues).
|
please [open an issue on GitHub](https://github.com/jimeh/common-flow/issues).
|
||||||
|
|
||||||
## License
|
License
|
||||||
|
-------
|
||||||
|
|
||||||
[Creative Commons - CC BY 3.0](http://creativecommons.org/licenses/by/3.0/)
|
[Creative Commons - CC BY 3.0](http://creativecommons.org/licenses/by/3.0/)
|
||||||
|
|||||||
1
src/content/spec/1.0.0-rc.3.svg
Normal file
|
After Width: | Height: | Size: 13 KiB |
@@ -1,13 +1,12 @@
|
|||||||
---
|
---
|
||||||
title: Git Common-Flow 1.0.0-rc.4
|
title: Git Common-Flow v1.0.0-rc.4
|
||||||
version: 1.0.0-rc.4
|
version: 1.0.0-rc.4
|
||||||
---
|
---
|
||||||
|
Git Common-Flow v1.0.0-rc.4
|
||||||
|
===========================
|
||||||
|
|
||||||
# Git Common-Flow 1.0.0-rc.4
|
Summary
|
||||||
|
-------
|
||||||
<img src="/spec/1.0.0-rc.4.svg" alt="Git Common-Flow 1.0.0-rc.4 diagram" width="100%" />
|
|
||||||
|
|
||||||
## Summary
|
|
||||||
|
|
||||||
Common-Flow is an attempt to gather a sensible selection of the most common
|
Common-Flow is an attempt to gather a sensible selection of the most common
|
||||||
usage patterns of git into a single and concise specification. It is based on
|
usage patterns of git into a single and concise specification. It is based on
|
||||||
@@ -19,7 +18,8 @@ In short, Common-Flow is essentially GitHub Flow with the addition of versioned
|
|||||||
releases, optional release branches, and without the requirement to deploy to
|
releases, optional release branches, and without the requirement to deploy to
|
||||||
production all the time.
|
production all the time.
|
||||||
|
|
||||||
## Terminology
|
Terminology
|
||||||
|
-----------
|
||||||
|
|
||||||
- **Master Branch** - Must be named "master", must always have passing tests,
|
- **Master Branch** - Must be named "master", must always have passing tests,
|
||||||
and is not guaranteed to always work in production environments.
|
and is not guaranteed to always work in production environments.
|
||||||
@@ -38,182 +38,183 @@ production all the time.
|
|||||||
- **Release Branches** - Used both for short-term preparations of a release, and
|
- **Release Branches** - Used both for short-term preparations of a release, and
|
||||||
also for long-term maintenance of older version.
|
also for long-term maintenance of older version.
|
||||||
|
|
||||||
## Git Common-Flow Specification (Common-Flow)
|
Git Common-Flow Specification (Common-Flow)
|
||||||
|
-------------------------------------------
|
||||||
|
|
||||||
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD",
|
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD",
|
||||||
"SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be
|
"SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be
|
||||||
interpreted as described in [RFC 2119](https://tools.ietf.org/html/rfc2119).
|
interpreted as described in [RFC 2119](https://tools.ietf.org/html/rfc2119).
|
||||||
|
|
||||||
1. TL;DR
|
1. TL;DR
|
||||||
1. Don't break the master branch.
|
1. Don't break the master branch.
|
||||||
2. A release is a git tag.
|
2. A release is a git tag.
|
||||||
2. The Master Branch
|
2. The Master Branch
|
||||||
1. A branch named "master" MUST exist and it MUST be referred to as the
|
1. A branch named "master" MUST exist and it MUST be referred to as the
|
||||||
"master branch".
|
"master branch".
|
||||||
2. The master branch MUST always be in a non-broken state with its test
|
2. The master branch MUST always be in a non-broken state with its test
|
||||||
suite passing.
|
suite passing.
|
||||||
3. The master branch IS NOT guaranteed to always work in production
|
4. The master branch IS NOT guaranteed to always work in production
|
||||||
environments. Despite test suites passing it may at times contain
|
environments. Despite test suites passing it may at times contain
|
||||||
unfinished work. Only releases may be considered safe for production use.
|
unfinished work. Only releases may be considered safe for production use.
|
||||||
4. The master branch SHOULD always be in a "as near as possibly ready for
|
5. The master branch SHOULD always be in a "as near as possibly ready for
|
||||||
release/production" state to reduce any friction with creating a new
|
release/production" state to reduce any friction with creating a new
|
||||||
release.
|
release.
|
||||||
3. Change Branches
|
3. Change Branches
|
||||||
1. Each change (feature, bugfix, etc.) MUST be performed on separate
|
1. Each change (feature, bugfix, etc.) MUST be performed on separate
|
||||||
branches that SHOULD be referred to as "change branches".
|
branches that SHOULD be referred to as "change branches".
|
||||||
2. All change branches MUST have descriptive names.
|
2. All change branches MUST have descriptive names.
|
||||||
3. It is RECOMMENDED that you commit often locally, and that you try and
|
3. It is RECOMMENDED that you commit often locally, and that you try and
|
||||||
keep the commits reasonably structured to avoid a messy and confusing git
|
keep the commits reasonably structured to avoid a messy and confusing git
|
||||||
history.
|
history.
|
||||||
4. You SHOULD regularly push your work to the same named branch on the
|
4. You SHOULD regularly push your work to the same named branch on the
|
||||||
remote server.
|
remote server.
|
||||||
5. You SHOULD create separate change branches for each distinctly different
|
5. You SHOULD create separate change branches for each distinctly different
|
||||||
change. You SHOULD NOT include multiple unrelated changes into a single
|
change. You SHOULD NOT include multiple unrelated changes into a single
|
||||||
change branch.
|
change branch.
|
||||||
6. When a change branch is created, the branch that it is created from
|
6. When a change branch is created, the branch that it is created from
|
||||||
SHOULD be referred to as the "source branch". Each change branch also
|
SHOULD be referred to as the "source branch". Each change branch also
|
||||||
needs a designated "merge target" branch, typically this will be the same
|
needs a designated "merge target" branch, typically this will be the same
|
||||||
as the source branch.
|
as the source branch.
|
||||||
7. Change branches MUST be regularly updated with any changes from their
|
7. Change branches MUST be regularly updated with any changes from their
|
||||||
source branch. This MUST be done by rebasing the change branch on top of
|
source branch. This MUST be done by rebasing the change branch on top of
|
||||||
the source branch.
|
the source branch.
|
||||||
8. After updating a change branch from its source branch you MUST push the
|
8. After updating a change branch from its source branch you MUST push the
|
||||||
change branch to the remote server. Due to the nature of rebasing, you
|
change branch to the remote server. Due to the nature of rebasing, you
|
||||||
will be required to do a force push, and you MUST use the
|
will be required to do a force push, and you MUST use the
|
||||||
"--force-with-lease" git push option when doing so instead of the regular
|
"--force-with-lease" git push option when doing so instead of the regular
|
||||||
"--force".
|
"--force".
|
||||||
9. If there is a truly valid technical reason to not use rebase when
|
9. If there is a truly valid technical reason to not use rebase when
|
||||||
updating change branches, then you can update change branches via merge
|
updating change branches, then you can update change branches via merge
|
||||||
instead of rebase. The decision to use merge MUST only be taken after all
|
instead of rebase. The decision to use merge MUST only be taken after all
|
||||||
possible options to use rebase have been tried and failed. People not
|
possible options to use rebase have been tried and failed. People not
|
||||||
understanding how to use rebase is NOT a valid reason to use merge. If
|
understanding how to use rebase is NOT a valid reason to use merge. If
|
||||||
you do decide to use merge instead of rebase, you MUST NOT use a mixture
|
you do decide to use merge instead of rebase, you MUST NOT use a mixture
|
||||||
of both methods, pick one and stick to it.
|
of both methods, pick one and stick to it.
|
||||||
4. Pull Requests
|
4. Pull Requests
|
||||||
1. To merge a change branch into its merge target, you MUST open a "pull
|
1. To merge a change branch into its merge target, you MUST open a "pull
|
||||||
request" (or equivalent).
|
request" (or equivalent).
|
||||||
2. The purpose of a pull request is to allow others to review your changes
|
2. The purpose of a pull request is to allow others to review your changes
|
||||||
and give feedback. You can then fix any issues, complaints, and more that
|
and give feedback. You can then fix any issues, complaints, and more that
|
||||||
might arise, and then let people review again.
|
might arise, and then let people review again.
|
||||||
3. Before creating a pull request, it is RECOMMENDED that you consider the
|
3. Before creating a pull request, it is RECOMMENDED that you consider the
|
||||||
state of your change branch's commit history. If it is messy and
|
state of your change branch's commit history. If it is messy and
|
||||||
confusing, it might be a good idea to rebase your branch with "git rebase
|
confusing, it might be a good idea to rebase your branch with "git rebase
|
||||||
-i" to present a cleaner and easier to follow commit history for your
|
-i" to present a cleaner and easier to follow commit history for your
|
||||||
reviewers.
|
reviewers.
|
||||||
4. A pull request MUST only be merged when the change branch is up-to-date
|
4. A pull request MUST only be merged when the change branch is up-to-date
|
||||||
with its source branch, the test suite is passing, and you and others are
|
with its source branch, the test suite is passing, and you and others are
|
||||||
happy with the change. This is especially important if the merge target
|
happy with the change. This is especially important if the merge target
|
||||||
is the master branch.
|
is the master branch.
|
||||||
5. To get feedback, help, or generally just discuss a change branch with
|
5. To get feedback, help, or generally just discuss a change branch with
|
||||||
others, the RECOMMENDED way to do so is by creating a pull request and
|
others, the RECOMMENDED way to do so is by creating a pull request and
|
||||||
discuss the changes with others there.
|
discuss the changes with others there.
|
||||||
5. Versioning
|
5. Versioning
|
||||||
1. A "version string" is a typically mostly numeric string that identifies a
|
1. A "version string" is a typically mostly numeric string that identifies a
|
||||||
specific version of a project. The version string itself MUST NOT have a
|
specific version of a project. The version string itself MUST NOT have a
|
||||||
"v" prefix, but the version string can be displayed with a "v" prefix to
|
"v" prefix, but the version string can be displayed with a "v" prefix to
|
||||||
indicate it is a version that is being referred to.
|
indicate it is a version that is being referred to.
|
||||||
2. The source of truth for a project's version MUST be a git tag with a name
|
2. The source of truth for a project's version MUST be a git tag with a name
|
||||||
based on the version string. This kind of tag MUST be referred to as a
|
based on the version string. This kind of tag MUST be referred to as a
|
||||||
"release tag".
|
"release tag".
|
||||||
3. It is OPTIONAL, but RECOMMENDED to also keep the version string
|
3. It is OPTIONAL, but RECOMMENDED to also keep the version string
|
||||||
hard-coded somewhere in the project code-base.
|
hard-coded somewhere in the project code-base.
|
||||||
4. If you hard-code the version string into the code-base, it is RECOMMENDED
|
4. If you hard-code the version string into the code-base, it is RECOMMENDED
|
||||||
that you do so in a file called "VERSION" located in the root of the
|
that you do so in a file called "VERSION" located in the root of the
|
||||||
project. But be mindful of the conventions of your programming language
|
project. But be mindful of the conventions of your programming language
|
||||||
and community when choosing if, where and how to hard-code the version
|
and community when choosing if, where and how to hard-code the version
|
||||||
string.
|
string.
|
||||||
5. If you are using a "VERSION" file in the root of the project, this file
|
5. If you are using a "VERSION" file in the root of the project, this file
|
||||||
MUST only contain the exact version string, meaning it MUST NOT have a
|
MUST only contain the exact version string, meaning it MUST NOT have a
|
||||||
"v" prefix. For example "v2.11.4" is bad, and "2.11.4" is good.
|
"v" prefix. For example "v2.11.4" is bad, and "2.11.4" is good.
|
||||||
6. It is OPTIONAL, but RECOMMENDED that that the version string follows
|
6. It is OPTIONAL, but RECOMMENDED that that the version string follows
|
||||||
Semantic Versioning (<http://semver.org/>).
|
Semantic Versioning (<http://semver.org/>).
|
||||||
6. Releases
|
6. Releases
|
||||||
1. To create a new release, you MUST create a git tag named as the exact
|
1. To create a new release, you MUST create a git tag named as the exact
|
||||||
version string of the release. This kind of tag MUST be referred to as a
|
version string of the release. This kind of tag MUST be referred to as a
|
||||||
"release tag".
|
"release tag".
|
||||||
2. The release tag name can OPTIONALLY be prefixed with "v". For example the
|
2. The release tag name can OPTIONALLY be prefixed with "v". For example the
|
||||||
tag name can be either "2.11.4" or "v2.11.4". It is however RECOMMENDED
|
tag name can be either "2.11.4" or "v2.11.4". It is however RECOMMENDED
|
||||||
that you do not use a "v" prefix. You MUST NOT use a mixture of "v"
|
that you do not use a "v" prefix. You MUST NOT use a mixture of "v"
|
||||||
prefixed and non-prefixed tags. Pick one form and stick to it.
|
prefixed and non-prefixed tags. Pick one form and stick to it.
|
||||||
3. If the version string is hard-coded into the code-base, you MUST create a
|
3. If the version string is hard-coded into the code-base, you MUST create a
|
||||||
"version bump" commit which changes the hard-coded version string of the
|
"version bump" commit which changes the hard-coded version string of the
|
||||||
project.
|
project.
|
||||||
4. When using version bump commits, the release tag MUST be placed on the
|
4. When using version bump commits, the release tag MUST be placed on the
|
||||||
version bump commit.
|
version bump commit.
|
||||||
5. If you are not using a release branch, then the release tag, and if
|
5. If you are not using a release branch, then the release tag, and if
|
||||||
relevant the version bump commit, MUST be created directly on the master
|
relevant the version bump commit, MUST be created directly on the master
|
||||||
branch.
|
branch.
|
||||||
6. The version bump commit SHOULD have a commit message title of "Bump
|
6. The version bump commit SHOULD have a commit message title of "Bump
|
||||||
version to VERSION". For example, if the new version string is "2.11.4",
|
version to VERSION". For example, if the new version string is "2.11.4",
|
||||||
the first line of the commit message SHOULD read: "Bump version to
|
the first line of the commit message SHOULD read: "Bump version to
|
||||||
2.11.4"
|
2.11.4"
|
||||||
7. It is RECOMMENDED that release tags are lightweight tags, but you can
|
7. It is RECOMMENDED that release tags are lightweight tags, but you can
|
||||||
OPTIONALLY use annotated tags if you want to include changelog
|
OPTIONALLY use annotated tags if you want to include changelog
|
||||||
information in the release tag itself.
|
information in the release tag itself.
|
||||||
8. If you use annotated release tags, the first line of the annotation
|
8. If you use annotated release tags, the first line of the annotation
|
||||||
SHOULD read "Release VERSION". For example for version "2.11.4" the first
|
SHOULD read "Release VERSION". For example for version "2.11.4" the first
|
||||||
line of the tag annotation SHOULD read "Release 2.11.4". The second line
|
line of the tag annotation SHOULD read "Release 2.11.4". The second line
|
||||||
MUST be blank, and the changelog MUST start on the third line.
|
MUST be blank, and the changelog MUST start on the third line.
|
||||||
7. Short-Term Release Branches
|
7. Short-Term Release Branches
|
||||||
1. Any branch that has a name starting with "release-" SHOULD be referred to
|
1. Any branch that has a name starting with "release-" SHOULD be referred to
|
||||||
as a "release branch".
|
as a "release branch".
|
||||||
2. Any release branch which has a name ending with a specific version
|
2. Any release branch which has a name ending with a specific version
|
||||||
string, MUST be referred to as a "short-term release branch".
|
string, MUST be referred to as a "short-term release branch".
|
||||||
3. Use of short-term release branches are OPTIONAL, and intended to be used
|
3. Use of short-term release branches are OPTIONAL, and intended to be used
|
||||||
to create a specific versioned release.
|
to create a specific versioned release.
|
||||||
4. A short-term release branch is RECOMMENDED if there is a lengthy
|
4. A short-term release branch is RECOMMENDED if there is a lengthy
|
||||||
pre-release verification process to avoid a code freeze on the master
|
pre-release verification process to avoid a code freeze on the master
|
||||||
branch.
|
branch.
|
||||||
5. Short-term release branches MUST have a name of "release-VERSION". For
|
5. Short-term release branches MUST have a name of "release-VERSION". For
|
||||||
example for version "2.11.4" the release branch name MUST be
|
example for version "2.11.4" the release branch name MUST be
|
||||||
"release-2.11.4".
|
"release-2.11.4".
|
||||||
6. When using a short-term release branch to create a release, the release
|
6. When using a short-term release branch to create a release, the release
|
||||||
tag and if used, version bump commit, MUST be placed directly on the
|
tag and if used, version bump commit, MUST be placed directly on the
|
||||||
short-term release branch itself.
|
short-term release branch itself.
|
||||||
7. Only very minor changes should be performed on a short-term release
|
7. Only very minor changes should be performed on a short-term release
|
||||||
branch directly. Any larger changes SHOULD be done in the master branch,
|
branch directly. Any larger changes SHOULD be done in the master branch,
|
||||||
and SHOULD be pulled into the release branch by rebasing it on top of the
|
and SHOULD be pulled into the release branch by rebasing it on top of the
|
||||||
master branch the same way a change branch pulls in updates from its
|
master branch the same way a change branch pulls in updates from its
|
||||||
source branch.
|
source branch.
|
||||||
8. After a release tag has been created, the release branch MUST be merged
|
8. After a release tag has been created, the release branch MUST be merged
|
||||||
back into its source branch and then deleted. Typically the source branch
|
back into its source branch and then deleted. Typically the source branch
|
||||||
will be the master branch.
|
will be the master branch.
|
||||||
8. Long-term Release Branches
|
8. Long-term Release Branches
|
||||||
1. Any release branch which has a name ending with a non-specific version
|
1. Any release branch which has a name ending with a non-specific version
|
||||||
string, MUST be referred to as a "long-term release branch". For example
|
string, MUST be referred to as a "long-term release branch". For example
|
||||||
"release-2.11" is a long-term release branch, while "release-2.11.4" is a
|
"release-2.11" is a long-term release branch, while "release-2.11.4" is a
|
||||||
short-term release branch.
|
short-term release branch.
|
||||||
2. Use of long-term release branches are OPTIONAL, and intended for work on
|
2. Use of long-term release branches are OPTIONAL, and intended for work on
|
||||||
versions which are not currently part of the master branch. Typically
|
versions which are not currently part of the master branch. Typically
|
||||||
this is useful when you need to create a new maintenance release for a
|
this is useful when you need to create a new maintenance release for a
|
||||||
older version.
|
older version.
|
||||||
3. A long-term release branch MUST have a name with a non-specific version
|
3. A long-term release branch MUST have a name with a non-specific version
|
||||||
number. For example a long-term release branch for creating new 2.9.x
|
number. For example a long-term release branch for creating new 2.9.x
|
||||||
releases MUST be named "release-2.9".
|
releases MUST be named "release-2.9".
|
||||||
4. Long-term release branches for maintenance releases of older versions
|
4. Long-term release branches for maintenance releases of older versions
|
||||||
MUST be created from the relevant release tag. For example if the master
|
MUST be created from the relevant release tag. For example if the master
|
||||||
branch is on version 2.11.4 and there is a security fix for all 2.9.x
|
branch is on version 2.11.4 and there is a security fix for all 2.9.x
|
||||||
releases, the latest of which is "2.9.7". Create a new branch called
|
releases, the latest of which is "2.9.7". Create a new branch called
|
||||||
"release-2.9" off of the "2.9.7" release tag. The security fix release
|
"release-2.9" off of the "2.9.7" release tag. The security fix release
|
||||||
will then end up being version "2.9.8".
|
will then end up being version "2.9.8".
|
||||||
5. To create a new release from a long-term release branch, you MUST follow
|
5. To create a new release from a long-term release branch, you MUST follow
|
||||||
the same process as a release from the master branch, except the
|
the same process as a release from the master branch, except the
|
||||||
long-term release branch takes the place of the master branch.
|
long-term release branch takes the place of the master branch.
|
||||||
6. A long-term release branch should be treated with the same respect as the
|
7. A long-term release branch should be treated with the same respect as the
|
||||||
master branch. It is effectively the master branch for the release series
|
master branch. It is effectively the master branch for the release series
|
||||||
in question. Meaning it MUST always be in a non-broken state, MUST NOT be
|
in question. Meaning it MUST always be in a non-broken state, MUST NOT be
|
||||||
force pushed to, etc.
|
force pushed to, etc.
|
||||||
9. Bug Fixes & Rollback
|
9. Bug Fixes & Rollback
|
||||||
1. You MUST NOT under any circumstances force push to the master branch or
|
1. You MUST NOT under any circumstances force push to the master branch or
|
||||||
to long-term release branches.
|
to long-term release branches.
|
||||||
2. If a change branch which has been merged into the master branch is found
|
2. If a change branch which has been merged into the master branch is found
|
||||||
to have a bug in it, the bug fix work MUST be done as a new separate
|
to have a bug in it, the bug fix work MUST be done as a new separate
|
||||||
change branch and MUST follow the same workflow as any other change
|
change branch and MUST follow the same workflow as any other change
|
||||||
branch.
|
branch.
|
||||||
3. If a change branch is wrongfully merged into master, or for any other
|
3. If a change branch is wrongfully merged into master, or for any other
|
||||||
reason the merge must be undone, you MUST undo the merge by reverting the
|
reason the merge must be undone, you MUST undo the merge by reverting the
|
||||||
merge commit itself. Effectively creating a new commit that reverses all
|
merge commit itself. Effectively creating a new commit that reverses all
|
||||||
the relevant changes.
|
the relevant changes.
|
||||||
10. Git Best Practices
|
10. Git Best Practices
|
||||||
1. All commit messages SHOULD follow the Commit Guidelines and format from
|
1. All commit messages SHOULD follow the Commit Guidelines and format from
|
||||||
the official git
|
the official git
|
||||||
@@ -238,7 +239,8 @@ interpreted as described in [RFC 2119](https://tools.ietf.org/html/rfc2119).
|
|||||||
and creates a merge commit to mark the integration of the branch with
|
and creates a merge commit to mark the integration of the branch with
|
||||||
master.
|
master.
|
||||||
|
|
||||||
## FAQ
|
FAQ
|
||||||
|
---
|
||||||
|
|
||||||
### Why use Common-Flow instead of Git Flow, and how does it differ?
|
### Why use Common-Flow instead of Git Flow, and how does it differ?
|
||||||
|
|
||||||
@@ -321,7 +323,8 @@ complicated task and you're short on time, a short-term release branch gives you
|
|||||||
a instant fix to the situation at hand, and let's you resolve the issues with
|
a instant fix to the situation at hand, and let's you resolve the issues with
|
||||||
the master branch when you have more time on your hands.
|
the master branch when you have more time on your hands.
|
||||||
|
|
||||||
## About
|
About
|
||||||
|
-----
|
||||||
|
|
||||||
The Git Common-Flow specification is authored
|
The Git Common-Flow specification is authored
|
||||||
by [Jim Myhrberg](http://jimeh.me).
|
by [Jim Myhrberg](http://jimeh.me).
|
||||||
@@ -329,6 +332,7 @@ by [Jim Myhrberg](http://jimeh.me).
|
|||||||
If you'd like to leave feedback,
|
If you'd like to leave feedback,
|
||||||
please [open an issue on GitHub](https://github.com/jimeh/common-flow/issues).
|
please [open an issue on GitHub](https://github.com/jimeh/common-flow/issues).
|
||||||
|
|
||||||
## License
|
License
|
||||||
|
-------
|
||||||
|
|
||||||
[Creative Commons - CC BY 3.0](http://creativecommons.org/licenses/by/3.0/)
|
[Creative Commons - CC BY 3.0](http://creativecommons.org/licenses/by/3.0/)
|
||||||
|
|||||||
1
src/content/spec/1.0.0-rc.4.svg
Normal file
|
After Width: | Height: | Size: 13 KiB |
@@ -1,13 +1,12 @@
|
|||||||
---
|
---
|
||||||
title: Git Common-Flow 1.0.0-rc.5
|
title: Git Common-Flow v1.0.0-rc.5
|
||||||
version: 1.0.0-rc.5
|
version: 1.0.0-rc.5
|
||||||
---
|
---
|
||||||
|
Git Common-Flow v1.0.0-rc.5
|
||||||
|
===========================
|
||||||
|
|
||||||
# Git Common-Flow 1.0.0-rc.5
|
Introduction
|
||||||
|
------------
|
||||||
<img src="/spec/1.0.0-rc.5.svg" alt="Git Common-Flow 1.0.0-rc.5 diagram" width="100%" />
|
|
||||||
|
|
||||||
## Introduction
|
|
||||||
|
|
||||||
Common-Flow is an attempt to gather a sensible selection of the most common
|
Common-Flow is an attempt to gather a sensible selection of the most common
|
||||||
usage patterns of git into a single and concise specification. It is based on
|
usage patterns of git into a single and concise specification. It is based on
|
||||||
@@ -19,7 +18,8 @@ In short, Common-Flow is essentially GitHub Flow with the addition of versioned
|
|||||||
releases, optional release branches, and without the requirement to deploy to
|
releases, optional release branches, and without the requirement to deploy to
|
||||||
production all the time.
|
production all the time.
|
||||||
|
|
||||||
## Summary
|
Summary
|
||||||
|
-------
|
||||||
|
|
||||||
- The "master" branch is the mainline branch with latest changes, and must not
|
- The "master" branch is the mainline branch with latest changes, and must not
|
||||||
be broken.
|
be broken.
|
||||||
@@ -32,7 +32,8 @@ production all the time.
|
|||||||
- Release branches can be used to avoid change freezes on master. They are not
|
- Release branches can be used to avoid change freezes on master. They are not
|
||||||
required, instead they are available if you need them.
|
required, instead they are available if you need them.
|
||||||
|
|
||||||
## Terminology
|
Terminology
|
||||||
|
-----------
|
||||||
|
|
||||||
- **Master Branch** - Must be named "master", must always have passing tests,
|
- **Master Branch** - Must be named "master", must always have passing tests,
|
||||||
and is not guaranteed to always work in production environments.
|
and is not guaranteed to always work in production environments.
|
||||||
@@ -51,183 +52,184 @@ production all the time.
|
|||||||
- **Release Branches** - Used both for short-term preparations of a release, and
|
- **Release Branches** - Used both for short-term preparations of a release, and
|
||||||
also for long-term maintenance of older version.
|
also for long-term maintenance of older version.
|
||||||
|
|
||||||
## Git Common-Flow Specification (Common-Flow)
|
Git Common-Flow Specification (Common-Flow)
|
||||||
|
-------------------------------------------
|
||||||
|
|
||||||
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD",
|
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD",
|
||||||
"SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be
|
"SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be
|
||||||
interpreted as described in [RFC 2119](https://tools.ietf.org/html/rfc2119).
|
interpreted as described in [RFC 2119](https://tools.ietf.org/html/rfc2119).
|
||||||
|
|
||||||
1. TL;DR
|
1. TL;DR
|
||||||
1. Do not break the master branch.
|
1. Do not break the master branch.
|
||||||
2. A release is a git tag.
|
2. A release is a git tag.
|
||||||
2. The Master Branch
|
2. The Master Branch
|
||||||
1. A branch named "master" MUST exist and it MUST be referred to as the
|
1. A branch named "master" MUST exist and it MUST be referred to as the
|
||||||
"master branch".
|
"master branch".
|
||||||
2. The master branch MUST always be in a non-broken state with its test
|
2. The master branch MUST always be in a non-broken state with its test
|
||||||
suite passing.
|
suite passing.
|
||||||
3. The master branch IS NOT guaranteed to always work in production
|
4. The master branch IS NOT guaranteed to always work in production
|
||||||
environments. Despite test suites passing it may at times contain
|
environments. Despite test suites passing it may at times contain
|
||||||
unfinished work. Only releases may be considered safe for production use.
|
unfinished work. Only releases may be considered safe for production use.
|
||||||
4. The master branch SHOULD always be in a "as near as possibly ready for
|
5. The master branch SHOULD always be in a "as near as possibly ready for
|
||||||
release/production" state to reduce any friction with creating a new
|
release/production" state to reduce any friction with creating a new
|
||||||
release.
|
release.
|
||||||
3. Change Branches
|
3. Change Branches
|
||||||
1. Each change (feature, bugfix, etc.) MUST be performed on separate
|
1. Each change (feature, bugfix, etc.) MUST be performed on separate
|
||||||
branches that SHOULD be referred to as "change branches".
|
branches that SHOULD be referred to as "change branches".
|
||||||
2. All change branches MUST have descriptive names.
|
2. All change branches MUST have descriptive names.
|
||||||
3. It is RECOMMENDED that you commit often locally, and that you try and
|
3. It is RECOMMENDED that you commit often locally, and that you try and
|
||||||
keep the commits reasonably structured to avoid a messy and confusing git
|
keep the commits reasonably structured to avoid a messy and confusing git
|
||||||
history.
|
history.
|
||||||
4. You SHOULD regularly push your work to the same named branch on the
|
4. You SHOULD regularly push your work to the same named branch on the
|
||||||
remote server.
|
remote server.
|
||||||
5. You SHOULD create separate change branches for each distinctly different
|
5. You SHOULD create separate change branches for each distinctly different
|
||||||
change. You SHOULD NOT include multiple unrelated changes into a single
|
change. You SHOULD NOT include multiple unrelated changes into a single
|
||||||
change branch.
|
change branch.
|
||||||
6. When a change branch is created, the branch that it is created from
|
6. When a change branch is created, the branch that it is created from
|
||||||
SHOULD be referred to as the "source branch". Each change branch also
|
SHOULD be referred to as the "source branch". Each change branch also
|
||||||
needs a designated "merge target" branch, typically this will be the same
|
needs a designated "merge target" branch, typically this will be the same
|
||||||
as the source branch.
|
as the source branch.
|
||||||
7. Change branches MUST be regularly updated with any changes from their
|
7. Change branches MUST be regularly updated with any changes from their
|
||||||
source branch. This MUST be done by rebasing the change branch on top of
|
source branch. This MUST be done by rebasing the change branch on top of
|
||||||
the source branch.
|
the source branch.
|
||||||
8. After updating a change branch from its source branch you MUST push the
|
8. After updating a change branch from its source branch you MUST push the
|
||||||
change branch to the remote server. Due to the nature of rebasing, you
|
change branch to the remote server. Due to the nature of rebasing, you
|
||||||
will be required to do a force push, and you MUST use the
|
will be required to do a force push, and you MUST use the
|
||||||
"--force-with-lease" git push option when doing so instead of the regular
|
"--force-with-lease" git push option when doing so instead of the regular
|
||||||
"--force".
|
"--force".
|
||||||
9. If there is a truly valid technical reason to not use rebase when
|
9. If there is a truly valid technical reason to not use rebase when
|
||||||
updating change branches, then you can update change branches via merge
|
updating change branches, then you can update change branches via merge
|
||||||
instead of rebase. The decision to use merge MUST only be taken after all
|
instead of rebase. The decision to use merge MUST only be taken after all
|
||||||
possible options to use rebase have been tried and failed. People not
|
possible options to use rebase have been tried and failed. People not
|
||||||
understanding how to use rebase is NOT a valid reason to use merge. If
|
understanding how to use rebase is NOT a valid reason to use merge. If
|
||||||
you do decide to use merge instead of rebase, you MUST NOT use a mixture
|
you do decide to use merge instead of rebase, you MUST NOT use a mixture
|
||||||
of both methods, pick one and stick to it.
|
of both methods, pick one and stick to it.
|
||||||
4. Pull Requests
|
4. Pull Requests
|
||||||
1. To merge a change branch into its merge target, you MUST open a "pull
|
1. To merge a change branch into its merge target, you MUST open a "pull
|
||||||
request" (or equivalent).
|
request" (or equivalent).
|
||||||
2. The purpose of a pull request is to allow others to review your changes
|
2. The purpose of a pull request is to allow others to review your changes
|
||||||
and give feedback. You can then fix any issues, complaints, and more that
|
and give feedback. You can then fix any issues, complaints, and more that
|
||||||
might arise, and then let people review again.
|
might arise, and then let people review again.
|
||||||
3. Before creating a pull request, it is RECOMMENDED that you consider the
|
3. Before creating a pull request, it is RECOMMENDED that you consider the
|
||||||
state of your change branch's commit history. If it is messy and
|
state of your change branch's commit history. If it is messy and
|
||||||
confusing, it might be a good idea to rebase your branch with "git rebase
|
confusing, it might be a good idea to rebase your branch with "git rebase
|
||||||
-i" to present a cleaner and easier to follow commit history for your
|
-i" to present a cleaner and easier to follow commit history for your
|
||||||
reviewers.
|
reviewers.
|
||||||
4. A pull request MUST only be merged when the change branch is up-to-date
|
4. A pull request MUST only be merged when the change branch is up-to-date
|
||||||
with its source branch, the test suite is passing, and you and others are
|
with its source branch, the test suite is passing, and you and others are
|
||||||
happy with the change. This is especially important if the merge target
|
happy with the change. This is especially important if the merge target
|
||||||
is the master branch.
|
is the master branch.
|
||||||
5. To get feedback, help, or generally just discuss a change branch with
|
5. To get feedback, help, or generally just discuss a change branch with
|
||||||
others, it is RECOMMENDED you create a pull request and discuss the
|
others, it is RECOMMENDED you create a pull request and discuss the
|
||||||
changes with others there. This leaves a clear and visible history of
|
changes with others there. This leaves a clear and visible history of
|
||||||
how, when, and why the code looks and behaves the way it does.
|
how, when, and why the code looks and behaves the way it does.
|
||||||
5. Versioning
|
5. Versioning
|
||||||
1. A "version string" is a typically mostly numeric string that identifies a
|
1. A "version string" is a typically mostly numeric string that identifies a
|
||||||
specific version of a project. The version string itself MUST NOT have a
|
specific version of a project. The version string itself MUST NOT have a
|
||||||
"v" prefix, but the version string can be displayed with a "v" prefix to
|
"v" prefix, but the version string can be displayed with a "v" prefix to
|
||||||
indicate it is a version that is being referred to.
|
indicate it is a version that is being referred to.
|
||||||
2. The source of truth for a project's version MUST be a git tag with a name
|
2. The source of truth for a project's version MUST be a git tag with a name
|
||||||
based on the version string. This kind of tag MUST be referred to as a
|
based on the version string. This kind of tag MUST be referred to as a
|
||||||
"release tag".
|
"release tag".
|
||||||
3. It is OPTIONAL, but RECOMMENDED to also keep the version string
|
3. It is OPTIONAL, but RECOMMENDED to also keep the version string
|
||||||
hard-coded somewhere in the project code-base.
|
hard-coded somewhere in the project code-base.
|
||||||
4. If you hard-code the version string into the code-base, it is RECOMMENDED
|
4. If you hard-code the version string into the code-base, it is RECOMMENDED
|
||||||
that you do so in a file called "VERSION" located in the root of the
|
that you do so in a file called "VERSION" located in the root of the
|
||||||
project. But be mindful of the conventions of your programming language
|
project. But be mindful of the conventions of your programming language
|
||||||
and community when choosing if, where and how to hard-code the version
|
and community when choosing if, where and how to hard-code the version
|
||||||
string.
|
string.
|
||||||
5. If you are using a "VERSION" file in the root of the project, this file
|
5. If you are using a "VERSION" file in the root of the project, this file
|
||||||
MUST only contain the exact version string, meaning it MUST NOT have a
|
MUST only contain the exact version string, meaning it MUST NOT have a
|
||||||
"v" prefix. For example "v2.11.4" is bad, and "2.11.4" is good.
|
"v" prefix. For example "v2.11.4" is bad, and "2.11.4" is good.
|
||||||
6. It is OPTIONAL, but RECOMMENDED that that the version string follows
|
6. It is OPTIONAL, but RECOMMENDED that that the version string follows
|
||||||
Semantic Versioning (<http://semver.org/>).
|
Semantic Versioning (<http://semver.org/>).
|
||||||
6. Releases
|
6. Releases
|
||||||
1. To create a new release, you MUST create a git tag named as the exact
|
1. To create a new release, you MUST create a git tag named as the exact
|
||||||
version string of the release. This kind of tag MUST be referred to as a
|
version string of the release. This kind of tag MUST be referred to as a
|
||||||
"release tag".
|
"release tag".
|
||||||
2. The release tag name can OPTIONALLY be prefixed with "v". For example the
|
2. The release tag name can OPTIONALLY be prefixed with "v". For example the
|
||||||
tag name can be either "2.11.4" or "v2.11.4". It is however RECOMMENDED
|
tag name can be either "2.11.4" or "v2.11.4". It is however RECOMMENDED
|
||||||
that you do not use a "v" prefix. You MUST NOT use a mixture of "v"
|
that you do not use a "v" prefix. You MUST NOT use a mixture of "v"
|
||||||
prefixed and non-prefixed tags. Pick one form and stick to it.
|
prefixed and non-prefixed tags. Pick one form and stick to it.
|
||||||
3. If the version string is hard-coded into the code-base, you MUST create a
|
3. If the version string is hard-coded into the code-base, you MUST create a
|
||||||
"version bump" commit which changes the hard-coded version string of the
|
"version bump" commit which changes the hard-coded version string of the
|
||||||
project.
|
project.
|
||||||
4. When using version bump commits, the release tag MUST be placed on the
|
4. When using version bump commits, the release tag MUST be placed on the
|
||||||
version bump commit.
|
version bump commit.
|
||||||
5. If you are not using a release branch, then the release tag, and if
|
5. If you are not using a release branch, then the release tag, and if
|
||||||
relevant the version bump commit, MUST be created directly on the master
|
relevant the version bump commit, MUST be created directly on the master
|
||||||
branch.
|
branch.
|
||||||
6. The version bump commit SHOULD have a commit message title of "Bump
|
6. The version bump commit SHOULD have a commit message title of "Bump
|
||||||
version to VERSION". For example, if the new version string is "2.11.4",
|
version to VERSION". For example, if the new version string is "2.11.4",
|
||||||
the first line of the commit message SHOULD read: "Bump version to
|
the first line of the commit message SHOULD read: "Bump version to
|
||||||
2.11.4"
|
2.11.4"
|
||||||
7. It is RECOMMENDED that release tags are lightweight tags, but you can
|
7. It is RECOMMENDED that release tags are lightweight tags, but you can
|
||||||
OPTIONALLY use annotated tags if you want to include changelog
|
OPTIONALLY use annotated tags if you want to include changelog
|
||||||
information in the release tag itself.
|
information in the release tag itself.
|
||||||
8. If you use annotated release tags, the first line of the annotation
|
8. If you use annotated release tags, the first line of the annotation
|
||||||
SHOULD read "Release VERSION". For example for version "2.11.4" the first
|
SHOULD read "Release VERSION". For example for version "2.11.4" the first
|
||||||
line of the tag annotation SHOULD read "Release 2.11.4". The second line
|
line of the tag annotation SHOULD read "Release 2.11.4". The second line
|
||||||
MUST be blank, and the changelog MUST start on the third line.
|
MUST be blank, and the changelog MUST start on the third line.
|
||||||
7. Short-Term Release Branches
|
7. Short-Term Release Branches
|
||||||
1. Any branch that has a name starting with "release-" SHOULD be referred to
|
1. Any branch that has a name starting with "release-" SHOULD be referred to
|
||||||
as a "release branch".
|
as a "release branch".
|
||||||
2. Any release branch which has a name ending with a specific version
|
2. Any release branch which has a name ending with a specific version
|
||||||
string, MUST be referred to as a "short-term release branch".
|
string, MUST be referred to as a "short-term release branch".
|
||||||
3. Use of short-term release branches are OPTIONAL, and intended to be used
|
3. Use of short-term release branches are OPTIONAL, and intended to be used
|
||||||
to create a specific versioned release.
|
to create a specific versioned release.
|
||||||
4. A short-term release branch is RECOMMENDED if there is a lengthy
|
4. A short-term release branch is RECOMMENDED if there is a lengthy
|
||||||
pre-release verification process to avoid a code freeze on the master
|
pre-release verification process to avoid a code freeze on the master
|
||||||
branch.
|
branch.
|
||||||
5. Short-term release branches MUST have a name of "release-VERSION". For
|
5. Short-term release branches MUST have a name of "release-VERSION". For
|
||||||
example for version "2.11.4" the release branch name MUST be
|
example for version "2.11.4" the release branch name MUST be
|
||||||
"release-2.11.4".
|
"release-2.11.4".
|
||||||
6. When using a short-term release branch to create a release, the release
|
6. When using a short-term release branch to create a release, the release
|
||||||
tag and if used, version bump commit, MUST be placed directly on the
|
tag and if used, version bump commit, MUST be placed directly on the
|
||||||
short-term release branch itself.
|
short-term release branch itself.
|
||||||
7. Only very minor changes should be performed on a short-term release
|
7. Only very minor changes should be performed on a short-term release
|
||||||
branch directly. Any larger changes SHOULD be done in the master branch,
|
branch directly. Any larger changes SHOULD be done in the master branch,
|
||||||
and SHOULD be pulled into the release branch by rebasing it on top of the
|
and SHOULD be pulled into the release branch by rebasing it on top of the
|
||||||
master branch the same way a change branch pulls in updates from its
|
master branch the same way a change branch pulls in updates from its
|
||||||
source branch.
|
source branch.
|
||||||
8. After a release tag has been created, the release branch MUST be merged
|
8. After a release tag has been created, the release branch MUST be merged
|
||||||
back into its source branch and then deleted. Typically the source branch
|
back into its source branch and then deleted. Typically the source branch
|
||||||
will be the master branch.
|
will be the master branch.
|
||||||
8. Long-term Release Branches
|
8. Long-term Release Branches
|
||||||
1. Any release branch which has a name ending with a non-specific version
|
1. Any release branch which has a name ending with a non-specific version
|
||||||
string, MUST be referred to as a "long-term release branch". For example
|
string, MUST be referred to as a "long-term release branch". For example
|
||||||
"release-2.11" is a long-term release branch, while "release-2.11.4" is a
|
"release-2.11" is a long-term release branch, while "release-2.11.4" is a
|
||||||
short-term release branch.
|
short-term release branch.
|
||||||
2. Use of long-term release branches are OPTIONAL, and intended for work on
|
2. Use of long-term release branches are OPTIONAL, and intended for work on
|
||||||
versions which are not currently part of the master branch. Typically
|
versions which are not currently part of the master branch. Typically
|
||||||
this is useful when you need to create a new maintenance release for a
|
this is useful when you need to create a new maintenance release for a
|
||||||
older version.
|
older version.
|
||||||
3. A long-term release branch MUST have a name with a non-specific version
|
3. A long-term release branch MUST have a name with a non-specific version
|
||||||
number. For example a long-term release branch for creating new 2.9.x
|
number. For example a long-term release branch for creating new 2.9.x
|
||||||
releases MUST be named "release-2.9".
|
releases MUST be named "release-2.9".
|
||||||
4. Long-term release branches for maintenance releases of older versions
|
4. Long-term release branches for maintenance releases of older versions
|
||||||
MUST be created from the relevant release tag. For example if the master
|
MUST be created from the relevant release tag. For example if the master
|
||||||
branch is on version 2.11.4 and there is a security fix for all 2.9.x
|
branch is on version 2.11.4 and there is a security fix for all 2.9.x
|
||||||
releases, the latest of which is "2.9.7". Create a new branch called
|
releases, the latest of which is "2.9.7". Create a new branch called
|
||||||
"release-2.9" from the "2.9.7" release tag. The security fix release will
|
"release-2.9" from the "2.9.7" release tag. The security fix release will
|
||||||
then end up being version "2.9.8".
|
then end up being version "2.9.8".
|
||||||
5. To create a new release from a long-term release branch, you MUST follow
|
5. To create a new release from a long-term release branch, you MUST follow
|
||||||
the same process as a release from the master branch, except the
|
the same process as a release from the master branch, except the
|
||||||
long-term release branch takes the place of the master branch.
|
long-term release branch takes the place of the master branch.
|
||||||
6. A long-term release branch should be treated with the same respect as the
|
7. A long-term release branch should be treated with the same respect as the
|
||||||
master branch. It is effectively the master branch for the release series
|
master branch. It is effectively the master branch for the release series
|
||||||
in question. Meaning it MUST always be in a non-broken state, MUST NOT be
|
in question. Meaning it MUST always be in a non-broken state, MUST NOT be
|
||||||
force pushed to, etc.
|
force pushed to, etc.
|
||||||
9. Bug Fixes & Rollback
|
9. Bug Fixes & Rollback
|
||||||
1. You MUST NOT under any circumstances force push to the master branch or
|
1. You MUST NOT under any circumstances force push to the master branch or
|
||||||
to long-term release branches.
|
to long-term release branches.
|
||||||
2. If a change branch which has been merged into the master branch is found
|
2. If a change branch which has been merged into the master branch is found
|
||||||
to have a bug in it, the bug fix work MUST be done as a new separate
|
to have a bug in it, the bug fix work MUST be done as a new separate
|
||||||
change branch and MUST follow the same workflow as any other change
|
change branch and MUST follow the same workflow as any other change
|
||||||
branch.
|
branch.
|
||||||
3. If a change branch is wrongfully merged into master, or for any other
|
3. If a change branch is wrongfully merged into master, or for any other
|
||||||
reason the merge must be undone, you MUST undo the merge by reverting the
|
reason the merge must be undone, you MUST undo the merge by reverting the
|
||||||
merge commit itself. Effectively creating a new commit that reverses all
|
merge commit itself. Effectively creating a new commit that reverses all
|
||||||
the relevant changes.
|
the relevant changes.
|
||||||
10. Git Best Practices
|
10. Git Best Practices
|
||||||
1. All commit messages SHOULD follow the Commit Guidelines and format from
|
1. All commit messages SHOULD follow the Commit Guidelines and format from
|
||||||
the official git
|
the official git
|
||||||
@@ -252,7 +254,8 @@ interpreted as described in [RFC 2119](https://tools.ietf.org/html/rfc2119).
|
|||||||
and creates a merge commit to mark the integration of the branch with
|
and creates a merge commit to mark the integration of the branch with
|
||||||
master.
|
master.
|
||||||
|
|
||||||
## FAQ
|
FAQ
|
||||||
|
---
|
||||||
|
|
||||||
### Why use Common-Flow instead of Git Flow, and how does it differ?
|
### Why use Common-Flow instead of Git Flow, and how does it differ?
|
||||||
|
|
||||||
@@ -341,7 +344,8 @@ complicated task and you're short on time, a short-term release branch gives you
|
|||||||
a instant fix to the situation at hand, and let's you resolve the issues with
|
a instant fix to the situation at hand, and let's you resolve the issues with
|
||||||
the master branch when you have more time on your hands.
|
the master branch when you have more time on your hands.
|
||||||
|
|
||||||
## About
|
About
|
||||||
|
-----
|
||||||
|
|
||||||
The Git Common-Flow specification is authored
|
The Git Common-Flow specification is authored
|
||||||
by [Jim Myhrberg](https://jimeh.me/).
|
by [Jim Myhrberg](https://jimeh.me/).
|
||||||
@@ -349,6 +353,7 @@ by [Jim Myhrberg](https://jimeh.me/).
|
|||||||
If you'd like to leave feedback,
|
If you'd like to leave feedback,
|
||||||
please [open an issue on GitHub](https://github.com/jimeh/common-flow/issues).
|
please [open an issue on GitHub](https://github.com/jimeh/common-flow/issues).
|
||||||
|
|
||||||
## License
|
License
|
||||||
|
-------
|
||||||
|
|
||||||
[Creative Commons - CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)
|
[Creative Commons - CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)
|
||||||
|
|||||||
1
src/content/spec/1.0.0-rc.5.svg
Normal file
|
After Width: | Height: | Size: 13 KiB |
380
src/content/spec/2.0.0.md
Normal file
@@ -0,0 +1,380 @@
|
|||||||
|
---
|
||||||
|
title: Git Common-Flow v2.0.0
|
||||||
|
version: 2.0.0
|
||||||
|
---
|
||||||
|
# Git Common-Flow v2.0.0
|
||||||
|
|
||||||
|
## Introduction
|
||||||
|
|
||||||
|
Common-Flow is an attempt to gather a sensible selection of the most common
|
||||||
|
usage patterns of git into a single and concise specification. It is based on
|
||||||
|
the [original variant](https://scottchacon.com/2011/08/31/github-flow/) of
|
||||||
|
[GitHub Flow](https://docs.github.com/en/get-started/using-github/github-flow),
|
||||||
|
while taking into account how a lot of open source projects most commonly use
|
||||||
|
git.
|
||||||
|
|
||||||
|
In short, Common-Flow is essentially GitHub Flow with the addition of versioned
|
||||||
|
releases, optional release branches, and without the requirement to deploy to
|
||||||
|
production all the time.
|
||||||
|
|
||||||
|
## Summary
|
||||||
|
|
||||||
|
- The "main" branch is the mainline branch with latest changes, and must not be
|
||||||
|
broken.
|
||||||
|
- Changes (features, bugfixes, etc.) are done on "change branches" created from
|
||||||
|
the main branch.
|
||||||
|
- Rebase change branches early and often.
|
||||||
|
- When a change branch is stable and ready, it is merged back in to main.
|
||||||
|
- A release is just a git tag who's name is the exact release version string
|
||||||
|
(e.g. "2.11.4" or "v2.11.4").
|
||||||
|
- Release branches can be used when the release process and verification might
|
||||||
|
be lengthy, allowing main to remain open for new changes. They are not
|
||||||
|
required, instead they are available if you need them.
|
||||||
|
|
||||||
|
## Terminology
|
||||||
|
|
||||||
|
- **Main Branch** - Must be named "main", must always have passing tests, and is
|
||||||
|
not guaranteed to always work in production environments.
|
||||||
|
- **Change Branches** - Any branch that introduces changes like a new feature, a
|
||||||
|
bugfix, etc.
|
||||||
|
- **Source Branch** - The branch that a change branch was created from. New
|
||||||
|
changes in the source branch should be incorporated into the change branch via
|
||||||
|
rebasing.
|
||||||
|
- **Merge Target** - A branch that is the intended merge target for a change
|
||||||
|
branch. Typically the merge target branch will be the same as the source
|
||||||
|
branch.
|
||||||
|
- **Pull Request** - A means of requesting that a change branch is merged in to
|
||||||
|
its merge target, allowing others to review, discuss and approve the changes.
|
||||||
|
- **Release** - May be considered safe to use in production environments. Is
|
||||||
|
effectively just a git tag named after the version of the release.
|
||||||
|
- **Release Branches** - Used both for short-term preparations of a release, and
|
||||||
|
for long-term maintenance of older versions.
|
||||||
|
|
||||||
|
## Git Common-Flow Specification (Common-Flow)
|
||||||
|
|
||||||
|
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD",
|
||||||
|
"SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be
|
||||||
|
interpreted as described in [RFC
|
||||||
|
2119](https://datatracker.ietf.org/doc/html/rfc2119).
|
||||||
|
|
||||||
|
1. TL;DR
|
||||||
|
1. Do not break the main branch.
|
||||||
|
2. A release is a git tag.
|
||||||
|
2. The Main Branch
|
||||||
|
1. A branch named "main" MUST exist and it MUST be referred to as the "main
|
||||||
|
branch".
|
||||||
|
2. The main branch MUST always be in a non-broken state with its test suite
|
||||||
|
passing.
|
||||||
|
3. The main branch is not guaranteed to always work in production
|
||||||
|
environments. Despite test suites passing it may at times contain
|
||||||
|
unfinished work. Only releases may be considered safe for production use.
|
||||||
|
4. The main branch SHOULD always be in a "as near as possibly ready for
|
||||||
|
release/production" state to reduce any friction with creating a new
|
||||||
|
release.
|
||||||
|
3. Change Branches
|
||||||
|
1. Each change (feature, bugfix, etc.) MUST be performed on separate
|
||||||
|
branches that SHOULD be referred to as "change branches".
|
||||||
|
2. All change branches MUST have descriptive names.
|
||||||
|
3. It is RECOMMENDED that you commit often locally, and that you try and
|
||||||
|
keep the commits reasonably structured to avoid a messy and confusing git
|
||||||
|
history.
|
||||||
|
4. You SHOULD regularly push your work to the same named branch on the
|
||||||
|
remote server.
|
||||||
|
5. You SHOULD create separate change branches for each distinctly different
|
||||||
|
change. You SHOULD NOT include multiple unrelated changes into a single
|
||||||
|
change branch.
|
||||||
|
6. When a change branch is created, the branch that it is created from
|
||||||
|
SHOULD be referred to as the "source branch". Each change branch also
|
||||||
|
needs a designated "merge target" branch, typically this will be the same
|
||||||
|
as the source branch.
|
||||||
|
7. Change branches MUST be regularly updated with any changes from their
|
||||||
|
source branch. This MUST be done by rebasing the change branch on top of
|
||||||
|
the source branch.
|
||||||
|
8. After updating a change branch from its source branch you MUST push the
|
||||||
|
change branch to the remote server. Due to the nature of rebasing, you
|
||||||
|
will be required to do a force push, and you MUST use the
|
||||||
|
"--force-with-lease" git push option when doing so instead of the regular
|
||||||
|
"--force".
|
||||||
|
9. If there is a truly valid technical reason to not use rebase when
|
||||||
|
updating change branches, then you MAY update change branches via merge
|
||||||
|
instead of rebase. The decision to use merge MUST only be taken after all
|
||||||
|
possible options to use rebase have been tried and failed. People not
|
||||||
|
understanding how to use rebase is NOT a valid reason to use merge. If
|
||||||
|
you do decide to use merge instead of rebase, you MUST NOT use a mixture
|
||||||
|
of both methods.
|
||||||
|
4. Pull Requests
|
||||||
|
1. To merge a change branch into its merge target, you MUST open a "pull
|
||||||
|
request" (or equivalent).
|
||||||
|
2. The purpose of a pull request is to allow others to review your changes
|
||||||
|
and give feedback. You can then fix any issues, complaints, and more that
|
||||||
|
might arise, and then let people review again.
|
||||||
|
3. Before creating a pull request, it is RECOMMENDED that you consider the
|
||||||
|
state of your change branch's commit history. If it is messy and
|
||||||
|
confusing, it might be a good idea to rebase your branch with "git rebase
|
||||||
|
-i" to present a cleaner and easier to follow commit history for your
|
||||||
|
reviewers.
|
||||||
|
4. A pull request MUST only be merged when the change branch is up-to-date
|
||||||
|
with its source branch, the test suite and other CI checks are passing,
|
||||||
|
and you and others are happy with the changes. This is especially
|
||||||
|
important if the merge target is the main branch.
|
||||||
|
5. To get feedback, help, or generally just discuss a change branch with
|
||||||
|
others, it is RECOMMENDED you create a draft pull request and discuss the
|
||||||
|
changes with others there. This leaves a clear and visible history of
|
||||||
|
how, when, and why the code looks and behaves the way it does.
|
||||||
|
5. Git Best Practices
|
||||||
|
1. It is RECOMMENDED that all commit messages follow the Conventional
|
||||||
|
Commits specification (<https://www.conventionalcommits.org/>). This
|
||||||
|
provides a structured format that integrates well with Semantic
|
||||||
|
Versioning, and enables automated changelog generation. At minimum,
|
||||||
|
commit messages SHOULD follow the Commit Guidelines from the official git
|
||||||
|
documentation:
|
||||||
|
<https://git-scm.com/book/en/v2/Distributed-Git-Contributing-to-a-Project#_commit_guidelines>
|
||||||
|
2. You SHOULD always use "--force-with-lease" when doing a force push. The
|
||||||
|
regular "--force" option is dangerous and destructive. More information:
|
||||||
|
<https://www.codestudy.net/blog/git-push-force-with-lease-vs-force/>
|
||||||
|
3. You SHOULD understand and be comfortable with rebasing:
|
||||||
|
<https://git-scm.com/book/en/v2/Git-Branching-Rebasing>
|
||||||
|
4. It is RECOMMENDED that you always do "git pull --rebase" instead of "git
|
||||||
|
pull" to avoid unnecessary merge commits. You can make this the default
|
||||||
|
behavior of "git pull" with "git config --global pull.rebase true".
|
||||||
|
5. When using Conventional Commits, it is RECOMMENDED to use tooling to
|
||||||
|
automate version bumping and generate changelogs from commit messages.
|
||||||
|
This pairs well with the release process and ensures changelogs are
|
||||||
|
consistent and complete.
|
||||||
|
6. Versioning
|
||||||
|
1. A "version string" is a typically mostly numeric string that identifies a
|
||||||
|
specific version of a project. The version string itself MUST NOT have a
|
||||||
|
"v" prefix, but the version string can be displayed with a "v" prefix.
|
||||||
|
2. The source of truth for a project's version MUST be a git tag with a name
|
||||||
|
based on the version string. This kind of tag MUST be referred to as a
|
||||||
|
"release tag".
|
||||||
|
3. It is OPTIONAL, but RECOMMENDED to also keep the version string
|
||||||
|
hard-coded somewhere in the project code-base.
|
||||||
|
4. If you hard-code the version string into the code-base, it is RECOMMENDED
|
||||||
|
that you do so in a file called "VERSION" located in the root of the
|
||||||
|
project. But be mindful of the conventions of your programming language
|
||||||
|
and community when choosing if, where and how to hard-code the version
|
||||||
|
string.
|
||||||
|
5. If you are using a "VERSION" file in the root of the project, this file
|
||||||
|
MUST only contain the exact version string, meaning it MUST NOT have a
|
||||||
|
"v" prefix. For example, "v2.11.4" is bad, and "2.11.4" is good.
|
||||||
|
6. It is OPTIONAL, but RECOMMENDED that the version string follows Semantic
|
||||||
|
Versioning (<http://semver.org/>).
|
||||||
|
7. Releases
|
||||||
|
1. To create a new release, you MUST create a git tag named as the exact
|
||||||
|
version string of the release. This kind of tag MUST be referred to as a
|
||||||
|
"release tag".
|
||||||
|
2. The release tag name can OPTIONALLY be prefixed with "v". For example,
|
||||||
|
the tag name can be either "2.11.4" or "v2.11.4". Note that this "v"
|
||||||
|
prefix is only for the tag name itself, the version string (as defined in
|
||||||
|
section 6.1) MUST NOT have a "v" prefix.
|
||||||
|
3. If the version string is hard-coded into the code-base, you MUST create a
|
||||||
|
"version bump" commit which changes the hard-coded version string of the
|
||||||
|
project.
|
||||||
|
4. When using version bump commits, the release tag MUST be placed on the
|
||||||
|
version bump commit, unless using a release pull request.
|
||||||
|
5. It is OPTIONAL to use a "release pull request" to propose a release. A
|
||||||
|
release pull request contains the version bump commit and any
|
||||||
|
release-related changes (changelog updates, etc.). When using release
|
||||||
|
pull requests, the release tag SHOULD be placed on the resulting merge
|
||||||
|
commit.
|
||||||
|
6. If you are not using a release branch, then the release tag, and if
|
||||||
|
relevant the version bump commit, MUST be created directly on the main
|
||||||
|
branch.
|
||||||
|
7. If you are using Conventional Commits, the version bump commit MUST also
|
||||||
|
follow the format. For example, "chore(release): 2.11.4". Otherwise, a
|
||||||
|
simple "Bump version to 2.11.4" format is acceptable.
|
||||||
|
8. Release tags SHOULD be lightweight tags unless you need features that
|
||||||
|
annotated tags provide. Annotated tags allow you to include changelog
|
||||||
|
information in the tag itself, GPG sign the tag, or include additional
|
||||||
|
metadata like the tagger's name and email.
|
||||||
|
9. If you use annotated release tags, the first line of the annotation
|
||||||
|
SHOULD read "Release VERSION". For example for version "2.11.4" the first
|
||||||
|
line of the tag annotation SHOULD read "Release 2.11.4". The second line
|
||||||
|
MUST be blank, and the changelog SHOULD start on the third line.
|
||||||
|
10. It is OPTIONAL, but RECOMMENDED for high-security projects, to GPG sign
|
||||||
|
release tags. This provides cryptographic verification that the release
|
||||||
|
was created by a trusted party.
|
||||||
|
8. Short-Term Release Branches
|
||||||
|
1. Any branch that has a name starting with "release-" SHOULD be referred to
|
||||||
|
as a "release branch".
|
||||||
|
2. Any release branch which has a name ending with a specific version
|
||||||
|
string, MUST be referred to as a "short-term release branch".
|
||||||
|
3. Use of short-term release branches are OPTIONAL, and intended to be used
|
||||||
|
to create a specific versioned release.
|
||||||
|
4. A short-term release branch is RECOMMENDED if there is a lengthy release
|
||||||
|
verification process to avoid a code freeze on the main branch.
|
||||||
|
5. Short-term release branches MUST have a name of "release-VERSION". For
|
||||||
|
example for version "2.11.4" the release branch name MUST be
|
||||||
|
"release-2.11.4".
|
||||||
|
6. When using a short-term release branch to create a release, the version
|
||||||
|
bump commit if used, MUST be created on the short-term release branch.
|
||||||
|
The release tag MUST be placed on the version bump commit, or on the
|
||||||
|
merge commit when using a release pull request to merge the release
|
||||||
|
branch.
|
||||||
|
7. Only very minor changes SHOULD be performed on a short-term release
|
||||||
|
branch directly. Any larger changes SHOULD be done in the main branch,
|
||||||
|
and SHOULD be pulled into the release branch by rebasing it on top of the
|
||||||
|
main branch the same way a change branch pulls in updates from its source
|
||||||
|
branch.
|
||||||
|
8. After a release tag has been created, the release branch MUST be merged
|
||||||
|
back into its source branch and then deleted. Typically the source branch
|
||||||
|
will be the main branch.
|
||||||
|
9. Long-Term Release Branches
|
||||||
|
1. Any release branch which has a name ending with a nonspecific version
|
||||||
|
string, MUST be referred to as a "long-term release branch". For example,
|
||||||
|
"release-2.11" is a long-term release branch, while "release-2.11.4" is a
|
||||||
|
short-term release branch.
|
||||||
|
2. Use of long-term release branches are OPTIONAL, and intended for work on
|
||||||
|
versions which are not currently part of the main branch. Typically this
|
||||||
|
is useful when you need to create a new maintenance release for an older
|
||||||
|
version.
|
||||||
|
3. A long-term release branch MUST have a name with a nonspecific version
|
||||||
|
number. For example, a long-term release branch for creating new 2.9.x
|
||||||
|
releases MUST be named "release-2.9", or "release-2" for all 2.x.x
|
||||||
|
releases when main has moved to 3.x.x.
|
||||||
|
4. Long-term release branches for maintenance releases of older versions
|
||||||
|
MUST be created from the relevant release tag. For example, if the main
|
||||||
|
branch is on version 2.11.4 and there is a security fix for all 2.9.x
|
||||||
|
releases, the latest of which is "2.9.7". Create a new branch called
|
||||||
|
"release-2.9" from the "2.9.7" release tag. The security fix release will
|
||||||
|
then end up being version "2.9.8". Similarly, if main is on 3.x.x and you
|
||||||
|
need to maintain the entire 2.x.x line, create a "release-2" branch from
|
||||||
|
the latest 2.x.x release tag.
|
||||||
|
5. To create a new release from a long-term release branch, you MUST follow
|
||||||
|
the same process as a release from the main branch, except the long-term
|
||||||
|
release branch takes the place of the main branch.
|
||||||
|
6. A long-term release branch SHOULD be treated with the same respect as the
|
||||||
|
main branch. It is effectively the main branch for the release series in
|
||||||
|
question. Meaning it MUST always be in a non-broken state, MUST NOT be
|
||||||
|
force pushed to, etc.
|
||||||
|
10. Bug Fixes & Rollback
|
||||||
|
1. You MUST NOT under any circumstances force push to the main branch or to
|
||||||
|
long-term release branches.
|
||||||
|
2. If a change branch which has been merged into the main branch is found to
|
||||||
|
have a bug in it, the bugfix work MUST be done as a new separate change
|
||||||
|
branch. This new change branch MUST follow the same workflow as any other
|
||||||
|
change branch.
|
||||||
|
3. If a change branch is wrongfully merged into main, or for any other
|
||||||
|
reason the merge must be undone, you MUST undo the merge by reverting the
|
||||||
|
merge commit itself. Effectively creating a new commit that reverses all
|
||||||
|
the relevant changes.
|
||||||
|
|
||||||
|
## FAQ
|
||||||
|
|
||||||
|
### Why use Common-Flow instead of Git Flow, and how does it differ?
|
||||||
|
|
||||||
|
Common-Flow tries to be a lot less complicated than Git Flow by having fewer
|
||||||
|
types of branches, and simpler rules. Normal day to day development doesn't
|
||||||
|
really change much:
|
||||||
|
|
||||||
|
- You create change branches instead of feature branches, without the need of a
|
||||||
|
"feature/" or "change/" prefix in the branch name.
|
||||||
|
- Change branches are typically created from and merged back into "main" instead
|
||||||
|
of "develop".
|
||||||
|
- Creating a release is done by simply creating a git tag, typically on the main
|
||||||
|
branch.
|
||||||
|
|
||||||
|
In detail, the main differences between Git Flow and Common-Flow are:
|
||||||
|
|
||||||
|
- There is no "develop" branch, there is only a "main" branch which contains the
|
||||||
|
latest work. In Git Flow the main branch effectively ends up just being a
|
||||||
|
pointer to the latest release, despite the fact that Git Flow includes release
|
||||||
|
tags too. In Common-Flow you just look at the tags to find the latest release.
|
||||||
|
- There are no "feature" or "hotfix" branches, there's only "change" branches.
|
||||||
|
Any branch that is not main and introduces changes is a change branch. Change
|
||||||
|
branches also don't have an enforced naming convention, they just need to have
|
||||||
|
a "descriptive name". This makes things simpler and allows more flexibility.
|
||||||
|
- Release branches are available, but optional. Instead of enforcing the use of
|
||||||
|
release branches like Git Flow, Common-Flow only recommends the use of release
|
||||||
|
branches when it makes things easier. If creating a new release by tagging
|
||||||
|
"main" works for you, great, do that.
|
||||||
|
|
||||||
|
### Why use Common-Flow instead of GitHub Flow, and how does it differ?
|
||||||
|
|
||||||
|
Common-Flow is essentially GitHub Flow with the addition of a "Release" concept
|
||||||
|
that uses tags. It also attempts to define how certain common tasks are done,
|
||||||
|
like updating change/feature branches from their source branches for example.
|
||||||
|
This is to help end arguments about how such things are done.
|
||||||
|
|
||||||
|
If a deployment/release for you is just getting the latest code in the main
|
||||||
|
branch out without caring about bumping version numbers, GitHub Flow is a good
|
||||||
|
fit for you. You probably don't need the extras of Common-Flow.
|
||||||
|
|
||||||
|
However, if your deployments/releases have specific version numbers, then
|
||||||
|
Common-Flow gives you a simple set of rules for how to create and manage
|
||||||
|
releases, on top of what GitHub Flow already does.
|
||||||
|
|
||||||
|
### What does "descriptive name" mean for change branches?
|
||||||
|
|
||||||
|
It means what it sounds like. The name should be descriptive, as in by just
|
||||||
|
reading the name of the branch you should understand what the branch's purpose
|
||||||
|
is and what it does. Here's a few examples:
|
||||||
|
|
||||||
|
- add-2fa-support
|
||||||
|
- fix-login-issue
|
||||||
|
- remove-sort-by-middle-name-functionality
|
||||||
|
- update-font-awesome
|
||||||
|
- change-search-behavior
|
||||||
|
- improve-pagination-performance
|
||||||
|
- tweak-footer-style
|
||||||
|
|
||||||
|
Notice how none of these have any prefixes like "feature/" or "hotfix/", they're
|
||||||
|
not needed when branch names are properly descriptive. However, there's nothing
|
||||||
|
to say you can't use such prefixes if you want.
|
||||||
|
|
||||||
|
You can also add ticket numbers to the branch name if your team/org has that as
|
||||||
|
part of its process. But it is recommended that ticket numbers are added to the
|
||||||
|
end of the branch name. The ticket number is essentially metadata, so put it at
|
||||||
|
the end and out of the way of humans trying to read the descriptive name from
|
||||||
|
left to right.
|
||||||
|
|
||||||
|
### How do we release an emergency hotfix when the main branch is broken?
|
||||||
|
|
||||||
|
This should ideally never happen, however if it does you can do one of the
|
||||||
|
following:
|
||||||
|
|
||||||
|
- Review why the main branch is broken and revert the changes that caused the
|
||||||
|
issues. Then apply the hotfix and release.
|
||||||
|
- Or use a short-term release branch created from the latest release tag instead
|
||||||
|
of the main branch. Apply the hotfix to the release branch, create a release
|
||||||
|
tag on the release branch, and then merge it back into main.
|
||||||
|
|
||||||
|
In this situation, it is recommended you try to revert the offending changes
|
||||||
|
that's preventing a new release from main. But if that proves to be a
|
||||||
|
complicated task and you're short on time, a short-term release branch gives you
|
||||||
|
an instant fix to the situation at hand. You can then resolve the issues with
|
||||||
|
the main branch later.
|
||||||
|
|
||||||
|
### How do I handle monorepos?
|
||||||
|
|
||||||
|
Common-Flow works well with monorepos. The key considerations are:
|
||||||
|
|
||||||
|
- Use a single main branch for the entire monorepo. This keeps things simple and
|
||||||
|
ensures all packages/projects are always in a consistent state.
|
||||||
|
- For versioning, you have two main options:
|
||||||
|
- **Unified versioning**: All packages share the same version number. Simple
|
||||||
|
to manage, but may result in version bumps for packages that haven't
|
||||||
|
changed.
|
||||||
|
- **Independent versioning**: Each package has its own version. Use tags with
|
||||||
|
a package prefix, e.g., "package-a-2.1.0" or "package-a-v2.1.0". This allows
|
||||||
|
packages to evolve at their own pace.
|
||||||
|
- Change branches can span multiple packages. Describe the scope in the branch
|
||||||
|
name if helpful, e.g., "update-auth-across-services".
|
||||||
|
- For releases, if using independent versioning, you can create release branches
|
||||||
|
per package when needed, e.g., "release-package-a-2.1".
|
||||||
|
|
||||||
|
The core workflow remains the same: don't break main, use change branches, and
|
||||||
|
tag releases.
|
||||||
|
|
||||||
|
## About
|
||||||
|
|
||||||
|
The Git Common-Flow specification is authored by [Jim
|
||||||
|
Myhrberg](https://jimeh.me/).
|
||||||
|
|
||||||
|
If you'd like to leave feedback, please [open an issue on
|
||||||
|
GitHub](https://github.com/jimeh/common-flow/issues).
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
[Creative Commons - CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)
|
||||||
1
src/content/spec/2.0.0.svg
Normal file
|
After Width: | Height: | Size: 13 KiB |
8
src/icons/sun-moon.svg
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
|
||||||
|
<!-- Circle outline -->
|
||||||
|
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M15.75 12a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0Z"/>
|
||||||
|
<!-- Right half filled (dark/moon side) -->
|
||||||
|
<path fill="currentColor" d="M12 8.25a3.75 3.75 0 0 1 0 7.5z"/>
|
||||||
|
<!-- Left-side sun rays (top, top-left, left, bottom-left, bottom) -->
|
||||||
|
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M12 3v2.25M7.227 7.227 5.636 5.636M5.25 12H3M7.227 16.773l-1.591 1.591M12 18.75V21"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 633 B |
@@ -1,7 +1,5 @@
|
|||||||
---
|
---
|
||||||
import "@fontsource-variable/bricolage-grotesque";
|
import { Font } from "astro:assets";
|
||||||
import "@fontsource-variable/dm-sans";
|
|
||||||
import "@fontsource-variable/jetbrains-mono";
|
|
||||||
import "../styles/global.css";
|
import "../styles/global.css";
|
||||||
import { config } from "../config";
|
import { config } from "../config";
|
||||||
|
|
||||||
@@ -11,7 +9,9 @@ interface Props {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const { title, description = config.description } = Astro.props;
|
const { title, description = config.description } = Astro.props;
|
||||||
const fullTitle = title === config.title ? title : `${title} | ${config.title}`;
|
const fullTitle = title.includes(config.title)
|
||||||
|
? title
|
||||||
|
: `${title} | ${config.title}`;
|
||||||
const canonicalUrl = Astro.url.href;
|
const canonicalUrl = Astro.url.href;
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -42,12 +42,23 @@ const canonicalUrl = Astro.url.href;
|
|||||||
<link rel="icon" href="/favicon.svg" type="image/svg+xml" />
|
<link rel="icon" href="/favicon.svg" type="image/svg+xml" />
|
||||||
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
|
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
|
||||||
|
|
||||||
|
<!-- Fonts -->
|
||||||
|
<Font
|
||||||
|
cssVariable="--font-bricolage"
|
||||||
|
preload={[{ weight: "700" }, { weight: "800" }]}
|
||||||
|
/>
|
||||||
|
<Font cssVariable="--font-dm-sans" preload={[{ weight: "400" }]} />
|
||||||
|
<Font cssVariable="--font-jetbrains" preload={[{ weight: "400" }]} />
|
||||||
|
|
||||||
|
<!-- Slot for page-specific head content -->
|
||||||
|
<slot name="head" />
|
||||||
|
|
||||||
<!-- Prevent flash of wrong theme -->
|
<!-- Prevent flash of wrong theme -->
|
||||||
<script is:inline>
|
<script is:inline>
|
||||||
(function () {
|
(function () {
|
||||||
const mode = localStorage.getItem("theme");
|
const mode = localStorage.getItem("theme");
|
||||||
const prefersDark = window.matchMedia(
|
const prefersDark = window.matchMedia(
|
||||||
"(prefers-color-scheme: dark)",
|
"(prefers-color-scheme: dark)"
|
||||||
).matches;
|
).matches;
|
||||||
if (mode === "dark" || (mode !== "light" && prefersDark)) {
|
if (mode === "dark" || (mode !== "light" && prefersDark)) {
|
||||||
document.documentElement.classList.add("dark");
|
document.documentElement.classList.add("dark");
|
||||||
@@ -63,7 +74,7 @@ const canonicalUrl = Astro.url.href;
|
|||||||
document.addEventListener("astro:after-swap", () => {
|
document.addEventListener("astro:after-swap", () => {
|
||||||
const mode = localStorage.getItem("theme");
|
const mode = localStorage.getItem("theme");
|
||||||
const prefersDark = window.matchMedia(
|
const prefersDark = window.matchMedia(
|
||||||
"(prefers-color-scheme: dark)",
|
"(prefers-color-scheme: dark)"
|
||||||
).matches;
|
).matches;
|
||||||
if (mode === "dark" || (mode !== "light" && prefersDark)) {
|
if (mode === "dark" || (mode !== "light" && prefersDark)) {
|
||||||
document.documentElement.classList.add("dark");
|
document.documentElement.classList.add("dark");
|
||||||
|
|||||||
@@ -14,9 +14,10 @@ import { parseSpecContent } from "../utils/parseSpecContent";
|
|||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
spec: CollectionEntry<"spec">;
|
spec: CollectionEntry<"spec">;
|
||||||
|
versions: string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
const { spec } = Astro.props;
|
const { spec, versions } = Astro.props;
|
||||||
const version = spec.data.version;
|
const version = spec.data.version;
|
||||||
|
|
||||||
// Read the markdown file
|
// Read the markdown file
|
||||||
@@ -27,14 +28,34 @@ const content = fs.readFileSync(filePath, "utf-8");
|
|||||||
const markdown = content.replace(/^---[\s\S]*?---\n/, "");
|
const markdown = content.replace(/^---[\s\S]*?---\n/, "");
|
||||||
|
|
||||||
// Parse the content into sections (handles markdown -> HTML internally)
|
// Parse the content into sections (handles markdown -> HTML internally)
|
||||||
const parsed = await parseSpecContent(markdown, version);
|
const parsed = await parseSpecContent(markdown);
|
||||||
|
|
||||||
|
// Read SVG content for inline embedding
|
||||||
|
const svgFilePath = path.join(
|
||||||
|
process.cwd(),
|
||||||
|
"src/content/spec",
|
||||||
|
`${version}.svg`
|
||||||
|
);
|
||||||
|
let svgContent: string | null = null;
|
||||||
|
if (fs.existsSync(svgFilePath)) {
|
||||||
|
svgContent = fs.readFileSync(svgFilePath, "utf-8");
|
||||||
|
}
|
||||||
---
|
---
|
||||||
|
|
||||||
<BaseLayout title={spec.data.title}>
|
<BaseLayout title={spec.data.title}>
|
||||||
<Header version={version} />
|
<Fragment slot="head">
|
||||||
|
<link
|
||||||
|
rel="alternate"
|
||||||
|
type="text/markdown"
|
||||||
|
href={`/spec/git-common-flow-v${version}.md`}
|
||||||
|
title="Raw Markdown"
|
||||||
|
/>
|
||||||
|
</Fragment>
|
||||||
|
|
||||||
|
<Header version={version} versions={versions} />
|
||||||
|
|
||||||
<main>
|
<main>
|
||||||
<Hero version={version} svgPath={parsed.svgPath} />
|
<Hero version={version} versions={versions} svgContent={svgContent} />
|
||||||
|
|
||||||
<AboutSection
|
<AboutSection
|
||||||
introduction={parsed.introduction}
|
introduction={parsed.introduction}
|
||||||
@@ -47,6 +68,7 @@ const parsed = await parseSpecContent(markdown, version);
|
|||||||
terminologyTitle={parsed.terminologyTitle}
|
terminologyTitle={parsed.terminologyTitle}
|
||||||
specification={parsed.specification}
|
specification={parsed.specification}
|
||||||
tocItems={parsed.tocItems}
|
tocItems={parsed.tocItems}
|
||||||
|
version={version}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<FAQSection items={parsed.faq} />
|
<FAQSection items={parsed.faq} />
|
||||||
|
|||||||
@@ -2,16 +2,16 @@
|
|||||||
import { getCollection } from "astro:content";
|
import { getCollection } from "astro:content";
|
||||||
|
|
||||||
import SpecLayout from "../layouts/SpecLayout.astro";
|
import SpecLayout from "../layouts/SpecLayout.astro";
|
||||||
import { config } from "../config";
|
import { getVersionInfo } from "../utils/versions";
|
||||||
|
|
||||||
// Render the current/latest version
|
// Get version info and render the current/latest version
|
||||||
const version = config.currentVersion;
|
const { versions, currentVersion } = await getVersionInfo();
|
||||||
const specs = await getCollection("spec");
|
const specs = await getCollection("spec");
|
||||||
const spec = specs.find((s) => s.data.version === version);
|
const spec = specs.find((s) => s.data.version === currentVersion);
|
||||||
|
|
||||||
if (!spec) {
|
if (!spec) {
|
||||||
throw new Error(`Spec version ${version} not found`);
|
throw new Error(`Spec version ${currentVersion} not found`);
|
||||||
}
|
}
|
||||||
---
|
---
|
||||||
|
|
||||||
<SpecLayout spec={spec} />
|
<SpecLayout spec={spec} versions={versions} />
|
||||||
|
|||||||
25
src/pages/llms.txt.ts
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
import type { APIRoute } from "astro";
|
||||||
|
import { getVersionInfo } from "../utils/versions";
|
||||||
|
|
||||||
|
export const GET: APIRoute = async () => {
|
||||||
|
const { currentVersion } = await getVersionInfo();
|
||||||
|
|
||||||
|
const content = `# Common-Flow
|
||||||
|
|
||||||
|
> A Git workflow specification combining GitHub Flow with versioned releases.
|
||||||
|
|
||||||
|
Common-Flow is a sensible git workflow based on GitHub Flow, with the addition
|
||||||
|
of versioned releases, optional release branches, and without the requirement
|
||||||
|
to deploy to production all the time.
|
||||||
|
|
||||||
|
## Docs
|
||||||
|
|
||||||
|
- [Git Common-Flow Specification](/spec/git-common-flow-v${currentVersion}.md): The complete Git Common-Flow v${currentVersion} specification in Markdown format
|
||||||
|
`;
|
||||||
|
|
||||||
|
return new Response(content, {
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "text/plain; charset=utf-8",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
@@ -2,6 +2,7 @@
|
|||||||
import { getCollection } from "astro:content";
|
import { getCollection } from "astro:content";
|
||||||
|
|
||||||
import SpecLayout from "../../layouts/SpecLayout.astro";
|
import SpecLayout from "../../layouts/SpecLayout.astro";
|
||||||
|
import { getVersionInfo } from "../../utils/versions";
|
||||||
|
|
||||||
export async function getStaticPaths() {
|
export async function getStaticPaths() {
|
||||||
const specs = await getCollection("spec");
|
const specs = await getCollection("spec");
|
||||||
@@ -12,6 +13,7 @@ export async function getStaticPaths() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const { spec } = Astro.props;
|
const { spec } = Astro.props;
|
||||||
|
const { versions } = await getVersionInfo();
|
||||||
---
|
---
|
||||||
|
|
||||||
<SpecLayout spec={spec} />
|
<SpecLayout spec={spec} versions={versions} />
|
||||||
|
|||||||
531
src/pages/spec/[version]/md.astro
Normal file
@@ -0,0 +1,531 @@
|
|||||||
|
---
|
||||||
|
import { getCollection } from "astro:content";
|
||||||
|
import { Icon } from "astro-icon/components";
|
||||||
|
import * as fs from "node:fs";
|
||||||
|
import * as path from "node:path";
|
||||||
|
import { createHighlighter } from "shiki";
|
||||||
|
import { unified } from "unified";
|
||||||
|
import remarkParse from "remark-parse";
|
||||||
|
import remarkRehype from "remark-rehype";
|
||||||
|
import rehypeSlug from "rehype-slug";
|
||||||
|
import rehypeAutolinkHeadings from "rehype-autolink-headings";
|
||||||
|
import rehypeStringify from "rehype-stringify";
|
||||||
|
import { icons as heroicons } from "@iconify-json/heroicons";
|
||||||
|
import { getIconData, iconToSVG } from "@iconify/utils";
|
||||||
|
|
||||||
|
import BaseLayout from "../../../layouts/BaseLayout.astro";
|
||||||
|
import ThemeToggle from "../../../components/ThemeToggle.astro";
|
||||||
|
import { config } from "../../../config";
|
||||||
|
|
||||||
|
// Get the link icon SVG from heroicons for use in anchor links
|
||||||
|
const linkIconData = getIconData(heroicons, "link-20-solid");
|
||||||
|
const linkIconSvg = linkIconData ? iconToSVG(linkIconData) : null;
|
||||||
|
|
||||||
|
// Parse the icon body into hast nodes for rehype
|
||||||
|
function parseIconBody(body: string): import("hast").ElementContent[] {
|
||||||
|
// Simple regex-based parser for SVG path/g elements
|
||||||
|
const elements: import("hast").ElementContent[] = [];
|
||||||
|
const tagRegex = /<(\w+)([^>]*)(?:\/>|>([\s\S]*?)<\/\1>)/g;
|
||||||
|
let match;
|
||||||
|
|
||||||
|
while ((match = tagRegex.exec(body)) !== null) {
|
||||||
|
const [, tagName, attrs, children] = match;
|
||||||
|
const properties: Record<string, string> = {};
|
||||||
|
|
||||||
|
// Parse attributes
|
||||||
|
const attrRegex = /(\w+(?:-\w+)*)="([^"]*)"/g;
|
||||||
|
let attrMatch;
|
||||||
|
while ((attrMatch = attrRegex.exec(attrs)) !== null) {
|
||||||
|
properties[attrMatch[1]] = attrMatch[2];
|
||||||
|
}
|
||||||
|
|
||||||
|
elements.push({
|
||||||
|
type: "element",
|
||||||
|
tagName,
|
||||||
|
properties,
|
||||||
|
children: children ? parseIconBody(children) : [],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return elements;
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function getStaticPaths() {
|
||||||
|
const specs = await getCollection("spec");
|
||||||
|
return specs.map((spec) => ({
|
||||||
|
params: { version: spec.data.version },
|
||||||
|
props: { spec },
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
const { spec } = Astro.props;
|
||||||
|
const version = spec.data.version;
|
||||||
|
|
||||||
|
// Read the markdown file
|
||||||
|
const filePath = path.join(process.cwd(), "src/content/spec", `${version}.md`);
|
||||||
|
const content = fs.readFileSync(filePath, "utf-8");
|
||||||
|
|
||||||
|
// Remove frontmatter
|
||||||
|
const markdown = content.replace(/^---[\s\S]*?---\n/, "");
|
||||||
|
|
||||||
|
// Create syntax highlighter for code view
|
||||||
|
const highlighter = await createHighlighter({
|
||||||
|
themes: ["github-light", "github-dark"],
|
||||||
|
langs: ["markdown"],
|
||||||
|
});
|
||||||
|
|
||||||
|
const highlightedHtml = highlighter.codeToHtml(markdown, {
|
||||||
|
lang: "markdown",
|
||||||
|
themes: {
|
||||||
|
light: "github-light",
|
||||||
|
dark: "github-dark",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
// Build the anchor link icon content from the heroicons data
|
||||||
|
const anchorIconContent = linkIconSvg
|
||||||
|
? {
|
||||||
|
type: "element" as const,
|
||||||
|
tagName: "svg",
|
||||||
|
properties: {
|
||||||
|
className: ["anchor-icon"],
|
||||||
|
viewBox: `0 0 ${linkIconSvg.attributes.width} ${linkIconSvg.attributes.height}`,
|
||||||
|
fill: "currentColor",
|
||||||
|
"aria-hidden": "true",
|
||||||
|
},
|
||||||
|
children: parseIconBody(linkIconSvg.body),
|
||||||
|
}
|
||||||
|
: { type: "text" as const, value: "#" };
|
||||||
|
|
||||||
|
// Render markdown to HTML for preview view
|
||||||
|
const previewHtml = await unified()
|
||||||
|
.use(remarkParse)
|
||||||
|
.use(remarkRehype)
|
||||||
|
.use(rehypeSlug)
|
||||||
|
.use(rehypeAutolinkHeadings, {
|
||||||
|
behavior: "append",
|
||||||
|
properties: {
|
||||||
|
className: ["anchor-link"],
|
||||||
|
ariaLabel: "Link to this section",
|
||||||
|
},
|
||||||
|
content: anchorIconContent,
|
||||||
|
})
|
||||||
|
.use(rehypeStringify)
|
||||||
|
.process(markdown)
|
||||||
|
.then((file) => String(file));
|
||||||
|
---
|
||||||
|
|
||||||
|
<BaseLayout title={`${spec.data.title} - Markdown`}>
|
||||||
|
<Fragment slot="head">
|
||||||
|
<link
|
||||||
|
rel="alternate"
|
||||||
|
type="text/markdown"
|
||||||
|
href={`/spec/git-common-flow-v${version}.md`}
|
||||||
|
title="Raw Markdown"
|
||||||
|
/>
|
||||||
|
</Fragment>
|
||||||
|
|
||||||
|
<!-- Header -->
|
||||||
|
<header
|
||||||
|
class="sticky top-0 z-50 border-b
|
||||||
|
border-gray-200 dark:border-neutral-800
|
||||||
|
backdrop-blur-xl bg-gray-50/85 dark:bg-neutral-950/85"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="max-w-6xl mx-auto px-4 sm:px-6 h-16 flex items-center
|
||||||
|
justify-between"
|
||||||
|
>
|
||||||
|
<!-- Back link and title -->
|
||||||
|
<div class="flex items-center gap-4">
|
||||||
|
<a
|
||||||
|
href={`/spec/${version}`}
|
||||||
|
class="inline-flex items-center gap-1.5 text-sm font-medium
|
||||||
|
text-gray-600 dark:text-neutral-400
|
||||||
|
hover:text-sky-600 dark:hover:text-sky-400 transition-colors"
|
||||||
|
>
|
||||||
|
<Icon name="heroicons:arrow-left" class="w-4 h-4" />
|
||||||
|
<span class="hidden sm:inline">Back to Spec</span>
|
||||||
|
</a>
|
||||||
|
<span class="hidden sm:inline text-gray-300 dark:text-neutral-700"
|
||||||
|
>|</span
|
||||||
|
>
|
||||||
|
<span class="font-display font-bold text-lg tracking-tight">
|
||||||
|
Markdown
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
class="px-2 py-0.5 text-xs font-semibold rounded-full
|
||||||
|
bg-sky-100 text-sky-700
|
||||||
|
dark:bg-sky-900/50 dark:text-sky-300"
|
||||||
|
>
|
||||||
|
v{version}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Right side: Theme, GitHub -->
|
||||||
|
<div class="flex items-center gap-2">
|
||||||
|
<ThemeToggle />
|
||||||
|
|
||||||
|
<a
|
||||||
|
href={config.repoUrl}
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
class="p-2 rounded-lg transition-colors
|
||||||
|
text-gray-500 dark:text-neutral-500
|
||||||
|
hover:text-gray-950 dark:hover:text-neutral-50
|
||||||
|
hover:bg-gray-100 dark:hover:bg-neutral-800"
|
||||||
|
aria-label="View on GitHub"
|
||||||
|
>
|
||||||
|
<Icon name="simple-icons:github" class="w-5 h-5" />
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<!-- Main content -->
|
||||||
|
<main class="max-w-6xl mx-auto px-4 sm:px-6 py-8">
|
||||||
|
<div class="relative">
|
||||||
|
<!-- Hidden raw text for copying -->
|
||||||
|
<div id="markdown-raw" class="hidden">{markdown}</div>
|
||||||
|
<!-- Filename heading and actions -->
|
||||||
|
<div class="flex flex-col items-center mb-6">
|
||||||
|
<h1
|
||||||
|
class="font-mono font-semibold text-sm sm:text-base
|
||||||
|
text-gray-700 dark:text-neutral-300
|
||||||
|
max-w-full overflow-hidden text-ellipsis
|
||||||
|
whitespace-nowrap [direction:rtl] sm:[direction:ltr]"
|
||||||
|
>
|
||||||
|
git-common-flow-v{version}.md
|
||||||
|
</h1>
|
||||||
|
<div
|
||||||
|
class="flex flex-col sm:flex-row items-center gap-2 sm:gap-3 mt-3
|
||||||
|
w-full sm:w-auto"
|
||||||
|
>
|
||||||
|
<!-- Separator (hidden on mobile) -->
|
||||||
|
<span
|
||||||
|
class="hidden sm:inline text-gray-300 dark:text-neutral-700
|
||||||
|
order-2"
|
||||||
|
>|</span
|
||||||
|
>
|
||||||
|
|
||||||
|
<!-- Copy and Download buttons -->
|
||||||
|
<div class="flex items-center gap-3 order-1 sm:order-3">
|
||||||
|
<!-- Copy button -->
|
||||||
|
<button
|
||||||
|
id="copy-btn"
|
||||||
|
type="button"
|
||||||
|
class="inline-flex items-center gap-1.5 px-3 py-1.5 text-sm
|
||||||
|
font-medium rounded-lg transition-colors cursor-pointer
|
||||||
|
text-gray-600 dark:text-neutral-400
|
||||||
|
hover:bg-gray-100 hover:text-gray-950
|
||||||
|
dark:hover:bg-neutral-800 dark:hover:text-neutral-50"
|
||||||
|
>
|
||||||
|
<Icon name="heroicons:clipboard-document" class="w-4 h-4" />
|
||||||
|
<span data-copy-text>Copy</span>
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<!-- Raw button -->
|
||||||
|
<a
|
||||||
|
href={`/spec/git-common-flow-v${version}.md`}
|
||||||
|
class="inline-flex items-center gap-1.5 px-3 py-1.5 text-sm
|
||||||
|
font-medium rounded-lg transition-colors
|
||||||
|
text-gray-600 dark:text-neutral-400
|
||||||
|
hover:bg-gray-100 hover:text-gray-950
|
||||||
|
dark:hover:bg-neutral-800 dark:hover:text-neutral-50"
|
||||||
|
>
|
||||||
|
<Icon name="heroicons:document-text" class="w-4 h-4" />
|
||||||
|
<span>Raw</span>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<!-- Download button -->
|
||||||
|
<button
|
||||||
|
id="download-btn"
|
||||||
|
type="button"
|
||||||
|
class="inline-flex items-center gap-1.5 px-3 py-1.5 text-sm
|
||||||
|
font-medium rounded-lg transition-colors cursor-pointer
|
||||||
|
text-gray-600 dark:text-neutral-400
|
||||||
|
hover:bg-gray-100 hover:text-gray-950
|
||||||
|
dark:hover:bg-neutral-800 dark:hover:text-neutral-50"
|
||||||
|
data-filename={`git-common-flow-v${version}.md`}
|
||||||
|
>
|
||||||
|
<Icon name="heroicons:arrow-down-tray" class="w-4 h-4" />
|
||||||
|
<span>Download</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Code/Preview toggle -->
|
||||||
|
<div
|
||||||
|
id="toggle-container"
|
||||||
|
class="relative inline-flex rounded-lg p-0.5 order-2 sm:order-1
|
||||||
|
mt-2 sm:mt-0 bg-gray-100 dark:bg-neutral-800"
|
||||||
|
>
|
||||||
|
<!-- Sliding indicator -->
|
||||||
|
<div
|
||||||
|
id="toggle-indicator"
|
||||||
|
class="absolute top-0.5 h-[calc(100%-4px)] rounded-md
|
||||||
|
bg-white dark:bg-neutral-700 shadow-sm
|
||||||
|
transition-all duration-200 ease-out"
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
<button
|
||||||
|
id="toggle-preview"
|
||||||
|
type="button"
|
||||||
|
class="relative z-10 inline-flex items-center gap-1.5 px-3 py-1
|
||||||
|
text-sm font-medium rounded-md cursor-pointer
|
||||||
|
transition-colors duration-200
|
||||||
|
text-gray-900 dark:text-neutral-100"
|
||||||
|
aria-pressed="true"
|
||||||
|
>
|
||||||
|
<Icon name="heroicons:eye" class="w-4 h-4" />
|
||||||
|
Preview
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
id="toggle-code"
|
||||||
|
type="button"
|
||||||
|
class="relative z-10 inline-flex items-center gap-1.5 px-3 py-1
|
||||||
|
text-sm font-medium rounded-md cursor-pointer
|
||||||
|
transition-colors duration-200
|
||||||
|
text-gray-600 dark:text-neutral-400
|
||||||
|
hover:text-gray-900 dark:hover:text-neutral-200"
|
||||||
|
aria-pressed="false"
|
||||||
|
>
|
||||||
|
<Icon name="heroicons:code-bracket" class="w-4 h-4" />
|
||||||
|
Code
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- Code view (hidden by default) -->
|
||||||
|
<div
|
||||||
|
id="code-view"
|
||||||
|
class="hidden [&_pre]:overflow-x-auto [&_pre]:rounded-xl [&_pre]:p-6
|
||||||
|
[&_pre]:text-sm [&_pre]:leading-relaxed
|
||||||
|
[&_pre]:border [&_pre]:border-gray-200
|
||||||
|
dark:[&_pre]:border-neutral-800"
|
||||||
|
set:html={highlightedHtml}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- Preview view (visible by default) -->
|
||||||
|
<div
|
||||||
|
id="preview-view"
|
||||||
|
class="prose prose-slate dark:prose-invert max-w-none
|
||||||
|
rounded-xl p-6 border border-gray-200
|
||||||
|
dark:border-neutral-800 bg-white dark:bg-neutral-900"
|
||||||
|
set:html={previewHtml}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
</BaseLayout>
|
||||||
|
|
||||||
|
<style is:global>
|
||||||
|
/* Shiki dual theme support - override inline styles in dark mode */
|
||||||
|
.dark .shiki {
|
||||||
|
color: var(--shiki-dark) !important;
|
||||||
|
background-color: var(--shiki-dark-bg) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dark .shiki span {
|
||||||
|
color: var(--shiki-dark) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Preview anchor links */
|
||||||
|
#preview-view :is(h1, h2, h3, h4, h5, h6) {
|
||||||
|
overflow: visible;
|
||||||
|
}
|
||||||
|
|
||||||
|
#preview-view .anchor-link {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
margin-left: 0.5rem;
|
||||||
|
text-decoration: none;
|
||||||
|
opacity: 0;
|
||||||
|
transition: opacity 150ms ease;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
|
||||||
|
#preview-view :is(h1, h2, h3, h4, h5, h6):hover .anchor-link {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
#preview-view .anchor-link:hover {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
#preview-view .anchor-icon {
|
||||||
|
flex-shrink: 0;
|
||||||
|
width: 20px;
|
||||||
|
height: 20px;
|
||||||
|
color: var(--color-slate-400);
|
||||||
|
}
|
||||||
|
|
||||||
|
#preview-view .anchor-link:hover .anchor-icon {
|
||||||
|
color: var(--color-sky-500);
|
||||||
|
}
|
||||||
|
|
||||||
|
.dark #preview-view .anchor-icon {
|
||||||
|
color: var(--color-neutral-500);
|
||||||
|
}
|
||||||
|
|
||||||
|
.dark #preview-view .anchor-link:hover .anchor-icon {
|
||||||
|
color: var(--color-sky-400);
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
function initPage() {
|
||||||
|
const copyBtn = document.getElementById("copy-btn");
|
||||||
|
const downloadBtn = document.getElementById("download-btn");
|
||||||
|
const rawContent = document.getElementById("markdown-raw");
|
||||||
|
const copyText = copyBtn?.querySelector("[data-copy-text]");
|
||||||
|
|
||||||
|
const toggleContainer = document.getElementById("toggle-container");
|
||||||
|
const toggleCode = document.getElementById("toggle-code");
|
||||||
|
const togglePreview = document.getElementById("toggle-preview");
|
||||||
|
const toggleIndicator = document.getElementById("toggle-indicator");
|
||||||
|
const codeView = document.getElementById("code-view");
|
||||||
|
const previewView = document.getElementById("preview-view");
|
||||||
|
|
||||||
|
if (!rawContent) return;
|
||||||
|
|
||||||
|
// Text color classes for active/inactive states
|
||||||
|
const activeTextClasses = ["text-gray-900", "dark:text-neutral-100"];
|
||||||
|
const inactiveTextClasses = [
|
||||||
|
"text-gray-600",
|
||||||
|
"dark:text-neutral-400",
|
||||||
|
"hover:text-gray-900",
|
||||||
|
"dark:hover:text-neutral-200",
|
||||||
|
];
|
||||||
|
|
||||||
|
function updateIndicator(button: HTMLElement) {
|
||||||
|
if (!toggleIndicator || !toggleContainer) return;
|
||||||
|
|
||||||
|
const containerRect = toggleContainer.getBoundingClientRect();
|
||||||
|
const buttonRect = button.getBoundingClientRect();
|
||||||
|
|
||||||
|
// Calculate position relative to container (accounting for container padding)
|
||||||
|
const left = buttonRect.left - containerRect.left;
|
||||||
|
|
||||||
|
toggleIndicator.style.left = `${left}px`;
|
||||||
|
toggleIndicator.style.width = `${buttonRect.width}px`;
|
||||||
|
}
|
||||||
|
|
||||||
|
function setActiveToggle(isCode: boolean) {
|
||||||
|
if (
|
||||||
|
!toggleCode ||
|
||||||
|
!togglePreview ||
|
||||||
|
!toggleIndicator ||
|
||||||
|
!codeView ||
|
||||||
|
!previewView
|
||||||
|
)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (isCode) {
|
||||||
|
// Show code, hide preview
|
||||||
|
codeView.classList.remove("hidden");
|
||||||
|
previewView.classList.add("hidden");
|
||||||
|
|
||||||
|
// Update indicator position and size
|
||||||
|
updateIndicator(toggleCode);
|
||||||
|
|
||||||
|
// Update text colors
|
||||||
|
toggleCode.classList.add(...activeTextClasses);
|
||||||
|
toggleCode.classList.remove(...inactiveTextClasses);
|
||||||
|
toggleCode.setAttribute("aria-pressed", "true");
|
||||||
|
|
||||||
|
togglePreview.classList.remove(...activeTextClasses);
|
||||||
|
togglePreview.classList.add(...inactiveTextClasses);
|
||||||
|
togglePreview.setAttribute("aria-pressed", "false");
|
||||||
|
} else {
|
||||||
|
// Show preview, hide code
|
||||||
|
codeView.classList.add("hidden");
|
||||||
|
previewView.classList.remove("hidden");
|
||||||
|
|
||||||
|
// Update indicator position and size
|
||||||
|
updateIndicator(togglePreview);
|
||||||
|
|
||||||
|
// Update text colors
|
||||||
|
togglePreview.classList.add(...activeTextClasses);
|
||||||
|
togglePreview.classList.remove(...inactiveTextClasses);
|
||||||
|
togglePreview.setAttribute("aria-pressed", "true");
|
||||||
|
|
||||||
|
toggleCode.classList.remove(...activeTextClasses);
|
||||||
|
toggleCode.classList.add(...inactiveTextClasses);
|
||||||
|
toggleCode.setAttribute("aria-pressed", "false");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Initialize indicator position after layout is complete
|
||||||
|
// Use double requestAnimationFrame to ensure layout/paint is finished,
|
||||||
|
// which fixes sizing issues on iOS Safari initial page load
|
||||||
|
function initializeIndicator() {
|
||||||
|
if (togglePreview) {
|
||||||
|
requestAnimationFrame(() => {
|
||||||
|
requestAnimationFrame(() => {
|
||||||
|
updateIndicator(togglePreview);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Wait for fonts to load before measuring, then initialize
|
||||||
|
if (document.fonts && document.fonts.ready) {
|
||||||
|
document.fonts.ready.then(initializeIndicator);
|
||||||
|
} else {
|
||||||
|
initializeIndicator();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Toggle event listeners
|
||||||
|
toggleCode?.addEventListener("click", () => setActiveToggle(true));
|
||||||
|
togglePreview?.addEventListener("click", () => setActiveToggle(false));
|
||||||
|
|
||||||
|
function showCopiedFeedback() {
|
||||||
|
if (copyText) {
|
||||||
|
copyText.textContent = "Copied!";
|
||||||
|
setTimeout(() => {
|
||||||
|
copyText.textContent = "Copy";
|
||||||
|
}, 2000);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Copy button
|
||||||
|
if (copyBtn) {
|
||||||
|
copyBtn.addEventListener("click", async () => {
|
||||||
|
try {
|
||||||
|
await navigator.clipboard.writeText(rawContent.textContent || "");
|
||||||
|
showCopiedFeedback();
|
||||||
|
} catch {
|
||||||
|
// Fallback for older browsers
|
||||||
|
const textarea = document.createElement("textarea");
|
||||||
|
textarea.value = rawContent.textContent || "";
|
||||||
|
textarea.style.position = "fixed";
|
||||||
|
textarea.style.opacity = "0";
|
||||||
|
document.body.appendChild(textarea);
|
||||||
|
textarea.select();
|
||||||
|
document.execCommand("copy");
|
||||||
|
document.body.removeChild(textarea);
|
||||||
|
showCopiedFeedback();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// Download button
|
||||||
|
if (downloadBtn) {
|
||||||
|
downloadBtn.addEventListener("click", () => {
|
||||||
|
const filename = downloadBtn.dataset.filename || "common-flow.md";
|
||||||
|
const content = rawContent.textContent || "";
|
||||||
|
const blob = new Blob([content], { type: "text/markdown" });
|
||||||
|
const url = URL.createObjectURL(blob);
|
||||||
|
const a = document.createElement("a");
|
||||||
|
a.href = url;
|
||||||
|
a.download = filename;
|
||||||
|
document.body.appendChild(a);
|
||||||
|
a.click();
|
||||||
|
document.body.removeChild(a);
|
||||||
|
URL.revokeObjectURL(url);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
initPage();
|
||||||
|
document.addEventListener("astro:after-swap", initPage);
|
||||||
|
</script>
|
||||||
30
src/pages/spec/git-common-flow-v[version].md.ts
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
import type { APIRoute, GetStaticPaths } from "astro";
|
||||||
|
import { getCollection } from "astro:content";
|
||||||
|
import * as fs from "node:fs";
|
||||||
|
import * as path from "node:path";
|
||||||
|
|
||||||
|
export const getStaticPaths: GetStaticPaths = async () => {
|
||||||
|
const specs = await getCollection("spec");
|
||||||
|
return specs.map((spec) => ({
|
||||||
|
params: { version: spec.data.version },
|
||||||
|
}));
|
||||||
|
};
|
||||||
|
|
||||||
|
export const GET: APIRoute = ({ params }) => {
|
||||||
|
const version = params.version;
|
||||||
|
const filePath = path.join(
|
||||||
|
process.cwd(),
|
||||||
|
"src/content/spec",
|
||||||
|
`${version}.md`
|
||||||
|
);
|
||||||
|
const content = fs.readFileSync(filePath, "utf-8");
|
||||||
|
const markdown = content.replace(/^---[\s\S]*?---\n/, "");
|
||||||
|
const filename = `git-common-flow-v${version}.md`;
|
||||||
|
|
||||||
|
return new Response(markdown, {
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "text/markdown; charset=utf-8",
|
||||||
|
"Content-Disposition": `inline; filename="${filename}"`,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
75
src/scripts/clauseHighlight.ts
Normal file
@@ -0,0 +1,75 @@
|
|||||||
|
/**
|
||||||
|
* Highlights clause elements when navigating to them via anchor links.
|
||||||
|
* Works on both initial page load with hash and when clicking anchor links.
|
||||||
|
*/
|
||||||
|
|
||||||
|
const HIGHLIGHT_DURATION = 2000;
|
||||||
|
const HIGHLIGHT_CLASS = "clause-highlight";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Highlight a clause element briefly
|
||||||
|
*/
|
||||||
|
function highlightClause(element: Element): void {
|
||||||
|
// Remove any existing highlight
|
||||||
|
element.classList.remove(HIGHLIGHT_CLASS);
|
||||||
|
|
||||||
|
// Force reflow to restart animation if needed
|
||||||
|
void (element as HTMLElement).offsetWidth;
|
||||||
|
|
||||||
|
// Add highlight class
|
||||||
|
element.classList.add(HIGHLIGHT_CLASS);
|
||||||
|
|
||||||
|
// Remove after animation completes
|
||||||
|
setTimeout(() => {
|
||||||
|
element.classList.remove(HIGHLIGHT_CLASS);
|
||||||
|
}, HIGHLIGHT_DURATION);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handle hash change and highlight target clause
|
||||||
|
*/
|
||||||
|
function handleHashChange(): void {
|
||||||
|
const hash = window.location.hash;
|
||||||
|
if (!hash || !hash.startsWith("#clause-")) return;
|
||||||
|
|
||||||
|
const targetId = hash.slice(1);
|
||||||
|
const element = document.getElementById(targetId);
|
||||||
|
if (element) {
|
||||||
|
// Small delay to let scroll complete
|
||||||
|
setTimeout(() => highlightClause(element), 100);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initialize clause highlight behavior
|
||||||
|
*/
|
||||||
|
export function initClauseHighlight(): void {
|
||||||
|
// Handle clicks on clause links
|
||||||
|
document.addEventListener("click", (e) => {
|
||||||
|
const link = (e.target as Element).closest('a[href^="#clause-"]');
|
||||||
|
if (!link) return;
|
||||||
|
|
||||||
|
const href = link.getAttribute("href");
|
||||||
|
if (!href) return;
|
||||||
|
|
||||||
|
const targetId = href.slice(1);
|
||||||
|
const element = document.getElementById(targetId);
|
||||||
|
if (element) {
|
||||||
|
// Small delay to let scroll complete
|
||||||
|
setTimeout(() => highlightClause(element), 100);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Handle hash changes (back/forward navigation)
|
||||||
|
window.addEventListener("hashchange", handleHashChange);
|
||||||
|
|
||||||
|
// Handle initial page load with hash
|
||||||
|
if (window.location.hash?.startsWith("#clause-")) {
|
||||||
|
// Wait for page to be fully ready
|
||||||
|
if (document.readyState === "complete") {
|
||||||
|
handleHashChange();
|
||||||
|
} else {
|
||||||
|
window.addEventListener("load", handleHashChange);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -8,10 +8,10 @@
|
|||||||
--color-accent: theme(colors.sky.500);
|
--color-accent: theme(colors.sky.500);
|
||||||
--color-accent-light: theme(colors.sky.400);
|
--color-accent-light: theme(colors.sky.400);
|
||||||
|
|
||||||
/* Fonts - self-hosted via fontsource */
|
/* Fonts - via Astro experimental font API (fontsource provider) */
|
||||||
--font-display: "Bricolage Grotesque Variable", system-ui, sans-serif;
|
--font-display: var(--font-bricolage);
|
||||||
--font-sans: "DM Sans Variable", system-ui, sans-serif;
|
--font-sans: var(--font-dm-sans);
|
||||||
--font-mono: "JetBrains Mono Variable", "SF Mono", Consolas, monospace;
|
--font-mono: var(--font-jetbrains);
|
||||||
|
|
||||||
/* Sizing */
|
/* Sizing */
|
||||||
--header-height: 4rem;
|
--header-height: 4rem;
|
||||||
@@ -149,7 +149,7 @@ html {
|
|||||||
background-color: theme(colors.neutral.900);
|
background-color: theme(colors.neutral.900);
|
||||||
}
|
}
|
||||||
|
|
||||||
pre > code {
|
pre>code {
|
||||||
background-color: transparent !important;
|
background-color: transparent !important;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
font-size: 0.875rem;
|
font-size: 0.875rem;
|
||||||
@@ -212,6 +212,26 @@ html {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Keyframe animations - defined outside layers for proper cascade */
|
/* Keyframe animations - defined outside layers for proper cascade */
|
||||||
|
@keyframes clause-highlight-pulse {
|
||||||
|
0% {
|
||||||
|
background-color: theme(colors.sky.500 / 15%);
|
||||||
|
}
|
||||||
|
|
||||||
|
100% {
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes clause-highlight-pulse-dark {
|
||||||
|
0% {
|
||||||
|
background-color: theme(colors.sky.700 / 20%);
|
||||||
|
}
|
||||||
|
|
||||||
|
100% {
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@keyframes fade-in {
|
@keyframes fade-in {
|
||||||
from {
|
from {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
@@ -259,6 +279,7 @@ html {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@keyframes bounce-subtle {
|
@keyframes bounce-subtle {
|
||||||
|
|
||||||
0%,
|
0%,
|
||||||
100% {
|
100% {
|
||||||
transform: translateY(0);
|
transform: translateY(0);
|
||||||
@@ -329,6 +350,7 @@ html {
|
|||||||
|
|
||||||
/* Component styles */
|
/* Component styles */
|
||||||
@layer components {
|
@layer components {
|
||||||
|
|
||||||
/* Section container - uses CSS vars, keep here */
|
/* Section container - uses CSS vars, keep here */
|
||||||
.section-container {
|
.section-container {
|
||||||
max-width: calc(var(--content-max-width) + var(--sidebar-width) + 4rem);
|
max-width: calc(var(--content-max-width) + var(--sidebar-width) + 4rem);
|
||||||
@@ -378,11 +400,11 @@ html {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.prose-spec strong {
|
.prose-spec strong {
|
||||||
color: theme(colors.slate.950);
|
color: theme(colors.neutral.700);
|
||||||
}
|
}
|
||||||
|
|
||||||
.dark .prose-spec strong {
|
.dark .prose-spec strong {
|
||||||
color: theme(colors.neutral.50);
|
color: theme(colors.neutral.300);
|
||||||
}
|
}
|
||||||
|
|
||||||
.prose-spec li {
|
.prose-spec li {
|
||||||
@@ -393,19 +415,20 @@ html {
|
|||||||
color: theme(colors.neutral.400);
|
color: theme(colors.neutral.400);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Nested ordered list counters (spec numbering: 1., 1.1., 1.2.) */
|
/* Spec clauses - ordered list with CSS counters and hover anchor links */
|
||||||
.prose-spec ol {
|
.prose-spec ol {
|
||||||
padding-left: 2.5rem;
|
padding-left: 2.25rem;
|
||||||
counter-reset: item;
|
counter-reset: item;
|
||||||
list-style: none;
|
list-style: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.prose-spec ol > li {
|
.prose-spec ol>li {
|
||||||
counter-increment: item;
|
counter-increment: item;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
margin-bottom: 0.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.prose-spec ol > li::before {
|
.prose-spec ol>li::before {
|
||||||
content: counters(item, ".") ".";
|
content: counters(item, ".") ".";
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: -2.5rem;
|
left: -2.5rem;
|
||||||
@@ -415,10 +438,72 @@ html {
|
|||||||
color: theme(colors.slate.400);
|
color: theme(colors.slate.400);
|
||||||
}
|
}
|
||||||
|
|
||||||
.dark .prose-spec ol > li::before {
|
.dark .prose-spec ol>li::before {
|
||||||
color: theme(colors.neutral.500);
|
color: theme(colors.neutral.500);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Clause highlight effect using ::after pseudo-element */
|
||||||
|
.prose-spec ol>li::after {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
inset: -0.25rem -0.5rem;
|
||||||
|
left: -2.75rem;
|
||||||
|
background-color: transparent;
|
||||||
|
border-radius: 4px;
|
||||||
|
pointer-events: none;
|
||||||
|
z-index: -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.prose-spec ol>li.clause-highlight::after {
|
||||||
|
animation: clause-highlight-pulse 2s ease-out forwards;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dark .prose-spec ol>li.clause-highlight::after {
|
||||||
|
animation: clause-highlight-pulse-dark 2s ease-out forwards;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Anchor link with clause number - hidden by default, shown on hover */
|
||||||
|
.prose-spec .clause-link {
|
||||||
|
position: absolute;
|
||||||
|
right: 100%;
|
||||||
|
padding-right: 0.5rem;
|
||||||
|
font-weight: 500;
|
||||||
|
color: theme(colors.slate.400);
|
||||||
|
text-decoration: none;
|
||||||
|
opacity: 0;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 0.25rem;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dark .prose-spec .clause-link {
|
||||||
|
color: theme(colors.neutral.500);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Link icon in the anchor link */
|
||||||
|
.prose-spec .clause-link-icon {
|
||||||
|
flex-shrink: 0;
|
||||||
|
width: 0.875rem;
|
||||||
|
height: 0.875rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* On hover: show anchor link, hide CSS counter */
|
||||||
|
.prose-spec ol>li:hover:not(:has(ol:hover))>.clause-link,
|
||||||
|
.prose-spec ol>li:hover:not(:has(ol:hover))>p>.clause-link,
|
||||||
|
.prose-spec .clause-link:hover {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.prose-spec ol>li:hover:not(:has(ol:hover))::before {
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Hover color for clause anchor link */
|
||||||
|
.prose-spec .clause-link:hover {
|
||||||
|
color: theme(colors.sky.500);
|
||||||
|
}
|
||||||
|
|
||||||
.prose-spec img {
|
.prose-spec img {
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
height: auto;
|
height: auto;
|
||||||
|
|||||||
@@ -6,7 +6,9 @@ import { unified } from "unified";
|
|||||||
import remarkParse from "remark-parse";
|
import remarkParse from "remark-parse";
|
||||||
import remarkRehype from "remark-rehype";
|
import remarkRehype from "remark-rehype";
|
||||||
import rehypeStringify from "rehype-stringify";
|
import rehypeStringify from "rehype-stringify";
|
||||||
import type { Root, RootContent, Heading, List, ListItem } from "mdast";
|
import { getIconData, iconToSVG, iconToHTML } from "@iconify/utils";
|
||||||
|
import heroicons from "@iconify-json/heroicons/icons.json";
|
||||||
|
import type { Root, RootContent, Heading, List, ListItem, Html } from "mdast";
|
||||||
import type { Root as HastRoot } from "hast";
|
import type { Root as HastRoot } from "hast";
|
||||||
|
|
||||||
export interface TocItem {
|
export interface TocItem {
|
||||||
@@ -30,7 +32,6 @@ export interface SpecSection {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface ParsedSpec {
|
export interface ParsedSpec {
|
||||||
svgPath: string;
|
|
||||||
introduction: string;
|
introduction: string;
|
||||||
summary: string;
|
summary: string;
|
||||||
terminology: string;
|
terminology: string;
|
||||||
@@ -54,6 +55,23 @@ function slugify(text: string): string {
|
|||||||
.trim();
|
.trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generate link icon SVG from heroicons icon set
|
||||||
|
*/
|
||||||
|
function generateLinkIconSvg(): string {
|
||||||
|
const iconData = getIconData(heroicons, "link");
|
||||||
|
if (!iconData) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
const result = iconToSVG(iconData);
|
||||||
|
return iconToHTML(result.body, {
|
||||||
|
...result.attributes,
|
||||||
|
class: "clause-link-icon",
|
||||||
|
stroke: "currentColor",
|
||||||
|
"stroke-width": "2",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
type MdastNode = Root | RootContent;
|
type MdastNode = Root | RootContent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -186,11 +204,12 @@ function findSpecSections(nodes: RootContent[]): SpecSection[] {
|
|||||||
const titles = extractListItemTitles(node as List);
|
const titles = extractListItemTitles(node as List);
|
||||||
for (let i = 0; i < titles.length; i++) {
|
for (let i = 0; i < titles.length; i++) {
|
||||||
const title = titles[i];
|
const title = titles[i];
|
||||||
|
const clauseNum = i + 1;
|
||||||
sections.push({
|
sections.push({
|
||||||
id: `spec-${slugify(title)}`,
|
id: `clause-${clauseNum}`,
|
||||||
title,
|
title,
|
||||||
content: "",
|
content: "",
|
||||||
clause: `${i + 1}.`,
|
clause: `${clauseNum}.`,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
break; // Only process first ordered list
|
break; // Only process first ordered list
|
||||||
@@ -201,33 +220,45 @@ function findSpecSections(nodes: RootContent[]): SpecSection[] {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add anchor IDs to list items in the spec ordered list
|
* Add anchor IDs and links to ordered list items recursively.
|
||||||
|
* Injects an invisible anchor link before content for hover-to-reveal behavior.
|
||||||
*/
|
*/
|
||||||
function addAnchorsToList(list: List, sections: SpecSection[]): void {
|
function addClauseAnchors(list: List, prefix: string = ""): void {
|
||||||
const titleMap = new Map(sections.map((s) => [s.title, s.id]));
|
for (let i = 0; i < list.children.length; i++) {
|
||||||
|
const item = list.children[i];
|
||||||
for (const item of list.children) {
|
|
||||||
if (item.type !== "listItem") continue;
|
if (item.type !== "listItem") continue;
|
||||||
|
|
||||||
// Get the title of this item
|
// Calculate clause number and ID
|
||||||
let title = "";
|
const clauseNum = prefix ? `${prefix}.${i + 1}` : `${i + 1}`;
|
||||||
|
const clauseId = `clause-${clauseNum.replace(/\./g, "-")}`;
|
||||||
|
|
||||||
|
// Add ID to the list item via hProperties
|
||||||
|
(item as ListItem & { data?: { hProperties?: { id?: string } } }).data = {
|
||||||
|
hProperties: { id: clauseId },
|
||||||
|
};
|
||||||
|
|
||||||
|
// Find the first paragraph in the item and prepend an anchor link
|
||||||
for (const child of item.children) {
|
for (const child of item.children) {
|
||||||
if (child.type === "list") break;
|
|
||||||
if (child.type === "paragraph") {
|
if (child.type === "paragraph") {
|
||||||
title = extractText(child).split("\n")[0].trim();
|
// Create anchor link HTML with clause number text and link icon
|
||||||
|
const linkIcon = generateLinkIconSvg();
|
||||||
|
const anchorHtml: Html = {
|
||||||
|
type: "html",
|
||||||
|
value: `<a href="#${clauseId}" class="clause-link" aria-hidden="true">${linkIcon}${clauseNum}.</a>`,
|
||||||
|
};
|
||||||
|
// Prepend anchor to paragraph children
|
||||||
|
(child as { children: RootContent[] }).children.unshift(
|
||||||
|
anchorHtml as unknown as RootContent,
|
||||||
|
);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
title += extractText(child);
|
|
||||||
}
|
}
|
||||||
title = title.split("\n")[0].trim();
|
|
||||||
|
|
||||||
// Add ID as data attribute (will be processed by rehype)
|
// Recursively process nested ordered lists
|
||||||
const id = titleMap.get(title);
|
for (const child of item.children) {
|
||||||
if (id) {
|
if (child.type === "list" && (child as List).ordered) {
|
||||||
// Add hProperties for rehype to convert to HTML id attribute
|
addClauseAnchors(child as List, clauseNum);
|
||||||
(item as ListItem & { data?: { hProperties?: { id?: string } } }).data = {
|
}
|
||||||
hProperties: { id },
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -308,20 +339,13 @@ function buildTocItems(parsed: Partial<ParsedSpec>): TocItem[] {
|
|||||||
*/
|
*/
|
||||||
export async function parseSpecContent(
|
export async function parseSpecContent(
|
||||||
markdown: string,
|
markdown: string,
|
||||||
version: string,
|
|
||||||
): Promise<ParsedSpec> {
|
): Promise<ParsedSpec> {
|
||||||
const svgPath = `/spec/${version}.svg`;
|
|
||||||
|
|
||||||
// Parse markdown to AST
|
// Parse markdown to AST
|
||||||
const tree = unified().use(remarkParse).parse(markdown) as Root;
|
const tree = unified().use(remarkParse).parse(markdown) as Root;
|
||||||
|
|
||||||
// Remove title (h1) and SVG image from the tree
|
// Remove title (h1) from the tree - it's displayed separately in the Hero
|
||||||
const nodes = tree.children.filter((node) => {
|
const nodes = tree.children.filter((node) => {
|
||||||
if (node.type === "heading" && (node as Heading).depth === 1) return false;
|
if (node.type === "heading" && (node as Heading).depth === 1) return false;
|
||||||
if (node.type === "paragraph") {
|
|
||||||
const text = extractText(node);
|
|
||||||
if (text.includes(".svg")) return false;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -343,10 +367,10 @@ export async function parseSpecContent(
|
|||||||
// Extract spec sections from the first ordered list
|
// Extract spec sections from the first ordered list
|
||||||
const specSections = findSpecSections(specNodes);
|
const specSections = findSpecSections(specNodes);
|
||||||
|
|
||||||
// Add anchor IDs to spec list items
|
// Add anchor IDs and links to spec list items
|
||||||
for (const node of specNodes) {
|
for (const node of specNodes) {
|
||||||
if (node.type === "list" && (node as List).ordered) {
|
if (node.type === "list" && (node as List).ordered) {
|
||||||
addAnchorsToList(node as List, specSections);
|
addClauseAnchors(node as List);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -395,7 +419,6 @@ export async function parseSpecContent(
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
const parsed: ParsedSpec = {
|
const parsed: ParsedSpec = {
|
||||||
svgPath,
|
|
||||||
introduction,
|
introduction,
|
||||||
summary,
|
summary,
|
||||||
terminology,
|
terminology,
|
||||||
|
|||||||
48
src/utils/versions.ts
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
import { getCollection } from "astro:content";
|
||||||
|
import * as semver from "semver";
|
||||||
|
import { config } from "../config";
|
||||||
|
|
||||||
|
export interface VersionInfo {
|
||||||
|
versions: string[];
|
||||||
|
currentVersion: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get version information derived from available spec files.
|
||||||
|
* Returns all versions sorted newest-first and determines the current version.
|
||||||
|
*/
|
||||||
|
export async function getVersionInfo(): Promise<VersionInfo> {
|
||||||
|
const specs = await getCollection("spec");
|
||||||
|
const versions = specs
|
||||||
|
.map((s) => s.data.version)
|
||||||
|
.filter((v): v is string => semver.valid(v) !== null)
|
||||||
|
.sort((a, b) => semver.rcompare(a, b)); // newest first
|
||||||
|
|
||||||
|
const currentVersion =
|
||||||
|
config.currentVersionOverride ?? determineCurrentVersion(versions);
|
||||||
|
|
||||||
|
return { versions, currentVersion };
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determine the current version based on priority:
|
||||||
|
* 1. Latest stable version
|
||||||
|
* 2. Latest RC version
|
||||||
|
* 3. Newest available version
|
||||||
|
*/
|
||||||
|
function determineCurrentVersion(versions: string[]): string {
|
||||||
|
// Priority order: stable (null prerelease) first, then rc
|
||||||
|
const priority: (string | null)[] = [null, "rc"];
|
||||||
|
|
||||||
|
for (const type of priority) {
|
||||||
|
const match = versions.find((v) => {
|
||||||
|
const pre = semver.prerelease(v);
|
||||||
|
if (type === null) return pre === null;
|
||||||
|
return pre?.[0] === type;
|
||||||
|
});
|
||||||
|
if (match) return match;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fallback to newest overall
|
||||||
|
return versions[0] ?? "";
|
||||||
|
}
|
||||||
@@ -1,5 +1,10 @@
|
|||||||
{
|
{
|
||||||
"extends": "astro/tsconfigs/strict",
|
"extends": "astro/tsconfigs/strict",
|
||||||
"include": [".astro/types.d.ts", "**/*"],
|
"include": [
|
||||||
"exclude": ["dist", "docs"]
|
".astro/types.d.ts",
|
||||||
|
"**/*"
|
||||||
|
],
|
||||||
|
"exclude": [
|
||||||
|
"dist"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
7
wrangler.jsonc
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"name": "commonflow-org",
|
||||||
|
"compatibility_date": "2026-01-12",
|
||||||
|
"assets": {
|
||||||
|
"directory": "./dist"
|
||||||
|
}
|
||||||
|
}
|
||||||