pulli 0.2.6__tar.gz → 0.2.8__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.6
3
+ Version: 0.2.8
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.6"
2
+ __version__ = "0.2.8"
@@ -166,8 +166,12 @@ def _ahead_behind(node: RepoNode, C=lambda s, *c: s) -> str:
166
166
  if not node.upstream:
167
167
  return "· ·"
168
168
  behind, ahead = node.behind or 0, node.ahead or 0
169
- b = C(f"↓{behind}", _CYAN, _BOLD) if behind else f"↓{behind}"
170
- a = C(f"↑{ahead}", _CYAN, _BOLD) if ahead else f"↑{ahead}"
169
+ # When the whole line is already cyan (behind repos get that in the
170
+ # flat renderer), the count must not re-cyan a subset — nested SGR of
171
+ # the same color makes the rest of the line render differently. Bold
172
+ # alone is enough emphasis there.
173
+ b = C(f"↓{behind}", _BOLD) if behind else f"↓{behind}"
174
+ a = C(f"↑{ahead}", _BOLD) if ahead else f"↑{ahead}"
171
175
  return f"{b} {a}"
172
176
 
173
177
 
@@ -332,7 +336,13 @@ def _build_flat_lines(
332
336
  if len(cols) >= 4:
333
337
  cols[0] = cols[0] + " " * (url_width - _visible_width(cols[0]))
334
338
  text = " ".join(c for c in cols if c)
335
- lines.append(padded + " " + text)
339
+ line = padded + " " + text
340
+ # A repo that is behind is the actionable one — `pulli pull` acts on
341
+ # it — so the whole line is highlighted (cyan) instead of just the
342
+ # count. Everything up to date stays quiet: no news takes no color.
343
+ if n.behind and not n.error:
344
+ line = C(line, _CYAN)
345
+ lines.append(line)
336
346
  repo_line[id(n)] = len(lines) - 1
337
347
  repo_base[id(n)] = padded
338
348
  return lines, repo_line, repo_base
@@ -456,6 +466,10 @@ class LiveTree:
456
466
  if self._flat and len(cols) >= 4:
457
467
  cols[0] = cols[0] + " " * (self._url_width - _visible_width(cols[0]))
458
468
  text = self.repo_base[nid] + " " + " ".join(c for c in cols if c)
469
+ # Same highlight rule as _build_flat_lines: the whole line goes
470
+ # cyan when the repo is behind — that is the actionable state.
471
+ if self._flat and node.behind and not node.error:
472
+ text = self._C(text, _CYAN)
459
473
  text = _clip_ansi(text, self._width)
460
474
  with self._lock:
461
475
  self._rewrite(i, text)
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