git 5.0.0.beta.3 → 5.0.0.beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.dockerignore +27 -0
- data/.github/copilot-instructions.md +3 -8
- data/.github/hooks/bin-setup-on-worktree.json +11 -0
- data/.github/hooks/run-bin-setup-once.sh +14 -0
- data/.github/skills/breaking-change-analysis/SKILL.md +6 -9
- data/.github/skills/ci-cd-troubleshooting/SKILL.md +2 -2
- data/.github/skills/command-implementation/REFERENCE.md +34 -33
- data/.github/skills/command-implementation/SKILL.md +5 -4
- data/.github/skills/command-test-conventions/SKILL.md +13 -9
- data/.github/skills/command-yard-documentation/SKILL.md +14 -6
- data/.github/skills/development-workflow/SKILL.md +20 -14
- data/.github/skills/facade-implementation/REFERENCE.md +19 -22
- data/.github/skills/facade-implementation/SKILL.md +0 -5
- data/.github/skills/facade-test-conventions/SKILL.md +4 -7
- data/.github/skills/facade-yard-documentation/SKILL.md +8 -2
- data/.github/skills/make-skill-template/SKILL.md +53 -3
- data/.github/skills/pr-readiness-review/SKILL.md +22 -2
- data/.github/skills/project-context/SKILL.md +16 -23
- data/.github/skills/pull-request-review/SKILL.md +2 -2
- data/.github/skills/rebase/SKILL.md +148 -0
- data/.github/skills/refactor-command-to-commandlineresult/SKILL.md +1 -1
- data/.github/skills/resolve-feedback/SKILL.md +288 -0
- data/.github/skills/review-arguments-dsl/CHECKLIST.md +3 -3
- data/.github/skills/reviewing-skills/SKILL.md +28 -3
- data/.github/skills/test-debugging/SKILL.md +20 -19
- data/.github/skills/yard-documentation/SKILL.md +671 -483
- data/.github/skills/yard-documentation/element-rules.md +162 -0
- data/.github/skills-deprecated/README.md +21 -0
- data/.github/{skills → skills-deprecated}/extract-command-from-lib/SKILL.md +9 -9
- data/.github/{skills → skills-deprecated}/extract-facade-from-base-lib/SKILL.md +12 -12
- data/.github/workflows/continuous_integration.yml +3 -2
- data/.rubocop.yml +7 -39
- data/.yard-lint.yml +75 -0
- data/CONTRIBUTING.md +186 -174
- data/Gemfile +17 -0
- data/README.md +47 -12
- data/Rakefile +3 -21
- data/UPGRADING.md +219 -70
- data/docker/test/Dockerfile +32 -0
- data/docker/test/docker-compose.yml +0 -0
- data/git.gemspec +3 -4
- data/lib/git/author.rb +20 -1
- data/lib/git/branch.rb +26 -6
- data/lib/git/branch_delete_failure.rb +3 -0
- data/lib/git/branch_delete_result.rb +6 -3
- data/lib/git/branch_info.rb +6 -6
- data/lib/git/command_line/base.rb +6 -13
- data/lib/git/command_line/capturing.rb +67 -10
- data/lib/git/command_line/result.rb +0 -8
- data/lib/git/command_line/streaming.rb +45 -5
- data/lib/git/command_line.rb +4 -3
- data/lib/git/commands/add.rb +61 -53
- data/lib/git/commands/am/abort.rb +2 -2
- data/lib/git/commands/am/apply.rb +109 -98
- data/lib/git/commands/am/continue.rb +2 -2
- data/lib/git/commands/am/quit.rb +2 -2
- data/lib/git/commands/am/retry.rb +4 -2
- data/lib/git/commands/am/show_current_patch.rb +1 -1
- data/lib/git/commands/am/skip.rb +2 -2
- data/lib/git/commands/am.rb +2 -2
- data/lib/git/commands/apply.rb +7 -2
- data/lib/git/commands/archive/list_formats.rb +3 -3
- data/lib/git/commands/archive.rb +7 -2
- data/lib/git/commands/arguments.rb +1370 -359
- data/lib/git/commands/base.rb +111 -13
- data/lib/git/commands/branch/copy.rb +29 -21
- data/lib/git/commands/branch/create.rb +72 -68
- data/lib/git/commands/branch/delete.rb +25 -17
- data/lib/git/commands/branch/list.rb +76 -60
- data/lib/git/commands/branch/move.rb +29 -21
- data/lib/git/commands/branch/set_upstream.rb +8 -8
- data/lib/git/commands/branch/show_current.rb +3 -3
- data/lib/git/commands/branch/unset_upstream.rb +4 -8
- data/lib/git/commands/branch.rb +2 -2
- data/lib/git/commands/cat_file/batch.rb +36 -20
- data/lib/git/commands/cat_file/filtered.rb +12 -12
- data/lib/git/commands/cat_file/raw.rb +13 -13
- data/lib/git/commands/cat_file.rb +4 -4
- data/lib/git/commands/checkout/branch.rb +7 -5
- data/lib/git/commands/checkout/files.rb +5 -4
- data/lib/git/commands/checkout.rb +4 -4
- data/lib/git/commands/checkout_index.rb +5 -4
- data/lib/git/commands/clean.rb +6 -4
- data/lib/git/commands/clone.rb +5 -4
- data/lib/git/commands/commit.rb +5 -4
- data/lib/git/commands/commit_tree.rb +5 -4
- data/lib/git/commands/config_option_syntax/add.rb +7 -4
- data/lib/git/commands/config_option_syntax/get.rb +9 -5
- data/lib/git/commands/config_option_syntax/get_all.rb +7 -4
- data/lib/git/commands/config_option_syntax/get_color.rb +8 -4
- data/lib/git/commands/config_option_syntax/get_color_bool.rb +7 -4
- data/lib/git/commands/config_option_syntax/get_regexp.rb +8 -4
- data/lib/git/commands/config_option_syntax/get_urlmatch.rb +8 -4
- data/lib/git/commands/config_option_syntax/list.rb +8 -4
- data/lib/git/commands/config_option_syntax/remove_section.rb +7 -2
- data/lib/git/commands/config_option_syntax/rename_section.rb +7 -2
- data/lib/git/commands/config_option_syntax/replace_all.rb +7 -2
- data/lib/git/commands/config_option_syntax/set.rb +7 -2
- data/lib/git/commands/config_option_syntax/unset.rb +7 -4
- data/lib/git/commands/config_option_syntax/unset_all.rb +7 -2
- data/lib/git/commands/describe.rb +5 -4
- data/lib/git/commands/diff.rb +13 -12
- data/lib/git/commands/diff_files.rb +7 -6
- data/lib/git/commands/diff_index.rb +10 -7
- data/lib/git/commands/fetch.rb +6 -4
- data/lib/git/commands/fsck.rb +6 -4
- data/lib/git/commands/gc.rb +6 -4
- data/lib/git/commands/grep.rb +6 -5
- data/lib/git/commands/init.rb +6 -4
- data/lib/git/commands/log.rb +287 -285
- data/lib/git/commands/ls_files.rb +69 -65
- data/lib/git/commands/ls_remote.rb +62 -56
- data/lib/git/commands/ls_tree.rb +50 -46
- data/lib/git/commands/maintenance/register.rb +25 -23
- data/lib/git/commands/maintenance/run.rb +7 -2
- data/lib/git/commands/maintenance/start.rb +7 -2
- data/lib/git/commands/maintenance/stop.rb +7 -2
- data/lib/git/commands/maintenance/unregister.rb +7 -2
- data/lib/git/commands/merge/abort.rb +2 -2
- data/lib/git/commands/merge/continue.rb +2 -2
- data/lib/git/commands/merge/quit.rb +2 -2
- data/lib/git/commands/merge/start.rb +7 -2
- data/lib/git/commands/merge.rb +2 -2
- data/lib/git/commands/merge_base.rb +7 -2
- data/lib/git/commands/mv.rb +7 -2
- data/lib/git/commands/name_rev.rb +7 -2
- data/lib/git/commands/pull.rb +7 -2
- data/lib/git/commands/push.rb +7 -2
- data/lib/git/commands/read_tree.rb +7 -2
- data/lib/git/commands/remote/add.rb +7 -2
- data/lib/git/commands/remote/get_url.rb +4 -2
- data/lib/git/commands/remote/list.rb +4 -2
- data/lib/git/commands/remote/prune.rb +4 -2
- data/lib/git/commands/remote/remove.rb +4 -2
- data/lib/git/commands/remote/rename.rb +4 -2
- data/lib/git/commands/remote/set_branches.rb +9 -2
- data/lib/git/commands/remote/set_head.rb +12 -5
- data/lib/git/commands/remote/set_url.rb +9 -2
- data/lib/git/commands/remote/set_url_add.rb +11 -2
- data/lib/git/commands/remote/set_url_delete.rb +9 -2
- data/lib/git/commands/remote/show.rb +18 -12
- data/lib/git/commands/remote/update.rb +19 -12
- data/lib/git/commands/remote.rb +2 -2
- data/lib/git/commands/repack.rb +67 -63
- data/lib/git/commands/reset.rb +51 -44
- data/lib/git/commands/rev_parse.rb +135 -128
- data/lib/git/commands/revert/abort.rb +2 -2
- data/lib/git/commands/revert/continue.rb +7 -2
- data/lib/git/commands/revert/quit.rb +2 -2
- data/lib/git/commands/revert/skip.rb +2 -2
- data/lib/git/commands/revert/start.rb +7 -2
- data/lib/git/commands/revert.rb +2 -2
- data/lib/git/commands/rm.rb +35 -36
- data/lib/git/commands/show.rb +1 -1
- data/lib/git/commands/show_ref/exclude_existing.rb +3 -4
- data/lib/git/commands/show_ref/exists.rb +15 -13
- data/lib/git/commands/show_ref/list.rb +39 -35
- data/lib/git/commands/show_ref/verify.rb +29 -27
- data/lib/git/commands/show_ref.rb +4 -4
- data/lib/git/commands/stash/apply.rb +31 -25
- data/lib/git/commands/stash/branch.rb +10 -8
- data/lib/git/commands/stash/clear.rb +7 -5
- data/lib/git/commands/stash/create.rb +10 -8
- data/lib/git/commands/stash/drop.rb +15 -9
- data/lib/git/commands/stash/list.rb +9 -5
- data/lib/git/commands/stash/pop.rb +21 -12
- data/lib/git/commands/stash/push.rb +20 -11
- data/lib/git/commands/stash/show.rb +21 -12
- data/lib/git/commands/stash/store.rb +19 -10
- data/lib/git/commands/stash.rb +2 -2
- data/lib/git/commands/status.rb +7 -2
- data/lib/git/commands/symbolic_ref/delete.rb +18 -14
- data/lib/git/commands/symbolic_ref/read.rb +24 -20
- data/lib/git/commands/symbolic_ref/update.rb +20 -17
- data/lib/git/commands/symbolic_ref.rb +4 -4
- data/lib/git/commands/tag/create.rb +45 -42
- data/lib/git/commands/tag/delete.rb +5 -3
- data/lib/git/commands/tag/list.rb +47 -44
- data/lib/git/commands/tag/verify.rb +12 -12
- data/lib/git/commands/tag.rb +2 -2
- data/lib/git/commands/update_ref/batch.rb +6 -1
- data/lib/git/commands/update_ref/delete.rb +19 -21
- data/lib/git/commands/update_ref/update.rb +22 -25
- data/lib/git/commands/update_ref.rb +4 -4
- data/lib/git/commands/version.rb +14 -11
- data/lib/git/commands/worktree/add.rb +50 -51
- data/lib/git/commands/worktree/list.rb +17 -17
- data/lib/git/commands/worktree/lock.rb +12 -12
- data/lib/git/commands/worktree/move.rb +16 -16
- data/lib/git/commands/worktree/prune.rb +2 -2
- data/lib/git/commands/worktree/remove.rb +2 -2
- data/lib/git/commands/worktree/repair.rb +2 -2
- data/lib/git/commands/worktree/unlock.rb +2 -2
- data/lib/git/commands/write_tree.rb +2 -2
- data/lib/git/commands.rb +4 -3
- data/lib/git/config.rb +47 -1
- data/lib/git/configuring.rb +89 -15
- data/lib/git/detached_head_info.rb +4 -1
- data/lib/git/diff.rb +2 -5
- data/lib/git/diff_file_numstat_info.rb +3 -1
- data/lib/git/diff_file_patch_info.rb +3 -1
- data/lib/git/diff_file_raw_info.rb +3 -1
- data/lib/git/diff_info.rb +8 -15
- data/lib/git/diff_path_status.rb +16 -3
- data/lib/git/diff_result.rb +3 -1
- data/lib/git/diff_stats.rb +15 -0
- data/lib/git/dirstat_info.rb +24 -8
- data/lib/git/encoding_utils.rb +32 -1
- data/lib/git/errors.rb +19 -9
- data/lib/git/escaped_path.rb +55 -3
- data/lib/git/execution_context/repository.rb +15 -0
- data/lib/git/execution_context.rb +76 -74
- data/lib/git/file_ref.rb +6 -3
- data/lib/git/fsck_object.rb +8 -0
- data/lib/git/fsck_result.rb +26 -15
- data/lib/git/log.rb +152 -5
- data/lib/git/object.rb +284 -8
- data/lib/git/parsers/branch.rb +18 -0
- data/lib/git/parsers/cat_file.rb +2 -2
- data/lib/git/parsers/diff.rb +213 -5
- data/lib/git/parsers/fsck.rb +11 -0
- data/lib/git/parsers/ls_remote.rb +1 -1
- data/lib/git/parsers/stash.rb +51 -0
- data/lib/git/parsers/tag.rb +38 -0
- data/lib/git/remote.rb +34 -2
- data/lib/git/repository/branching.rb +23 -21
- data/lib/git/repository/committing.rb +46 -6
- data/lib/git/repository/context_helpers.rb +45 -16
- data/lib/git/repository/diffing.rb +32 -23
- data/lib/git/repository/factories.rb +153 -28
- data/lib/git/repository/inspecting.rb +1 -1
- data/lib/git/repository/logging.rb +169 -30
- data/lib/git/repository/maintenance.rb +1 -1
- data/lib/git/repository/merging.rb +3 -3
- data/lib/git/repository/object_operations.rb +108 -14
- data/lib/git/repository/remote_operations.rb +150 -171
- data/lib/git/repository/shared_private.rb +7 -5
- data/lib/git/repository/staging.rb +36 -12
- data/lib/git/repository/stashing.rb +16 -16
- data/lib/git/repository/status_operations.rb +1 -1
- data/lib/git/repository/worktree_operations.rb +1 -1
- data/lib/git/repository.rb +123 -63
- data/lib/git/stash.rb +16 -21
- data/lib/git/stash_info.rb +4 -4
- data/lib/git/stashes.rb +20 -26
- data/lib/git/status.rb +21 -7
- data/lib/git/tag_delete_failure.rb +3 -0
- data/lib/git/tag_delete_result.rb +6 -3
- data/lib/git/tag_info.rb +1 -0
- data/lib/git/url.rb +12 -5
- data/lib/git/version.rb +6 -4
- data/lib/git/version_constraint.rb +4 -0
- data/lib/git.rb +398 -314
- data/redesign/3_architecture_implementation.md +59 -29
- data/redesign/Phase 4 - Step B.md +921 -0
- data/redesign/Phase 4 - Step C.md +833 -0
- data/redesign/c1a-public-api-scope.tsv +256 -0
- data/redesign/phase-4-step-b-test-audit.tsv +485 -0
- data/tasks/yard.rake +24 -17
- metadata +24 -57
- data/commitlint.test +0 -4
- data/lib/git/args_builder.rb +0 -103
- data/lib/git/command_line_result.rb +0 -8
- data/lib/git/deprecation.rb +0 -9
- data/tasks/test.rake +0 -25
- /data/.github/{skills → skills-deprecated}/extract-facade-from-base-lib/KEYWORD_ARG_REMEDIATION.md +0 -0
- /data/.github/{skills → skills-deprecated}/review-backward-compatibility/SKILL.md +0 -0
|
@@ -0,0 +1,833 @@
|
|
|
1
|
+
# Phase 4 / Step C — Update Documentation: Execution Plan
|
|
2
|
+
|
|
3
|
+
> **✅ Status: Complete — C1, C2, and C3 all complete.**
|
|
4
|
+
>
|
|
5
|
+
> **C1 (YARD audit) is fully complete:**
|
|
6
|
+
> - **C1a ✅** — Public API scope TSV produced at `redesign/c1a-public-api-scope.tsv`
|
|
7
|
+
> (255 rows: 42 public, 213 internal).
|
|
8
|
+
> - **C1b ✅** — All of `lib/` passes `bundle exec yard-lint lib/` with no offenses
|
|
9
|
+
> (`yardstick` retired in favor of `yard-lint`; the `rake yard:lint` alias is
|
|
10
|
+
> Ruby 3.3+ only).
|
|
11
|
+
> - **C1c ✅** — `@api` tags set for all 37 previously-unmarked internal constants
|
|
12
|
+
> (commit `83225f3f`).
|
|
13
|
+
> - **C1d ✅** — Coverage gate enforced by `yard-lint` + `.yard-lint.yml`; no PR needed.
|
|
14
|
+
>
|
|
15
|
+
> **C2 (guidance & README) is fully complete:**
|
|
16
|
+
> - **C2a ✅** — `UPGRADING.md` expanded with comprehensive v4.x → v5.0.0 migration
|
|
17
|
+
> guide: beta banner removed, ToC added, breaking-changes quick-reference table,
|
|
18
|
+
> `Git::Base` removal section with before/after examples (commit `fb66404a`).
|
|
19
|
+
> - **C2b ✅** — `README.md` updated: prominent `## Upgrading from v4.x to v5.0.0`
|
|
20
|
+
> section added, `UPGRADING.md` linked from the Deprecations section, outdated
|
|
21
|
+
> version-pinned install snippets removed, and ToC updated.
|
|
22
|
+
>
|
|
23
|
+
> **C3 (documentation completeness verification) is fully complete:**
|
|
24
|
+
> - **C3a ✅** — Full CI pipeline green: all unit and integration examples pass,
|
|
25
|
+
> 0 failures; `yard:lint` no offenses; 100.00% documented; gem builds.
|
|
26
|
+
> - **C3b ✅** — Manual spot-check of 10 key public-API classes passed; one gap
|
|
27
|
+
> found and fixed (`Git::Status` was missing a class-level `@example`).
|
|
28
|
+
> - **C3c ✅** — All internal file links in `README.md` and `UPGRADING.md` verified
|
|
29
|
+
> present; anchors resolve correctly; no stale `Git::Base`/`Git::Lib` references
|
|
30
|
+
> outside migration-guide context.
|
|
31
|
+
> - **C3d ✅** — Redesign tracker updated; Step C signed off.
|
|
32
|
+
|
|
33
|
+
- [Goal](#goal)
|
|
34
|
+
- [Done-When Criteria](#done-when-criteria)
|
|
35
|
+
- [Workstreams \& PR Granularity](#workstreams--pr-granularity)
|
|
36
|
+
- [PR Creation Protocol](#pr-creation-protocol)
|
|
37
|
+
- [C1a Results Storage](#c1a-results-storage)
|
|
38
|
+
- [C1 — Public API YARD Audit \& Coverage](#c1--public-api-yard-audit--coverage)
|
|
39
|
+
- [C1a — Identify public API scope](#c1a--identify-public-api-scope)
|
|
40
|
+
- [C1a Steps (executable)](#c1a-steps-executable)
|
|
41
|
+
- [Classification heuristics](#classification-heuristics)
|
|
42
|
+
- [C1b — Document all elements (already complete)](#c1b--document-all-elements-already-complete)
|
|
43
|
+
- [C1c — Set correct `@api` tags](#c1c--set-correct-api-tags)
|
|
44
|
+
- [C1d — Coverage gate (already complete)](#c1d--coverage-gate-already-complete)
|
|
45
|
+
- [C2 — Guidance \& README Update](#c2--guidance--readme-update)
|
|
46
|
+
- [C2a — Update `UPGRADING.md` (PR)](#c2a--update-upgradingmd-pr)
|
|
47
|
+
- [C2b — Update `README.md` (PR)](#c2b--update-readmemd-pr)
|
|
48
|
+
- [C3 — Documentation Completeness Verification](#c3--documentation-completeness-verification)
|
|
49
|
+
- [C3a — Run full CI pipeline](#c3a--run-full-ci-pipeline)
|
|
50
|
+
- [C3b — Manual documentation spot-check](#c3b--manual-documentation-spot-check)
|
|
51
|
+
- [C3c — Link validation](#c3c--link-validation)
|
|
52
|
+
- [C3d — Step C sign-off](#c3d--step-c-sign-off)
|
|
53
|
+
- [Resolved Decisions](#resolved-decisions)
|
|
54
|
+
- [YARD `@api private` scope](#yard-api-private-scope)
|
|
55
|
+
- [Topic module documentation](#topic-module-documentation)
|
|
56
|
+
- [README vs. UPGRADING split](#readme-vs-upgrading-split)
|
|
57
|
+
- [Documentation coverage bar](#documentation-coverage-bar)
|
|
58
|
+
- [Execution Notes](#execution-notes)
|
|
59
|
+
- [Sequencing \& Parallelization](#sequencing--parallelization)
|
|
60
|
+
- [RSpec for documentation examples](#rspec-for-documentation-examples)
|
|
61
|
+
- [Out of scope: gem release](#out-of-scope-gem-release)
|
|
62
|
+
- [File Checklist](#file-checklist)
|
|
63
|
+
- [Step C Completion Checklist (C3d)](#step-c-completion-checklist-c3d)
|
|
64
|
+
|
|
65
|
+
## Goal
|
|
66
|
+
|
|
67
|
+
Complete the documentation required for a stable v5.0.0 release:
|
|
68
|
+
|
|
69
|
+
1. ✅ **Done.** Ensure all **public-API classes and methods** have complete YARD
|
|
70
|
+
documentation with no gaps — enforced by `yard-lint`, which passes with no
|
|
71
|
+
offenses across `lib/`.
|
|
72
|
+
2. Mark all **internal classes** (`ExecutionContext`, `Commands::*`, `Path*`,
|
|
73
|
+
`Parser*`) with `@api private` to signal they are not part of the stable
|
|
74
|
+
public contract.
|
|
75
|
+
3. Provide **migration guidance** via `UPGRADING.md` explaining all v5.0.0
|
|
76
|
+
breaking changes and how to migrate from v4.x.
|
|
77
|
+
4. Update **`README.md`** to reflect the new public entry points
|
|
78
|
+
(`Git`, `Git::Repository`, etc.) and link to the migration guide.
|
|
79
|
+
|
|
80
|
+
Source of truth in the implementation tracker:
|
|
81
|
+
[`3_architecture_implementation.md`](3_architecture_implementation.md) →
|
|
82
|
+
"Phase 4 → Step C — Update documentation".
|
|
83
|
+
|
|
84
|
+
This is the final step of Phase 4, following [Step A](Phase%204%20-%20Step%20A.md)
|
|
85
|
+
(remove old code) and [Step B](Phase%204%20-%20Step%20B.md) (finalize test suite).
|
|
86
|
+
All breaking changes are complete; this step documents them for users.
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## Done-When Criteria
|
|
91
|
+
|
|
92
|
+
- ✅ **Documentation coverage is complete and enforced by `yard-lint`.**
|
|
93
|
+
`yardstick` has been retired; `bundle exec rake yard:lint` (which runs
|
|
94
|
+
`bundle exec yard-lint lib/`) passes with **no offenses**. `yard-lint` lints
|
|
95
|
+
every object — including Ruby-private and protected ones (`--private
|
|
96
|
+
--protected`) — and enforces the project's documentation standard from
|
|
97
|
+
`.github/skills/yard-documentation/SKILL.md`: a summary, documented parameters
|
|
98
|
+
and return values, example formatting/title rules when examples exist, and tag
|
|
99
|
+
ordering/style rules.
|
|
100
|
+
Configuration lives in `.yard-lint.yml`; there is **no** `.yard-lint-todo.yml`
|
|
101
|
+
baseline, so nothing is grandfathered. (The skill's generic baseline-removal
|
|
102
|
+
guidance is not applicable in this repo because no baseline file exists.)
|
|
103
|
+
- `@api private` is a **stability/visibility signal** (it marks internal
|
|
104
|
+
implementation detail that users must not depend on); it is **not** a
|
|
105
|
+
documentation exemption. Internal classes are documented too.
|
|
106
|
+
- ✅ **The bar is 100% documented — zero undocumented objects — enforced
|
|
107
|
+
per-object.** `yard-lint`'s `Documentation/UndocumentedObjects` validator (on by
|
|
108
|
+
default at `warning` severity) combined with `.yard-lint.yml`'s
|
|
109
|
+
`FailOnSeverity: convention` fails the build on **any** undocumented object, which
|
|
110
|
+
holds the line at 100%. This per-object gate is the source of truth, not a
|
|
111
|
+
percentage: it gives a bright line and names the exact object that needs docs, so
|
|
112
|
+
contributor friction is handled by actionable feedback and maintainer discretion
|
|
113
|
+
rather than by leaving slack in a threshold. The `MinCoverage` setting (currently
|
|
114
|
+
`75.0`) is only a coarse secondary backstop; the per-object validator is strictly
|
|
115
|
+
stricter. `bundle exec rake yard:build` reports **100.00% documented** — an
|
|
116
|
+
informational cross-check, not the enforced gate.
|
|
117
|
+
- `bundle exec rake yard:build` passes with no warnings. The `--fail-on-warning`
|
|
118
|
+
flag lives in `.yardopts` (which `yard:build` reads), not in the rake task
|
|
119
|
+
itself, so undocumented-object and other YARD warnings fail the build. Use
|
|
120
|
+
`bundle exec yard-lint lib/` (optionally `--stats` or `--diff main`) as the
|
|
121
|
+
diagnostic to locate any gaps.
|
|
122
|
+
- `UPGRADING.md` exists (already done) and comprehensively covers:
|
|
123
|
+
- Breaking change overview (v4.x → v5.0.0).
|
|
124
|
+
- Old entry points (`Git::Base`, `Git::Lib`) and their replacements
|
|
125
|
+
(`Git::Repository` via `Git.open`, etc.).
|
|
126
|
+
- Common migration patterns (command usage, return types, error handling).
|
|
127
|
+
- Any deprecated methods still available for transitional use.
|
|
128
|
+
- `README.md` is updated to:
|
|
129
|
+
- Prominently show the new public entry points (`Git`, `Git::Repository`).
|
|
130
|
+
- Link to `UPGRADING.md` for migration guidance.
|
|
131
|
+
- Include examples using the new `Git::Repository` facade layer.
|
|
132
|
+
- Remove or contextualize any outdated references to `Git::Base` / `Git::Lib`.
|
|
133
|
+
- No **runtime or tooling references** to old code paths remain in the main
|
|
134
|
+
library documentation — only CHANGELOG, historical design docs, and deprecated
|
|
135
|
+
skill stubs (if any) may mention old classes contextually.
|
|
136
|
+
- Full CI pipeline (RSpec + YARD + linters) is green.
|
|
137
|
+
- **Out of scope:** the actual v5.0.0 gem release (CHANGELOG finalization, `v5.0.0`
|
|
138
|
+
tag, `gem build`/`push`, GitHub release notes). Step C ends at docs-complete + CI
|
|
139
|
+
green and hands off to the separate release process.
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## Workstreams & PR Granularity
|
|
144
|
+
|
|
145
|
+
This step is organized into workstreams, each with **one PR per substep** for finer-grained reviews:
|
|
146
|
+
|
|
147
|
+
- **C1a: Identify Public API Scope** — ✅ **done** (`redesign/c1a-public-api-scope.tsv` produced)
|
|
148
|
+
- **C1b: Document All Elements** — ✅ **already done** (all of `lib/` passes
|
|
149
|
+
`yard-lint`; no PR needed)
|
|
150
|
+
- **C1c: Set Correct @api Tags (incl. flip topic modules to private)** — ✅ **done**
|
|
151
|
+
(commit `83225f3f`; all 37 previously-unmarked internal constants tagged)
|
|
152
|
+
- **C1d: Coverage Gate** — ✅ **already done** (`yard-lint` + `.yard-lint.yml`
|
|
153
|
+
replaced the retired `yardstick` gate and pass; no PR needed)
|
|
154
|
+
- **C2a: Update UPGRADING.md** — ✅ **done** (beta banner removed, ToC added,
|
|
155
|
+
breaking-changes quick-reference table, `Git::Base` removal section with
|
|
156
|
+
before/after examples; commit `fb66404a`)
|
|
157
|
+
- **C2b: Update README.md** — ✅ **done** (prominent upgrade section added,
|
|
158
|
+
`UPGRADING.md` linked from Deprecations, outdated version-pinned install snippets removed)
|
|
159
|
+
- **C3: Documentation Completeness Verification** (1 PR)
|
|
160
|
+
|
|
161
|
+
Dependencies (remaining): C3 only. (C1a–C1d, C2a, and C2b are all complete.)
|
|
162
|
+
|
|
163
|
+
**Documentation skill requirements:** Any remaining PR that touches YARD
|
|
164
|
+
comments must apply the
|
|
165
|
+
[yard-documentation](../.github/skills/yard-documentation/SKILL.md) skill to all
|
|
166
|
+
YARD comments changed or added. Additionally:
|
|
167
|
+
|
|
168
|
+
- For `Git::Commands::*` classes, also apply the
|
|
169
|
+
[command-yard-documentation](../.github/skills/command-yard-documentation/SKILL.md) skill
|
|
170
|
+
- For `Git::Repository::*` facade methods, also apply the
|
|
171
|
+
[facade-yard-documentation](../.github/skills/facade-yard-documentation/SKILL.md) skill
|
|
172
|
+
|
|
173
|
+
```mermaid
|
|
174
|
+
graph LR
|
|
175
|
+
C1a["C1a: Identify Scope"]
|
|
176
|
+
C1b["C1b: Add Docs (done)"]
|
|
177
|
+
C1c["C1c: Mark Private (done)"]
|
|
178
|
+
C1d["C1d: Coverage Gate (done)"]
|
|
179
|
+
C2a["C2a: UPGRADING"]
|
|
180
|
+
C2b["C2b: README"]
|
|
181
|
+
C3["C3: Docs Verification"]
|
|
182
|
+
|
|
183
|
+
%% All C1 steps are complete; C2a/C2b gate C3:
|
|
184
|
+
C2a --> C3
|
|
185
|
+
C2b --> C3
|
|
186
|
+
|
|
187
|
+
%% Already-satisfied historical dependencies:
|
|
188
|
+
C1a -.-> C1b
|
|
189
|
+
C1b -.-> C1c
|
|
190
|
+
C1a -.-> C1c
|
|
191
|
+
C1c -.-> C3
|
|
192
|
+
C1d -.-> C3
|
|
193
|
+
|
|
194
|
+
classDef done fill:#e6ffe6,stroke:#2e7d32;
|
|
195
|
+
class C1a,C1b,C1c,C1d done;
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
---
|
|
199
|
+
|
|
200
|
+
## PR Creation Protocol
|
|
201
|
+
|
|
202
|
+
All Step C PRs are created in **`ruby-git/ruby-git`** and target base branch
|
|
203
|
+
**`main`**. Use one PR per substep from the granularity list above.
|
|
204
|
+
|
|
205
|
+
- Create a dedicated topic branch per substep (for example:
|
|
206
|
+
`docs/phase-4-step-c-c1a-scope`).
|
|
207
|
+
- Open each PR with `gh pr create` after pushing that topic branch.
|
|
208
|
+
- Keep each PR scoped to the substep's deliverables:
|
|
209
|
+
- **C1a PR:** `redesign/c1a-public-api-scope.tsv` (and only minimal related plan/tracker
|
|
210
|
+
adjustments if strictly required for accuracy).
|
|
211
|
+
- **C1b PR:** ✅ already complete — all of `lib/**/*.rb` passes `yard-lint`, so
|
|
212
|
+
no documentation-coverage PR is required.
|
|
213
|
+
- **C1c PR:** correct `@api` tags in `lib/**/*.rb` for every element per the C1a
|
|
214
|
+
TSV, including flipping the `Git::Repository::*` topic modules that are
|
|
215
|
+
currently `@api public` to `@api private`.
|
|
216
|
+
- **C1d PR:** ✅ already complete — `yardstick` was retired in favor of
|
|
217
|
+
`yard-lint` (`.yard-lint.yml` + `rake yard:lint`), which passes; no
|
|
218
|
+
coverage-gate PR is required.
|
|
219
|
+
- **C2a PR:** `UPGRADING.md` updates only.
|
|
220
|
+
- **C2b PR:** `README.md` updates only.
|
|
221
|
+
- **C3 PR:** verification/sign-off updates only (for example Step C completion
|
|
222
|
+
tracking in `redesign/3_architecture_implementation.md`).
|
|
223
|
+
|
|
224
|
+
If verification discovers additional documentation defects, fix them in the
|
|
225
|
+
appropriate workstream PR (C1* or C2*) rather than broadening C3 scope.
|
|
226
|
+
|
|
227
|
+
---
|
|
228
|
+
|
|
229
|
+
## C1a Results Storage
|
|
230
|
+
|
|
231
|
+
The results of C1a (public API scope identification) will be stored in:
|
|
232
|
+
|
|
233
|
+
```text
|
|
234
|
+
redesign/c1a-public-api-scope.tsv
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
This TSV file will contain columns:
|
|
238
|
+
|
|
239
|
+
- `constant_name` — fully qualified class or module name
|
|
240
|
+
- `type` — "class" or "module" (C1a is scoped to classes and modules only; methods are not included)
|
|
241
|
+
- `scope` — "public" or "internal"
|
|
242
|
+
- `category` — e.g. "entry-point", "return-type", "value-object", "topic-module",
|
|
243
|
+
"command-wrapper", "parser", "plumbing", "state-object", etc.
|
|
244
|
+
- `api_private_current` — "yes" or "no": whether `@api private` is already applied
|
|
245
|
+
(drives the C1c gap-fill so it only touches what's still unmarked)
|
|
246
|
+
- `defining_file` — path to the file where the constant is defined (e.g.,
|
|
247
|
+
`lib/git/object.rb` for `Git::Object::Blob`)
|
|
248
|
+
- `notes` — any relevant context or classification rationale. A note may also
|
|
249
|
+
carry an **actionable instruction** for a later phase, prefixed with the phase
|
|
250
|
+
name (e.g. `C1c action: ...`); the consuming phase must read and follow it.
|
|
251
|
+
|
|
252
|
+
Subsequent PRs (C1b, C1c, C1d) will reference this file to understand the scope
|
|
253
|
+
decisions made in C1a. The file serves as the source of truth for public vs.
|
|
254
|
+
internal classification.
|
|
255
|
+
|
|
256
|
+
---
|
|
257
|
+
|
|
258
|
+
## C1 — Public API YARD Audit & Coverage
|
|
259
|
+
|
|
260
|
+
**Goal:** Verify all public-API classes and methods have complete documentation;
|
|
261
|
+
mark internal classes with `@api private`.
|
|
262
|
+
|
|
263
|
+
### C1a — Identify public API scope
|
|
264
|
+
|
|
265
|
+
**Goal:** Produce a complete, authoritative classification of every class/module
|
|
266
|
+
in `lib/` as either **public** (part of the stable v5.0.0 contract) or **internal**
|
|
267
|
+
(`@api private`). This classification is the source of truth consumed by C1b, C1c,
|
|
268
|
+
and C1d.
|
|
269
|
+
|
|
270
|
+
> **⚠️ The lists below are ILLUSTRATIVE, not exhaustive.** The C1a agent MUST
|
|
271
|
+
> enumerate the real set of classes/modules via tooling (`yard list`) and classify
|
|
272
|
+
> every entry — do not treat these lists as complete. Many public value objects are
|
|
273
|
+
> not named here (e.g., `Git::Author`, `Git::Branches`, `Git::Stash`,
|
|
274
|
+
> `Git::Worktree`, `Git::Url`, `Git::FileRef`, and numerous `*Info`/`*Result`
|
|
275
|
+
> objects), and the majority of internal classes are `Git::Commands::*` and parser
|
|
276
|
+
> classes.
|
|
277
|
+
|
|
278
|
+
#### C1a Steps (executable)
|
|
279
|
+
|
|
280
|
+
1. **Enumerate all top-level and nested constants.** Generate the full class/module
|
|
281
|
+
inventory with YARD:
|
|
282
|
+
|
|
283
|
+
```bash
|
|
284
|
+
bundle exec yard list --query 'object.type == :class || object.type == :module'
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
(Or parse `bundle exec yard stats --list-undoc` output.) Cross-check
|
|
288
|
+
against the file tree (Ruby is cross-platform; `find` is not available in a
|
|
289
|
+
default Windows shell):
|
|
290
|
+
|
|
291
|
+
```bash
|
|
292
|
+
ruby -e "puts Dir.glob('lib/**/*.rb').sort"
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
2. **Classify each constant** as `public` or `internal` using the heuristics below.
|
|
296
|
+
3. **Detect current `@api private` state per constant** so C1c knows what still
|
|
297
|
+
needs marking. Query YARD for every object that already carries an
|
|
298
|
+
`@api private` tag — this reports each element individually as
|
|
299
|
+
`file:line: Fully::Qualified::Name`, not just the containing file:
|
|
300
|
+
|
|
301
|
+
```bash
|
|
302
|
+
bundle exec yard list --query 'object.has_tag?(:api) && object.tag(:api).text == "private"'
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
Set `api_private_current = yes` for each enumerated constant whose fully
|
|
306
|
+
qualified name appears in that output, and `no` for the rest. (Avoid
|
|
307
|
+
`git grep -l '@api private'`, which only reports files and cannot tell you
|
|
308
|
+
which specific constant in a multi-class file is tagged.)
|
|
309
|
+
|
|
310
|
+
4. **Write the results** to `redesign/c1a-public-api-scope.tsv` (schema in the
|
|
311
|
+
"C1a Results Storage" section above). Every enumerated constant gets one row.
|
|
312
|
+
|
|
313
|
+
#### Classification heuristics
|
|
314
|
+
|
|
315
|
+
**Public-API entry points** (illustrative — verify against real inventory):
|
|
316
|
+
|
|
317
|
+
- `Git` — module with factory methods (`.open`, `.clone`, `.init`, `.bare`,
|
|
318
|
+
`.git_version`, `.default_branch`), defined in `lib/git.rb`
|
|
319
|
+
- `Git::Repository` — main facade for repository operations
|
|
320
|
+
- `Git::Object` and its nested subclasses `Git::Object::Blob`, `::Tree`,
|
|
321
|
+
`::Commit`, `::Tag` — **all defined in `lib/git/object.rb`** (there are no
|
|
322
|
+
separate `blob.rb`/`tree.rb`/`commit.rb`/`tag.rb` files)
|
|
323
|
+
- `Git::Branch`, `Git::Branches` — branch representation and collection
|
|
324
|
+
- `Git::Remote` — remote representation
|
|
325
|
+
- `Git::Diff`, `Git::DiffResult`, `Git::DiffStats` — diff representations
|
|
326
|
+
- `Git::Status` — repository status snapshot
|
|
327
|
+
- `Git::Log` — log entry and log enumeration
|
|
328
|
+
- `Git::Config` — configuration access
|
|
329
|
+
- `Git::Stash`, `Git::Stashes`, `Git::Worktree`, `Git::Worktrees` — collections
|
|
330
|
+
and value objects returned from facade methods
|
|
331
|
+
|
|
332
|
+
> **Note:** There is **no `Git::Index` class.** Staging is handled by the
|
|
333
|
+
> `Git::Repository::Staging` module. Do not document a non-existent class.
|
|
334
|
+
|
|
335
|
+
**Value objects / return types** (public if returned from public methods —
|
|
336
|
+
classify each individually):
|
|
337
|
+
|
|
338
|
+
- `Git::Author`, `Git::FileRef`, `Git::Url`
|
|
339
|
+
- `Git::*Info` classes (`BranchInfo`, `TagInfo`, `StashInfo`, `ConfigEntryInfo`,
|
|
340
|
+
`DetachedHeadInfo`, `DiffInfo`, `DirstatInfo`, etc.)
|
|
341
|
+
- `Git::*Result` / `Git::*Failure` classes (`BranchDeleteResult`,
|
|
342
|
+
`TagDeleteResult`, `FsckResult`, `DiffResult`, etc.)
|
|
343
|
+
- Relevant exceptions in `lib/git/errors.rb`
|
|
344
|
+
|
|
345
|
+
**Internal / private classes** (must be marked `@api private`):
|
|
346
|
+
|
|
347
|
+
- `Git::ExecutionContext` and nested — internal execution context
|
|
348
|
+
- `Git::Commands::*` — command wrappers (impl detail of command layer)
|
|
349
|
+
- `Git::Parsers::*` / parser value objects — output parsers (impl detail)
|
|
350
|
+
- `Git::ArgsBuilder`, `Git::CommandLine`, `Git::CommandLineResult`,
|
|
351
|
+
`Git::EncodingUtils`, `Git::EscapedPath` — internal plumbing (candidates for
|
|
352
|
+
`@api private` — verify current state and flag if unmarked)
|
|
353
|
+
- `Git::Repository::*` topic modules (e.g., `Branching`, `Staging`, `Committing`) —
|
|
354
|
+
organizational containers that group facade methods; the modules are `@api private`
|
|
355
|
+
but the **methods** they define are public (see C1b for documentation location)
|
|
356
|
+
- `Git::Repository::<topic>::*Path`, `*State` — path/state objects within
|
|
357
|
+
facade modules (e.g., `Git::Repository::Branching::HeadState`). These are
|
|
358
|
+
internal helper classes that should be marked `@api private` and documented in
|
|
359
|
+
their own class definition. The owning method simply references them in its
|
|
360
|
+
`@return` tag (e.g., `@return [Git::Repository::Branching::HeadState]`).
|
|
361
|
+
- Any `::Internal::*` helpers
|
|
362
|
+
|
|
363
|
+
**Done-when (C1a):** `redesign/c1a-public-api-scope.tsv` exists with one row per
|
|
364
|
+
enumerated constant, each classified `public`/`internal` with its current
|
|
365
|
+
`@api private` state recorded.
|
|
366
|
+
|
|
367
|
+
### C1b — Document all elements (already complete)
|
|
368
|
+
|
|
369
|
+
> ✅ **Already done.** All of `lib/` passes `bundle exec rake yard:lint` with no
|
|
370
|
+
> offenses, so the documentation-coverage work below is complete. The steps are
|
|
371
|
+
> retained for historical context. `yardstick` has been retired; `yard-lint`
|
|
372
|
+
> (config in `.yard-lint.yml`) now enforces documentation completeness.
|
|
373
|
+
|
|
374
|
+
**Input:** `redesign/c1a-public-api-scope.tsv` (from C1a). Process **every** row —
|
|
375
|
+
both `public` and `internal` — adding whatever docs `yard-lint` requires: a
|
|
376
|
+
summary, an `@api` tag, and documented params/returns for every element (public
|
|
377
|
+
and internal alike). `@example` blocks are **strongly encouraged on key public
|
|
378
|
+
methods** where they aid understanding, but they are **not** machine-enforced —
|
|
379
|
+
`yard-lint` validates the syntax/style of examples that exist (`Tags/ExampleSyntax`)
|
|
380
|
+
but has no validator that requires an example to be present. Example coverage on
|
|
381
|
+
the key public-API classes is therefore verified manually in C3b, not gated by
|
|
382
|
+
`yard-lint`.
|
|
383
|
+
|
|
384
|
+
**Documentation conventions:** Every YARD comment added or changed in this PR MUST
|
|
385
|
+
follow the [yard-documentation](../.github/skills/yard-documentation/SKILL.md) skill.
|
|
386
|
+
For `Git::Repository::*` facade methods also apply
|
|
387
|
+
[facade-yard-documentation](../.github/skills/facade-yard-documentation/SKILL.md); for
|
|
388
|
+
`Git::Commands::*` also apply
|
|
389
|
+
[command-yard-documentation](../.github/skills/command-yard-documentation/SKILL.md).
|
|
390
|
+
|
|
391
|
+
**Important:** Methods are documented where they are defined, even if in a private topic module.
|
|
392
|
+
|
|
393
|
+
For **methods in `Git::Repository::*` topic modules** (e.g., `Git::Repository::Branching#current_branch`):
|
|
394
|
+
|
|
395
|
+
- Document the method in the topic module where it's defined
|
|
396
|
+
- Mark the **module itself** as `@api private` to signal it's an organizational container
|
|
397
|
+
(the actual marking happens in C1c; C1b only adds method docs)
|
|
398
|
+
- The **method** remains public (do NOT mark methods `@api private`)
|
|
399
|
+
- YARD automatically includes these docs in the public `Git::Repository` interface
|
|
400
|
+
- Users will see `Git::Repository#current_branch` with docs from the topic module
|
|
401
|
+
|
|
402
|
+
For **other public classes** (e.g., `Git::Object`, `Git::Branch`):
|
|
403
|
+
|
|
404
|
+
- Document each class and its methods in the file where it's defined
|
|
405
|
+
(remember `Blob`/`Tree`/`Commit`/`Tag` live in `lib/git/object.rb`)
|
|
406
|
+
|
|
407
|
+
**General documentation checklist** for each public class/method:
|
|
408
|
+
|
|
409
|
+
1. **Check for existing YARD doc.** Use `bundle exec yard doc --quiet` and
|
|
410
|
+
review output in `doc/` or use `bundle exec yardoc --no-output` to check
|
|
411
|
+
warnings.
|
|
412
|
+
2. **Add docs if missing.** Write clear, concise YARD comments following
|
|
413
|
+
the skills referenced above:
|
|
414
|
+
- `@param` for each argument with type and description
|
|
415
|
+
- `@return` with type and description
|
|
416
|
+
- `@example` for common usage patterns on key public methods (encouraged where
|
|
417
|
+
it aids understanding; not required on trivial accessors, and not
|
|
418
|
+
machine-enforced by `yard-lint`)
|
|
419
|
+
- Cross-references to related methods using `{ClassName#method_name}`
|
|
420
|
+
- `@raise` for exceptions that may be raised
|
|
421
|
+
3. **Verify docs render correctly.** Generate HTML docs and visually inspect
|
|
422
|
+
that parameter names, types, and examples are rendered correctly.
|
|
423
|
+
|
|
424
|
+
### C1c — Set correct `@api` tags
|
|
425
|
+
|
|
426
|
+
> ✅ **Done.** Commit `83225f3f` set the correct `@api` tags for all 37 previously-unmarked
|
|
427
|
+
> internal constants identified in `redesign/c1a-public-api-scope.tsv`. All
|
|
428
|
+
> `Git::Repository::*` topic modules are now `@api private`. `bundle exec yard-lint lib/`
|
|
429
|
+
> passes with no offenses (the `rake yard:lint` alias is Ruby 3.3+ only). The steps
|
|
430
|
+
> below are retained for historical context.
|
|
431
|
+
|
|
432
|
+
**Input:** `redesign/c1a-public-api-scope.tsv` (from C1a). Set the correct `@api`
|
|
433
|
+
tag on **every** element per the TSV: `@api public` for the `public` surface,
|
|
434
|
+
`@api private` for `internal` implementation detail. Add or correct tags
|
|
435
|
+
wherever they are missing or wrong — including flipping the `Git::Repository::*`
|
|
436
|
+
topic modules that are currently `@api public` to `@api private`.
|
|
437
|
+
|
|
438
|
+
> **Note:** `@api` tags are already present on parts of `lib/`, but coverage is
|
|
439
|
+
> uneven — some topic modules are still `@api public` and some internal plumbing
|
|
440
|
+
> classes are unmarked. Treat C1c as an **audit and gap-fill** driven entirely by
|
|
441
|
+
> the C1a TSV: for every element whose recorded tag is missing or wrong, set the
|
|
442
|
+
> correct value. Do not rely on hard-coded lists here — the TSV is the source of
|
|
443
|
+
> truth.
|
|
444
|
+
|
|
445
|
+
For each internal class needing the marker:
|
|
446
|
+
|
|
447
|
+
1. **Add `@api private` tag** at the top of the class/module YARD comment.
|
|
448
|
+
Examples:
|
|
449
|
+
|
|
450
|
+
```ruby
|
|
451
|
+
module Git
|
|
452
|
+
module Commands
|
|
453
|
+
# @api private
|
|
454
|
+
#
|
|
455
|
+
# Internal command wrapper for `git show`.
|
|
456
|
+
class Show < Base
|
|
457
|
+
...
|
|
458
|
+
end
|
|
459
|
+
end
|
|
460
|
+
end
|
|
461
|
+
```
|
|
462
|
+
|
|
463
|
+
```ruby
|
|
464
|
+
module Git
|
|
465
|
+
module Repository
|
|
466
|
+
# @api private
|
|
467
|
+
#
|
|
468
|
+
# Branching operations (organizational module mixed into Git::Repository).
|
|
469
|
+
# Users interact with these methods via Git::Repository#current_branch, etc.
|
|
470
|
+
module Branching
|
|
471
|
+
# Get the current branch.
|
|
472
|
+
#
|
|
473
|
+
# @return [Git::Branch] the current branch
|
|
474
|
+
def current_branch
|
|
475
|
+
...
|
|
476
|
+
end
|
|
477
|
+
end
|
|
478
|
+
end
|
|
479
|
+
end
|
|
480
|
+
```
|
|
481
|
+
|
|
482
|
+
2. **Note:** Topic modules like `Git::Repository::Branching` are marked `@api private`
|
|
483
|
+
to indicate they are organizational containers, but the **methods they define are
|
|
484
|
+
public** and should be fully documented (they are mixed into the public
|
|
485
|
+
`Git::Repository` class). Do not add `@api private` to those methods.
|
|
486
|
+
|
|
487
|
+
3. **Read and follow per-row `notes` instructions.** Some rows carry an actionable
|
|
488
|
+
instruction in the `notes` column prefixed `C1c action: ...`. Apply it in
|
|
489
|
+
addition to setting the `@api` tag. For example, several work-in-progress diff
|
|
490
|
+
value objects (e.g. `Git::DiffResult`, `Git::DiffInfo`, `Git::FileDiffInfo`,
|
|
491
|
+
`Git::FileRef`, the `Git::DiffFile*Info` classes, `Git::Dirstat*`,
|
|
492
|
+
`Git::DetachedHeadInfo`) instruct you to also add a YARD comment noting the
|
|
493
|
+
class is work-in-progress and may be made public in a later release. Example:
|
|
494
|
+
|
|
495
|
+
```ruby
|
|
496
|
+
module Git
|
|
497
|
+
# Immutable result object from git diff commands.
|
|
498
|
+
#
|
|
499
|
+
# @note Work in progress: this class is not yet part of the public API and
|
|
500
|
+
# may be made public in a later release (targeted for a future
|
|
501
|
+
# Git::Repository::Diffing refactor). Do not depend on it.
|
|
502
|
+
#
|
|
503
|
+
# @api private
|
|
504
|
+
#
|
|
505
|
+
DiffResult = Data.define(...)
|
|
506
|
+
end
|
|
507
|
+
```
|
|
508
|
+
|
|
509
|
+
4. **Verify the tags are applied.** Run:
|
|
510
|
+
|
|
511
|
+
```
|
|
512
|
+
bundle exec yard list --query 'object.has_tag?(:api) && object.tag(:api).text == "private"'
|
|
513
|
+
```
|
|
514
|
+
|
|
515
|
+
and confirm all 37 target constants from `redesign/c1a-public-api-scope.tsv`
|
|
516
|
+
(those with `api_private_current=no`) appear in the output. Also run
|
|
517
|
+
`bundle exec rake yard:build` (included in the CI `yard`/`default` task) and
|
|
518
|
+
examine the build output for any warnings or errors introduced by the changes.
|
|
519
|
+
|
|
520
|
+
**Done-when (C1c):** Every element in `redesign/c1a-public-api-scope.tsv` has an
|
|
521
|
+
effective `@api` status matching its recorded `scope` — `internal` rows resolve to
|
|
522
|
+
`@api private` (tagged directly or inherited from an enclosing `@api private`
|
|
523
|
+
namespace) and `public` rows resolve to `@api public`. YARD propagates an
|
|
524
|
+
`@api private` tag from a namespace to its children, so a method inside an
|
|
525
|
+
`@api private` class is already private without its own tag; do not require a literal
|
|
526
|
+
tag on every element. Concretely: all `Git::Repository::*` topic modules are
|
|
527
|
+
`@api private`; the per-constant `@api private` query from C1a step 3 lists every
|
|
528
|
+
`internal` element and no `public` one; `bundle exec rake yard:lint` passes with no
|
|
529
|
+
offenses; and generated docs render internal elements with `@api private`
|
|
530
|
+
annotation (not as public API contract). Additionally, every `C1c action: ...`
|
|
531
|
+
instruction recorded in a row's `notes` column has been applied (e.g. the
|
|
532
|
+
work-in-progress diff value objects carry a `@note` marking them not-yet-public).
|
|
533
|
+
|
|
534
|
+
### C1d — Coverage gate (already complete)
|
|
535
|
+
|
|
536
|
+
> ✅ **Already done.** The coverage gate has been migrated from the retired
|
|
537
|
+
> `yardstick` tool to [`yard-lint`](https://github.com/mensfeld/yard-lint):
|
|
538
|
+
>
|
|
539
|
+
> - `tasks/yard.rake` defines a `yard:lint` task (`bundle exec yard-lint lib/`)
|
|
540
|
+
> that is part of the aggregate `yard` task on Ruby 3.3+.
|
|
541
|
+
> - Configuration lives in `.yard-lint.yml` (lints `--private`/`--protected`
|
|
542
|
+
> objects, `FailOnSeverity: convention`). The enforced bar is **100% — zero
|
|
543
|
+
> undocumented objects** — via the `Documentation/UndocumentedObjects` validator
|
|
544
|
+
> plus `FailOnSeverity: convention`; the `MinCoverage: 75.0` setting is only a
|
|
545
|
+
> coarse secondary backstop. Tuned to the project's `yard-documentation` skill.
|
|
546
|
+
> - `bundle exec rake yard:lint` passes with **no offenses** and there is no
|
|
547
|
+
> `.yard-lint-todo.yml` baseline, so the codebase is clean with no exceptions.
|
|
548
|
+
>
|
|
549
|
+
> No further action is required for the coverage gate. The per-object validator
|
|
550
|
+
> already holds the line at 100%; `bundle exec rake yard:build` reports **100.00%
|
|
551
|
+
> documented** as an informational cross-check.
|
|
552
|
+
|
|
553
|
+
---
|
|
554
|
+
|
|
555
|
+
## C2 — Guidance & README Update
|
|
556
|
+
|
|
557
|
+
**Goal:** Ensure `UPGRADING.md` comprehensively covers v4.x → v5.0.0 migration and
|
|
558
|
+
that `README.md` reflects the new public API and links to the migration guide.
|
|
559
|
+
Delivered as **two independent PRs** (C2a and C2b) that both gate C3.
|
|
560
|
+
|
|
561
|
+
### C2a — Update `UPGRADING.md` (PR)
|
|
562
|
+
|
|
563
|
+
**Input:** existing `UPGRADING.md` (already present, ~6 KB from earlier release
|
|
564
|
+
prep) and the list of v5.0.0 breaking changes from Steps A and B.
|
|
565
|
+
|
|
566
|
+
1. **Read `UPGRADING.md` end-to-end** to understand current coverage.
|
|
567
|
+
2. **Verify it comprehensively covers** (add/expand any gaps):
|
|
568
|
+
- Breaking change overview (v4.x → v5.0.0).
|
|
569
|
+
- Old entry points (`Git::Base`, `Git::Lib`) and their replacements
|
|
570
|
+
(`Git::Repository` via `Git.open`, etc.).
|
|
571
|
+
- Common migration patterns (command usage, return types, error handling).
|
|
572
|
+
- Any deprecated methods still available for transitional use.
|
|
573
|
+
3. **Verify all code snippets** are valid against the v5.0.0 API (spot-check a
|
|
574
|
+
representative sample against the real classes identified in C1a).
|
|
575
|
+
4. **Verify internal links** (e.g., to class docs, README) use correct Markdown.
|
|
576
|
+
|
|
577
|
+
**Done-when (C2a):** `UPGRADING.md` covers every breaking change with accurate
|
|
578
|
+
before/after examples; all links valid.
|
|
579
|
+
|
|
580
|
+
### C2b — Update `README.md` (PR)
|
|
581
|
+
|
|
582
|
+
**Input:** existing `README.md` and the finalized `UPGRADING.md` (C2a). C2b can
|
|
583
|
+
proceed in parallel with C2a since it only links to `UPGRADING.md` (which already
|
|
584
|
+
exists); coordinate wording if both change the upgrade callout.
|
|
585
|
+
|
|
586
|
+
1. **Read `README.md` end-to-end** to understand current structure and messaging.
|
|
587
|
+
2. **Replace any `Git::Base` / `Git::Lib` references with new public API examples:**
|
|
588
|
+
- Old: `repo = Git::Base.new(path)` → New: `repo = Git.open(path)`
|
|
589
|
+
- Old: `Git::Lib.new.ls_files` → New: `repo.ls_files`
|
|
590
|
+
- Add a brief explanation of what `Git::Repository` is and why it's the main
|
|
591
|
+
interface.
|
|
592
|
+
3. **Add or refresh a "Getting Started" / "Basic Usage" section** with 2–3 clear
|
|
593
|
+
examples showing:
|
|
594
|
+
- Opening/creating repositories
|
|
595
|
+
- Running common operations (listing files, checking status, etc.)
|
|
596
|
+
- Accessing objects (commits, branches)
|
|
597
|
+
4. **Add a prominent migration callout** pointing to `UPGRADING.md`:
|
|
598
|
+
|
|
599
|
+
```markdown
|
|
600
|
+
## Upgrading from v4.x to v5.0.0
|
|
601
|
+
|
|
602
|
+
v5.0.0 is a major release with breaking changes. See
|
|
603
|
+
[UPGRADING.md](UPGRADING.md) for a comprehensive migration guide.
|
|
604
|
+
```
|
|
605
|
+
|
|
606
|
+
5. **Test all code examples** by running them locally or in an isolated RSpec
|
|
607
|
+
example, and **verify all internal links** are valid.
|
|
608
|
+
|
|
609
|
+
**Done-when (C2b):** `README.md` shows the new entry points, includes working
|
|
610
|
+
examples, and links to `UPGRADING.md`; no stale `Git::Base`/`Git::Lib` references
|
|
611
|
+
remain outside historical context.
|
|
612
|
+
|
|
613
|
+
---
|
|
614
|
+
|
|
615
|
+
## C3 — Documentation Completeness Verification
|
|
616
|
+
|
|
617
|
+
**Goal:** Final comprehensive check that all documentation is complete and correct.
|
|
618
|
+
Step C ends here at **docs-complete + CI green**. The actual v5.0.0 gem release
|
|
619
|
+
(tagging, `gem build`/`push`, publishing) is **out of scope** and handled by a
|
|
620
|
+
separate release process (see the [release-management](../.github/skills/release-management/SKILL.md)
|
|
621
|
+
skill).
|
|
622
|
+
|
|
623
|
+
**Input:** finalized `redesign/c1a-public-api-scope.tsv` (C1a–C1d) and the updated
|
|
624
|
+
`UPGRADING.md`/`README.md` (C2a/C2b).
|
|
625
|
+
|
|
626
|
+
### C3a — Run full CI pipeline
|
|
627
|
+
|
|
628
|
+
```bash
|
|
629
|
+
bundle exec rake default
|
|
630
|
+
```
|
|
631
|
+
|
|
632
|
+
This runs:
|
|
633
|
+
|
|
634
|
+
- RSpec (unit + integration) ✓
|
|
635
|
+
- RuboCop linting ✓
|
|
636
|
+
- YARD documentation build (plus lint on Ruby 3.3+) ✓
|
|
637
|
+
- Gem build check ✓
|
|
638
|
+
|
|
639
|
+
All must pass with 0 failures and 0 warnings.
|
|
640
|
+
|
|
641
|
+
> **Note:** The YARD tasks are **not defined on JRuby or TruffleRuby** (redcarpet
|
|
642
|
+
> cannot install there), and `yard:lint` is only defined on **Ruby 3.3+**.
|
|
643
|
+
> On MRI Ruby 3.2, `rake default` still runs `yard:build` but omits `yard:lint`.
|
|
644
|
+
> Run the final documentation verification on MRI Ruby 3.3+ to exercise both
|
|
645
|
+
> `yard:build` and `yard:lint`.
|
|
646
|
+
|
|
647
|
+
### C3b — Manual documentation spot-check
|
|
648
|
+
|
|
649
|
+
1. **Generate docs locally** using the same command CI runs:
|
|
650
|
+
|
|
651
|
+
```bash
|
|
652
|
+
bundle exec rake yard:build
|
|
653
|
+
```
|
|
654
|
+
|
|
655
|
+
2. **Spot-check 5–10 key public-API classes** in the generated HTML docs
|
|
656
|
+
(`doc/index.html`):
|
|
657
|
+
|
|
658
|
+
- Verify each has complete parameter/return documentation.
|
|
659
|
+
- Verify key public methods carry a usable `@example`. This is the
|
|
660
|
+
**authoritative check for example presence** — `yard-lint` validates the
|
|
661
|
+
syntax of examples that exist but cannot require one, so a human confirms the
|
|
662
|
+
important entry points have them here.
|
|
663
|
+
- Verify cross-references render correctly.
|
|
664
|
+
- Verify `@api private` items are clearly annotated as private/internal and
|
|
665
|
+
not presented as stable public API contract.
|
|
666
|
+
|
|
667
|
+
### C3c — Link validation
|
|
668
|
+
|
|
669
|
+
1. **Check `README.md` links:**
|
|
670
|
+
|
|
671
|
+
- `UPGRADING.md` exists and is readable.
|
|
672
|
+
- Any URLs to GitHub/external resources are still valid.
|
|
673
|
+
|
|
674
|
+
2. **Check cross-file references:**
|
|
675
|
+
|
|
676
|
+
- Any internal skill or doc files that reference the API use correct examples.
|
|
677
|
+
|
|
678
|
+
### C3d — Step C sign-off
|
|
679
|
+
|
|
680
|
+
Once C1a–C1d, C2a/C2b, and C3a–c are complete:
|
|
681
|
+
|
|
682
|
+
1. **Open the C3 verification PR** summarizing that all documentation is complete
|
|
683
|
+
and CI is green.
|
|
684
|
+
2. **Include the final YARD stats** in the PR description.
|
|
685
|
+
3. **Mark Phase 4 → Step C complete** in
|
|
686
|
+
[`3_architecture_implementation.md`](3_architecture_implementation.md).
|
|
687
|
+
4. **Hand off to the separate release process** for the actual v5.0.0 release
|
|
688
|
+
(out of Step C scope).
|
|
689
|
+
|
|
690
|
+
---
|
|
691
|
+
|
|
692
|
+
## Resolved Decisions
|
|
693
|
+
|
|
694
|
+
### YARD `@api private` scope
|
|
695
|
+
|
|
696
|
+
- **Decision:** Mark `Git::Commands::*`, `Git::Parsers::*`, `Git::ExecutionContext::*`,
|
|
697
|
+
`Git::Repository::*` (topic modules), and any `Internal::*` helpers as `@api private`.
|
|
698
|
+
These are implementation details subject to change without notice.
|
|
699
|
+
- **Rationale:** Users should interact only through `Git` and `Git::Repository`
|
|
700
|
+
facades. Exposing internals would lock us into API stability for details that
|
|
701
|
+
should remain flexible.
|
|
702
|
+
- **Note:** `@api private` signals *instability*, not *absence of docs*. These
|
|
703
|
+
classes must still be fully documented (see the coverage bar below); `yard-lint`
|
|
704
|
+
lints them too (it runs with `--private --protected`).
|
|
705
|
+
|
|
706
|
+
### Topic module documentation
|
|
707
|
+
|
|
708
|
+
- **Decision:** `Git::Repository::*` topic modules (e.g., `Branching`, `Staging`) are
|
|
709
|
+
marked `@api private`, but the methods they define are documented in the module
|
|
710
|
+
where defined. These methods are mixed into `Git::Repository` and become part of
|
|
711
|
+
the public API. YARD automatically includes them in the `Git::Repository` public
|
|
712
|
+
interface documentation.
|
|
713
|
+
- **Rationale:** Topic modules are organizational containers, not part of the user
|
|
714
|
+
API contract. However, the methods they contain are public. This dual marking
|
|
715
|
+
signals: "the module structure is internal; the functionality it exposes is public."
|
|
716
|
+
|
|
717
|
+
### README vs. UPGRADING split
|
|
718
|
+
|
|
719
|
+
- **Decision:** `README.md` focuses on current best practices with new API examples;
|
|
720
|
+
`UPGRADING.md` is a comprehensive "old → new" migration reference.
|
|
721
|
+
- **Rationale:** Users landing on `README.md` should see the current recommended
|
|
722
|
+
approach, not be confused by old patterns. Migration users reference the guide
|
|
723
|
+
directly.
|
|
724
|
+
|
|
725
|
+
### Documentation coverage bar
|
|
726
|
+
|
|
727
|
+
- **Decision (locked):** The documentation bar is **100% — zero undocumented
|
|
728
|
+
objects — enforced per-object**, not as a coverage percentage. `yard-lint`
|
|
729
|
+
(which replaced the retired `yardstick` tooling) enforces it: `.yard-lint.yml`
|
|
730
|
+
lints all objects (`--private --protected`) and fails on any offense at
|
|
731
|
+
`convention` severity or higher, so the built-in
|
|
732
|
+
`Documentation/UndocumentedObjects` validator fails the build on **any**
|
|
733
|
+
undocumented object. `bundle exec rake yard:lint` currently passes with **no
|
|
734
|
+
offenses** and no baseline exceptions, and `bundle exec rake yard:build` reports
|
|
735
|
+
**100.00% documented**. The `MinCoverage` setting (`75.0`) is only a coarse
|
|
736
|
+
secondary backstop; the per-object validator is the source of truth.
|
|
737
|
+
- **Rationale:** A single, tool-enforced bright line aligned with the
|
|
738
|
+
`yard-documentation` skill. Per-object enforcement catches new undocumented code
|
|
739
|
+
immediately and names the exact object to fix, so contributor friction is handled
|
|
740
|
+
by that actionable feedback and by maintainer discretion (a maintainer can add a
|
|
741
|
+
missing doc or fix a gap in a follow-up) — not by baking permanent slack into a
|
|
742
|
+
threshold, which would let debt accumulate and eventually block an unrelated PR.
|
|
743
|
+
`@api private` documents internal detail for maintainers while signaling users not
|
|
744
|
+
to depend on it; it does not exempt code from documentation.
|
|
745
|
+
|
|
746
|
+
---
|
|
747
|
+
|
|
748
|
+
## Execution Notes
|
|
749
|
+
|
|
750
|
+
### Sequencing & Parallelization
|
|
751
|
+
|
|
752
|
+
- **Remaining C1 work is sequential:** `C1a → C1c → C3`. (C1b documentation
|
|
753
|
+
coverage and the C1d coverage gate are already complete — see their sections.)
|
|
754
|
+
C1c consumes `redesign/c1a-public-api-scope.tsv` from C1a to set the correct
|
|
755
|
+
`@api` tags, so C1a must land first.
|
|
756
|
+
- **C2a and C2b are independent** of C1 and of each other, and may proceed in
|
|
757
|
+
parallel at any time (both only require the pre-existing `UPGRADING.md`).
|
|
758
|
+
- **C3 gates the Step's completion** — requires C1c, C2a, and C2b all merged.
|
|
759
|
+
|
|
760
|
+
### RSpec for documentation examples
|
|
761
|
+
|
|
762
|
+
For examples added to YARD comments (e.g., in `@example` blocks), consider:
|
|
763
|
+
|
|
764
|
+
- **Simple examples** (e.g., "open a repo") can be inline in the comment.
|
|
765
|
+
- **Complex examples** that need actual repos or setup should either:
|
|
766
|
+
- Reference an integration test that demonstrates the behavior, OR
|
|
767
|
+
- Be conceptual pseudocode with clear comments.
|
|
768
|
+
|
|
769
|
+
Do not add new tests purely to support documentation examples; reuse existing
|
|
770
|
+
integration tests if possible.
|
|
771
|
+
|
|
772
|
+
### Out of scope: gem release
|
|
773
|
+
|
|
774
|
+
The actual v5.0.0 release (CHANGELOG finalization, `v5.0.0` git tag, `gem build`,
|
|
775
|
+
`gem push`, GitHub release notes) is **not part of Step C**. It is handled
|
|
776
|
+
separately via the
|
|
777
|
+
[release-management](../.github/skills/release-management/SKILL.md) skill once
|
|
778
|
+
Step C reaches docs-complete + CI green.
|
|
779
|
+
|
|
780
|
+
---
|
|
781
|
+
|
|
782
|
+
## File Checklist
|
|
783
|
+
|
|
784
|
+
> Illustrative anchor points — the authoritative list is
|
|
785
|
+
> `redesign/c1a-public-api-scope.tsv` produced by C1a. Paths reflect the real
|
|
786
|
+
> file layout (e.g., `Blob`/`Tree`/`Commit`/`Tag` live inside `object.rb`; there
|
|
787
|
+
> is no `index.rb`).
|
|
788
|
+
|
|
789
|
+
> ✅ **Documentation coverage is complete:** all files under `lib/` pass
|
|
790
|
+
> `bundle exec rake yard:lint`. The per-file "docs complete" boxes below are
|
|
791
|
+
> checked accordingly; the remaining unchecked items are `@api`-tag (C1c),
|
|
792
|
+
> `README`/`UPGRADING` (C2), and CI (C3) work.
|
|
793
|
+
|
|
794
|
+
- [x] `lib/git.rb` — top-level `Git` module + factory method docs complete
|
|
795
|
+
- [x] `lib/git/repository.rb` — facade class docs complete
|
|
796
|
+
- [x] `lib/git/object.rb` — `Object` base class **and nested** `Blob`, `Tree`,
|
|
797
|
+
`Commit`, `Tag` subclass docs complete
|
|
798
|
+
- [x] `lib/git/branch.rb`, `lib/git/branches.rb` — branch class/collection docs complete
|
|
799
|
+
- [x] `lib/git/remote.rb` — remote class docs complete
|
|
800
|
+
- [x] `lib/git/diff.rb` + diff value objects (`diff_result.rb`, `diff_stats.rb`,
|
|
801
|
+
`diff_info.rb`, `diff_file_*.rb`) — docs complete
|
|
802
|
+
- [x] `lib/git/status.rb` — status class docs complete
|
|
803
|
+
- [x] `lib/git/log.rb` — log class docs complete
|
|
804
|
+
- [x] `lib/git/config.rb` — config class docs complete
|
|
805
|
+
- [x] `lib/git/stash*.rb`, `lib/git/worktree*.rb` — collection/value object docs complete
|
|
806
|
+
- [ ] Public value objects (`author.rb`, `url.rb`, `file_ref.rb`, `*_info.rb`,
|
|
807
|
+
`*_result.rb`, `*_failure.rb`) — classified in C1a (docs already complete)
|
|
808
|
+
- [ ] Every element carries a correct `@api` tag; topic modules flipped to
|
|
809
|
+
`@api private` (per C1a TSV) — C1c
|
|
810
|
+
- [ ] `README.md` updated with new entry points — C2b
|
|
811
|
+
- [ ] `UPGRADING.md` reviewed and complete — C2a
|
|
812
|
+
- [x] Documentation coverage complete and gated by `yard-lint`
|
|
813
|
+
(`.yard-lint.yml`); `rake yard:lint` passes with no offenses — C1b/C1d
|
|
814
|
+
- [ ] Full CI pipeline green — C3
|
|
815
|
+
|
|
816
|
+
---
|
|
817
|
+
|
|
818
|
+
## Step C Completion Checklist (C3d)
|
|
819
|
+
|
|
820
|
+
Step C is complete (docs-complete + CI green) when all of the following hold. The
|
|
821
|
+
actual gem release is tracked separately and is **not** part of this checklist.
|
|
822
|
+
|
|
823
|
+
- [ ] `redesign/c1a-public-api-scope.tsv` produced and kept authoritative (C1a)
|
|
824
|
+
- [x] All elements (public and internal) documented; `rake yard:lint` passes with
|
|
825
|
+
no offenses (C1b)
|
|
826
|
+
- [ ] Every element carries a correct `@api` tag; topic modules `@api private` (C1c)
|
|
827
|
+
- [x] Coverage gate migrated to `yard-lint` (`.yard-lint.yml`) and green (C1d)
|
|
828
|
+
- [ ] `UPGRADING.md` comprehensive and links valid (C2a)
|
|
829
|
+
- [ ] `README.md` examples tested and working; links valid (C2b)
|
|
830
|
+
- [ ] `bundle exec rake default` passes (C3a)
|
|
831
|
+
- [ ] Manual doc spot-check passes; `@api private` items annotated as internal
|
|
832
|
+
and not presented as stable public API contract (C3b)
|
|
833
|
+
- [ ] Phase 4 → Step C marked complete in `3_architecture_implementation.md` (C3d)
|