pulli 0.2.10__tar.gz → 0.2.11__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: pulli
3
- Version: 0.2.10
3
+ Version: 0.2.11
4
4
  Summary: Walk a directory tree, show git repos with status, and fast-forward the ones that are behind upstream.
5
5
  Author: Stefan Waldherr
6
6
  License-Expression: MIT
@@ -1,2 +1,2 @@
1
1
  """pulli — discover git repos under a root and report their status."""
2
- __version__ = "0.2.10"
2
+ __version__ = "0.2.11"
@@ -157,22 +157,28 @@ def _remote_url(repo: Path, env: dict[str, str] | None = None) -> str:
157
157
  def _is_fork(repo: Path, env: dict[str, str] | None = None) -> bool:
158
158
  """True when the repo looks like a fork.
159
159
 
160
- A fork's remotes point at the same repo *name* under different *owners*
161
- — `devskale/rodney` (origin, the user's copy) and `simonw/rodney`
162
- (fork/upstream, the parent). Same name + different owner across 2+
163
- remotes is the signal; we never need to ask GitHub.
160
+ Two signals, either one is enough:
161
+ 1. a remote named `upstream` — the documented GitHub convention for
162
+ "the repo I forked from";
163
+ 2. remotes pointing at the same repo *name* under different *owners*
164
+ (`devskale/rodney` + `simonw/rodney`), compared case-insensitively.
165
+
166
+ Name comparison alone misses forks whose copy was renamed
167
+ (`devskale/handyST` forked from `cjpais/Handy`) — hence signal 1.
164
168
  """
165
169
  remotes = _git_one(repo, "remote", env=env).split()
166
170
  if len(remotes) < 2:
167
171
  return False
172
+ if "upstream" in remotes:
173
+ return True
168
174
  owners: set[str] = set()
169
175
  names: set[str] = set()
170
176
  for name in remotes:
171
177
  url = _git_one(repo, "remote", "get-url", name, env=env)
172
178
  owner, rname = _owner_repo(url)
173
179
  if rname:
174
- owners.add(owner)
175
- names.add(rname)
180
+ owners.add(owner.lower())
181
+ names.add(rname.lower())
176
182
  # same repo name under more than one owner = a fork and its parent
177
183
  return len(names) == 1 and len(owners) >= 2
178
184
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes