-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgit-diff
More file actions
executable file
·29 lines (19 loc) · 850 Bytes
/
Copy pathgit-diff
File metadata and controls
executable file
·29 lines (19 loc) · 850 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env python3
"""`git diff` across all repos in a top workspace.
git-diff [GIT_DIFF_ARGS...]
Runs `git diff` in the workspace root (top / <feature>) and in each
manifest repo subdir (ksgpu, pirate, ...), under a per-repo header. Extra args
are passed through to git, e.g. `git-diff --stat` or `git-diff --cached`.
Exits with the worst git exit code across the repos (note: a plain `git diff`
returns 0 even when there are changes; use `--exit-code` if you want non-zero).
"""
from __future__ import annotations
import os
import sys
# Make ch_top_helpers importable under PYTHONSAFEPATH=1 (see its module docstring).
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
import ch_top_helpers as wl
def main() -> None:
raise SystemExit(wl.run_git_all(["diff", *sys.argv[1:]]))
if __name__ == "__main__":
main()