Skip to content

Commit c7e1f91

Browse files
committed
MIGRATION(docs): Add API naming consistency migration notes (#507)
why: Users need detailed migration guidance when upgrading. what: - Document _all parameter renamings with before/after examples - Document remotes()/remote() getter method renames - Include tables showing old vs new parameter/method names
1 parent bf77c80 commit c7e1f91

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

MIGRATION

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,63 @@ _Notes on the upcoming release will be added here_
2424

2525
<!-- Maintainers, insert migration notes for the next release here -->
2626

27+
### API Naming Consistency
28+
29+
Renamed parameters and methods to follow Python community conventions (Django, pytest, Sphinx patterns).
30+
31+
#### cmd/git.py: Renamed `_all` parameters
32+
33+
The `_all` parameter has been renamed to descriptive names across multiple methods:
34+
35+
| Method | Old | New |
36+
|--------|-----|-----|
37+
| `clone()` | `_all` | `all_branches` |
38+
| `fetch()` | `_all` | `all_remotes` |
39+
| `pull()` | `_all` | `all_remotes` |
40+
| `help()` | `_all` | `show_all` |
41+
| `rev_list()` | `_all` | `include_all_refs` |
42+
| `remote.get_url()` | `_all` | `all_urls` |
43+
| `stash.save()` | `_all` | `include_ignored` |
44+
| `stash.push()` | `_all` | `include_ignored` |
45+
| `branches.ls()` | `_all` | `all_branches` |
46+
47+
Before:
48+
49+
```python
50+
git.fetch(_all=True)
51+
git.stash.save(_all=True)
52+
```
53+
54+
After:
55+
56+
```python
57+
git.fetch(all_remotes=True)
58+
git.stash.save(include_ignored=True)
59+
```
60+
61+
#### sync/git.py: Renamed getter methods
62+
63+
Added `get_` prefix for consistency with other getter methods:
64+
65+
| Old | New |
66+
|-----|-----|
67+
| `remotes()` | `get_remotes()` |
68+
| `remote(name)` | `get_remote(name)` |
69+
70+
Before:
71+
72+
```python
73+
repo.remotes()
74+
repo.remote("origin")
75+
```
76+
77+
After:
78+
79+
```python
80+
repo.get_remotes()
81+
repo.get_remote("origin")
82+
```
83+
2784
### pytest fixtures: `git_local_clone` renamed to `example_git_repo` (#468)
2885

2986
- pytest: `git_local_clone` renamed to `example_git_repo`

0 commit comments

Comments
 (0)