Skip to content

Commit 9f81bd3

Browse files
committed
Improve documentation
1 parent e88f8d6 commit 9f81bd3

File tree

2 files changed

+59
-12
lines changed

2 files changed

+59
-12
lines changed

README.md

Lines changed: 56 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,47 @@ has ghstack information in it, or using string search.
1212
None of this would be useful without a local cache: getting all the needed information
1313
from github takes one to two seconds per pull request the first time.
1414

15-
## Examples
15+
## A quick tour
1616

17-
### List all your pull requests
17+
$ pullman
18+
#131354: [dynamo] Fix constant propagation in builtins and UserClasses
19+
#145150: [inductor] Simplify _inductor/utils.py slightly
20+
#145636: Simplify functional composition in _aot_autograd/dispatch_and_compile_graph.py
21+
#146845: Fix non-bitwise type annotations for Tensor operators (see #145838)
22+
#148959: Move token linter code into tools/linter/adaptors/_linter/
23+
#149958: [inductor] Add some typing to _inductor/ir.py
24+
#149959: [inductor] Add more typing to _inductor/ir.py
25+
#150767: [inductor] Clean typing in codegen/common.py and codecache.py
26+
27+
$ git log -1 --oneline $(pm ref slightly)
28+
c2f0f86cff2 (upstream/gh/rec/124/orig) [inductor] Simplify _inductor/utils.py slightly
29+
30+
$ pullman url -o functional # Also opens #145636 in the browser
31+
https://github.com/pytorch/pytorch/pull/145636
32+
33+
$ pullman errors constant
34+
Writing unit-test-failures.sh for https://github.com/pytorch/pytorch/pull/131354
35+
Loading jobs for 12893911506, segment=pull...
36+
run_id='12893911506', len(jobs)=86, len(failed)=44
37+
Loading jobs for 12893912723, segment=inductor...
38+
run_id='12893912723', len(jobs)=38, len(failed)=27
39+
40+
# Wrote an executable shell file with commands to run the failed unit tests,
41+
# or at least the ones the program can figure out...
42+
43+
$ pullman checkout --fetch --rewrite -r token
44+
# Throws away the pullman cache, then calls
45+
#
46+
# git fetch upstream
47+
# ghstack checkout https://github.com/pytorch/pytorch/pull/148959
48+
# git rebase upstream/viable/strict
49+
# git submodule update --init --recursive
50+
51+
## Commands
52+
53+
You can use any prefix of any of these commands, like `pullman l` or `pullman ch`.
54+
55+
### `pullman list`: list all your pull requests
1856

1957
$ pullman
2058
$ pullman l
@@ -25,20 +63,23 @@ from github takes one to two seconds per pull request the first time.
2563
#144622: [inductor] Enable docstring_linter on _inductor
2664
...
2765

28-
### List requests matching a string
29-
3066
$ pullman list Add tests
3167
$ pullman Add tests
68+
3269
#144621: [inductor] Add tests for new docstring_linter features (fix #142496)
3370

34-
### Print URLs of pull request, optionally open them in a browser
71+
### `pullman url|commit_url|hud_url|ref_url`: print a URL, optionally open in a browser
3572

3673
$ pullman url # Looks at ghstack information in HEAD
3774
https://github.com/pytorch/pytorch/pull/148358
3875

3976
$ pullman url other-branch # Looks at ghstack information in some other branch
4077
https://github.com/pytorch/pytorch/pull/148358
4178

79+
# Use :/ to force a string search
80+
$ pullman url :/other-branch
81+
ERROR: Can't find any commits matching ':/other-branch'
82+
4283
$ pullman url linter # searches for pull requests matching "linter"
4384
https://github.com/pytorch/pytorch/pull/144621
4485

@@ -48,17 +89,23 @@ from github takes one to two seconds per pull request the first time.
4889
$ pullman hud_url
4990
https://hudtorch.org/pr/148358
5091

51-
# Choose from `url`, `commit_url`, `hud_url`, `ref_url`
92+
### `pullman checkout`: run `ghstack checkout` on a matching pull request
5293

53-
### Print ghstack branch ref
94+
$ pullman checkout
95+
# Calls `ghstack checkout` on the pull request that matches HEAD
96+
97+
$ pullman ref :/linter
98+
upstream/gh/rec/137/orig
99+
100+
### `pullman ref`: print ghstack branch git ref
54101

55102
$ pullman ref
56103
upstream/gh/rec/136/orig
57104

58-
$ pullman ref :/linter
105+
$ pullman ref linter
59106
upstream/gh/rec/137/orig
60107

61-
### Download errors from a pull request
108+
### `pullman errors`: download errors from a pull request
62109

63110
$ pullman errors
64111
$ pull

pullman.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -477,15 +477,15 @@ def parse(argv):
477477
p.add_argument("--time", "-t", default=0, type=int, help=help)
478478

479479
elif name == "checkout":
480-
help = "Also rebase against a given git ref"
481-
p.add_argument("--rebase-against", "-R", type=str, default="", help=help)
482-
483480
help = "Also rebase against upstream/main"
484481
p.add_argument("--rebase-main", "-m", action="store_true", help=help)
485482

486483
help = "Also rebase against upstream/viable/strict"
487484
p.add_argument("--rebase-strict", "-r", action="store_true", help=help)
488485

486+
help = "Also rebase against a given git ref"
487+
p.add_argument("--rebase-against", "-R", type=str, default="", help=help)
488+
489489
else:
490490
help = "The github user name"
491491
p.add_argument("--user", "-u", default="", type=str, help=help)

0 commit comments

Comments
 (0)