Skip to content

Commit 28f2a36

Browse files
committed
docs(CHANGES): add changelog for Manager/Cmd pattern (#465)
why: Document major new features for the upcoming release. what: - Add Manager/Cmd pattern for git subcommands (branches, remotes, stashes, tags, worktrees, notes, submodules, reflog) - Document enhanced Git.init() with new parameters - Note documentation and test additions
1 parent 0a99edd commit 28f2a36

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

CHANGES

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,59 @@ $ uv add libvcs --prerelease allow
2020

2121
_Upcoming changes will be written here._
2222

23+
### New features
24+
25+
#### cmd: Manager/Cmd pattern for git subcommands (#465)
26+
27+
New architecture for git subcommands that returns typed objects instead of raw strings:
28+
29+
- **Manager classes** handle collection-level operations (`ls()`, `get()`, `filter()`, `add()`/`create()`)
30+
- **Cmd classes** handle per-entity operations (`show()`, `remove()`, `rename()`)
31+
- All `ls()` methods return `QueryList` for chainable filtering
32+
33+
New subcommand managers accessible via `Git` instance:
34+
35+
- {attr}`Git.branches <libvcs.cmd.git.Git.branches>` -> {class}`~libvcs.cmd.git.GitBranchManager`
36+
- {attr}`Git.remotes <libvcs.cmd.git.Git.remotes>` -> {class}`~libvcs.cmd.git.GitRemoteManager`
37+
- {attr}`Git.stashes <libvcs.cmd.git.Git.stashes>` -> {class}`~libvcs.cmd.git.GitStashManager`
38+
- {attr}`Git.tags <libvcs.cmd.git.Git.tags>` -> {class}`~libvcs.cmd.git.GitTagManager`
39+
- {attr}`Git.worktrees <libvcs.cmd.git.Git.worktrees>` -> {class}`~libvcs.cmd.git.GitWorktreeManager`
40+
- {attr}`Git.notes <libvcs.cmd.git.Git.notes>` -> {class}`~libvcs.cmd.git.GitNotesManager`
41+
- {attr}`Git.submodules <libvcs.cmd.git.Git.submodules>` -> {class}`~libvcs.cmd.git.GitSubmoduleManager`
42+
- {attr}`Git.reflog <libvcs.cmd.git.Git.reflog>` -> {class}`~libvcs.cmd.git.GitReflogManager`
43+
44+
Example usage:
45+
46+
```python
47+
git = Git(path="/path/to/repo")
48+
49+
# List all branches, filter remote ones
50+
remote_branches = git.branches.ls(remotes=True)
51+
52+
# Get a specific tag
53+
tag = git.tags.get(tag_name="v1.0.0")
54+
tag.delete()
55+
56+
# Create a new branch and switch to it
57+
git.branches.create("feature-branch")
58+
```
59+
60+
#### cmd: Enhanced Git.init() (#465)
61+
62+
- Added `ref_format` parameter for `--ref-format` (files/reftable)
63+
- Added `make_parents` parameter to auto-create parent directories
64+
- Improved parameter validation with clear error messages
65+
- Extended `shared` parameter to support octal permissions (e.g., "0660")
66+
67+
### Documentation
68+
69+
- Add API documentation for all new Manager/Cmd classes (#465)
70+
- Split git subcommand documentation into separate pages: branch, tag, worktree, notes, reflog
71+
72+
### Tests
73+
74+
- Comprehensive test coverage for all new Manager/Cmd classes (#465)
75+
2376
## libvcs 0.37.0 (2025-11-01)
2477

2578
### Breaking changes

0 commit comments

Comments
 (0)