Skip to content

Commit 4e9ef92

Browse files
committed
Change all pull-* commands to pr-*.
1 parent 704d066 commit 4e9ef92

File tree

10 files changed

+83
-83
lines changed

10 files changed

+83
-83
lines changed

ReadMe.pod

+6-6
Original file line numberDiff line numberDiff line change
@@ -635,11 +635,11 @@ Close an issue. You can also use C<issue-edit> to close an issue.
635635

636636
Add a comment to an issue and then close it.
637637

638-
=item C<< pulls [<owner>/<repo>] >>
638+
=item C<< pr-list [<owner>/<repo>] >>
639639

640640
List the pull requests for a repo.
641641

642-
=item C<< pull-request [<issue-id-number>] [<options>] >>
642+
=item C<< pr-new [<issue-id-number>] [<options>] >>
643643

644644
Create a new pull request for a repository based on the current branch. If an
645645
issue ID number is given, this command will attach the pull request to the
@@ -651,19 +651,19 @@ default branch of the default remote itself. Use C<--remote>, C<--branch>, C<--
651651
parent>, and C<--base> options to change the default source remote, source
652652
branch, target remote and target branch (respectively).
653653

654-
=item C<< pull-diff [<owner>/<repo>] <issue-id-number> >>
654+
=item C<< pr-diff [<owner>/<repo>] <issue-id-number> >>
655655

656656
Show the diff for a pull request.
657657

658-
=item C<< pull-fetch [<owner>/<repo>] <issue-id-number> >>
658+
=item C<< pr-fetch [<owner>/<repo>] <issue-id-number> >>
659659

660660
Fetches a pull request to a local C<review/$number> branch
661661

662-
=item C<< pull-merge [<owner>/<repo>] <issue-id-number> >>
662+
=item C<< pr-merge [<owner>/<repo>] <issue-id-number> >>
663663

664664
Merge and close a pull request.
665665

666-
=item C<< pull-queue [<user>] [--count=#] [--all] >>
666+
=item C<< pr-queue [<user>] [--count=#] [--all] >>
667667

668668
Show a user's Pull Request queue, for all repos. Shows the open PRs for any
669669
repo that has them. The C<--count> option tells how many repos to check. The

doc/git-hub-hack.swim

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ How to hack on `git-hub`.
1414
# … hack hack hack …
1515
make test
1616
make dev-test
17-
git hub pull-request
17+
git hub pr-new
1818

1919

2020
= Welcome Young Hacker

doc/git-hub.swim

+6-6
Original file line numberDiff line numberDiff line change
@@ -507,10 +507,10 @@ interactions from the command line. They are installed by default.
507507
- `issue-resolve [<owner>/<repo>] <issue-id-number>`
508508
Add a comment to an issue and then close it.
509509

510-
- `pulls [<owner>/<repo>]`
510+
- `pr-list [<owner>/<repo>]`
511511
List the pull requests for a repo.
512512

513-
- `pull-request [<issue-id-number>] [<options>]`
513+
- `pr-new [<issue-id-number>] [<options>]`
514514
Create a new pull request for a repository based on the current branch. If
515515
an issue ID number is given, this command will attach the pull request to the
516516
issue instead of creating a new one.
@@ -521,16 +521,16 @@ interactions from the command line. They are installed by default.
521521
`--parent`, and `--base` options to change the default source remote, source
522522
branch, target remote and target branch (respectively).
523523

524-
- `pull-diff [<owner>/<repo>] <issue-id-number>`
524+
- `pr-diff [<owner>/<repo>] <issue-id-number>`
525525
Show the diff for a pull request.
526526

527-
- `pull-fetch [<owner>/<repo>] <issue-id-number>`
527+
- `pr-fetch [<owner>/<repo>] <issue-id-number>`
528528
Fetches a pull request to a local `review/$number` branch
529529

530-
- `pull-merge [<owner>/<repo>] <issue-id-number>`
530+
- `pr-merge [<owner>/<repo>] <issue-id-number>`
531531
Merge and close a pull request.
532532

533-
- `pull-queue [<user>] [--count=#] [--all]`
533+
- `pr-queue [<user>] [--count=#] [--all]`
534534
Show a user's Pull Request queue, for all repos. Shows the open PRs for any
535535
repo that has them. The `--count` option tells how many repos to check. The
536536
`--all` option says to show closed as well as open PRs.

lib/git-hub

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ The most commonly used commands:
2727
user, orgs, org, teams, members, followers, following, follow, stars, star,
2828
clone, repos, repo, repo-new, repo-delete, forks, fork, collabs, trust,
2929
issues, issue, issue-update, issue-close, comment,
30-
pull-request, pulls, pull-diff, pull-merge, search
30+
pr-new, pr-list, pr-diff, pr-merge, pr-fetch
3131
3232
See 'git hub help' for more help.
3333
@@ -634,7 +634,7 @@ get-parent-remote-name() {
634634
}
635635
local value="$(JSON.get -a "/parent/full_name" -)"
636636
if [ -z "$value" ]; then
637-
# parent for pull requests is self
637+
# parent for PR is self
638638
get-default-remote-name
639639
parent_remote_name="$remote_name"
640640
else

lib/git-hub.d/git-hub-pull renamed to lib/git-hub.d/git-hub-pr

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22

3-
command:pull-request() {
3+
command:pr-new() {
44
require-auth
55
get-args "?number:'none'"
66

@@ -37,13 +37,13 @@ command:pull-request() {
3737
local url="/repos/$parent_owner_repo/pulls"
3838

3939
if [[ "$number" =~ ^[0-9]+$ ]]; then
40-
local prompt_msg="Attach pull-request $owner/$repo:$branch_name -> $parent_owner_repo:$parent_base to issue #$number? [yN]"
40+
local prompt_msg="Attach PR $owner/$repo:$branch_name -> $parent_owner_repo:$parent_base to issue #$number? [yN]"
4141
local doit=$(prompt "$prompt_msg")
4242
if [[ "$doit" =~ ^[yY] ]]; then
4343
api-post "$url" "$(
4444
json-dump-object head "$head" base "$base" issue "$number"
4545
)"
46-
msg_ok="Attached pull-request to issue: $(JSON.get -s /html_url -)"
46+
msg_ok="Attached PR to issue: $(JSON.get -s /html_url -)"
4747
else
4848
msg_ok=0
4949
fi
@@ -81,14 +81,14 @@ $(git log $parent_remote_name/$parent_base..$branch_name)
8181
json-dump-object head "$head" base "$base" title "$title" body "$body"
8282
)"
8383
if OK; then
84-
msg_ok="New pull-request created: $(JSON.get -a /html_url -)"
84+
msg_ok="New PR created: $(JSON.get -a /html_url -)"
8585
else
86-
msg_fail="New pull-request failed: $(JSON.get -a /errors/0/message -)"
86+
msg_fail="New PR failed: $(JSON.get -a /errors/0/message -)"
8787
fi
8888
fi
8989
}
9090

91-
command:pulls() {
91+
command:pr-list() {
9292
get-args '?owner:get-owner/repo:get-repo'
9393

9494
state=open
@@ -101,7 +101,7 @@ command:pulls() {
101101
'number state title user/login created_at updated_at head/label base/label'
102102
}
103103

104-
format-entry:pulls() {
104+
format-entry:pr-list() {
105105
if "$raw_output"; then
106106
echo "$2"
107107
else
@@ -110,12 +110,12 @@ format-entry:pulls() {
110110
fi
111111
}
112112

113-
command:pull-diff() {
113+
command:pr-diff() {
114114
get-args '?owner:get-owner/repo:get-repo' number
115115
api-get "/repos/$owner/$repo/pulls/$number"
116116
}
117117

118-
ok:pull-diff() {
118+
ok:pr-diff() {
119119
head_url="$(JSON.get -s /head/repo/ssh_url -)"
120120
head_sha="$(JSON.get -s /head/sha -)"
121121
head_ref="$(JSON.get -s /head/ref -)"
@@ -129,7 +129,7 @@ ok:pull-diff() {
129129
git diff "$base_sha" "$head_sha"
130130
}
131131

132-
command:pull-fetch() {
132+
command:pr-fetch() {
133133
get-args '?owner:get-owner/repo:get-repo' number
134134
assert-inside-git-repo
135135
if [ -n "$(git branch | grep PR/$number)" ]; then
@@ -141,21 +141,21 @@ command:pull-fetch() {
141141
msg_ok=0
142142
}
143143

144-
command:pull-merge() {
144+
command:pr-merge() {
145145
get-args '?owner:get-owner/repo:get-repo' number '?message'
146146
# TODO Support merge message
147147
local json='{}'
148148
api-put "/repos/$owner/$repo/pulls/$number/merge" "$json"
149149
}
150150

151-
command:pull-queue() {
151+
command:pr-queue() {
152152
get-args '?user:get-user'
153153
local option1= option2=
154154
[ -n "$count_option" ] && option1=" --count=$count_option"
155155
$do_all && option2=" --all"
156156

157157
for repo in `git hub repos $user -r$option1`; do
158-
local pulls="`git hub pulls $repo$option2`"
158+
local pulls="`git hub pr-list $repo$option2`"
159159
if [[ ! "$pulls" =~ --None-- ]]; then
160160
echo
161161
echo "$pulls"

lib/git-hub.d/help-functions.bash

+27-27
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ org-edit org-edit <org> <key-value-pairs>...
4242
org-get org-get <org> <data-key>
4343
org-repos org-repos <org>
4444
orgs orgs [<user>]
45-
pull-diff pull-diff [<owner>/<repo>] <issue-id-number>
46-
pull-fetch pull-fetch [<owner>/<repo>] <issue-id-number>
47-
pull-merge pull-merge [<owner>/<repo>] <issue-id-number>
48-
pull-queue pull-queue [<user>] [--count=#] [--all]
49-
pull-request pull-request [<issue-id-number>] [<options>]
50-
pulls pulls [<owner>/<repo>]
45+
pr-diff pr-diff [<owner>/<repo>] <issue-id-number>
46+
pr-fetch pr-fetch [<owner>/<repo>] <issue-id-number>
47+
pr-list pr-list [<owner>/<repo>]
48+
pr-merge pr-merge [<owner>/<repo>] <issue-id-number>
49+
pr-new pr-new [<issue-id-number>] [<options>]
50+
pr-queue pr-queue [<user>] [--count=#] [--all]
5151
repo repo [<repo>]
5252
repo-delete repo-delete <owner>/<repo>
5353
repo-edit repo-edit [<owner>/]<repo> <key-value-pair>...
@@ -436,52 +436,46 @@ help:orgs() {
436436
...
437437
}
438438

439-
help:pull-diff() {
439+
help:pr-diff() {
440440
cat <<'...'
441441
442-
Usage: git hub pull-diff [<owner>/<repo>] <issue-id-number>
442+
Usage: git hub pr-diff [<owner>/<repo>] <issue-id-number>
443443
444444
Show the diff for a pull request.
445445
...
446446
}
447447

448-
help:pull-fetch() {
448+
help:pr-fetch() {
449449
cat <<'...'
450450
451-
Usage: git hub pull-fetch [<owner>/<repo>] <issue-id-number>
451+
Usage: git hub pr-fetch [<owner>/<repo>] <issue-id-number>
452452
453453
Fetches a pull request to a local `review/$number` branch
454454
...
455455
}
456456

457-
help:pull-merge() {
457+
help:pr-list() {
458458
cat <<'...'
459459
460-
Usage: git hub pull-merge [<owner>/<repo>] <issue-id-number>
460+
Usage: git hub pr-list [<owner>/<repo>]
461461
462-
Merge and close a pull request.
462+
List the pull requests for a repo.
463463
...
464464
}
465465

466-
help:pull-queue() {
466+
help:pr-merge() {
467467
cat <<'...'
468468
469-
Usage: git hub pull-queue [<user>] [--count=#] [--all]
469+
Usage: git hub pr-merge [<owner>/<repo>] <issue-id-number>
470470
471-
Show a user's Pull Request queue, for all repos. Shows the open PRs for any
472-
repo that has them. The `--count` option tells how many repos to check. The
473-
`--all` option says to show closed as well as open PRs.
474-
475-
Note: this command makes more API calls than most other commands and thus
476-
runs slower. You might want to tee the output to a file, if you need to get
477-
back to this data a lot.
471+
Merge and close a pull request.
478472
...
479473
}
480474

481-
help:pull-request() {
475+
help:pr-new() {
482476
cat <<'...'
483477
484-
Usage: git hub pull-request [<issue-id-number>] [<options>]
478+
Usage: git hub pr-new [<issue-id-number>] [<options>]
485479
486480
Create a new pull request for a repository based on the current branch. If
487481
an issue ID number is given, this command will attach the pull request to the
@@ -495,12 +489,18 @@ help:pull-request() {
495489
...
496490
}
497491

498-
help:pulls() {
492+
help:pr-queue() {
499493
cat <<'...'
500494
501-
Usage: git hub pulls [<owner>/<repo>]
495+
Usage: git hub pr-queue [<user>] [--count=#] [--all]
502496
503-
List the pull requests for a repo.
497+
Show a user's Pull Request queue, for all repos. Shows the open PRs for any
498+
repo that has them. The `--count` option tells how many repos to check. The
499+
`--all` option says to show closed as well as open PRs.
500+
501+
Note: this command makes more API calls than most other commands and thus
502+
runs slower. You might want to tee the output to a file, if you need to get
503+
back to this data a lot.
504504
...
505505
}
506506

man/man1/git-hub.1

+20-20
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@
7070
.rr rF
7171
.\" ========================================================================
7272
.\"
73-
.IX Title "IO::FILE=IO(0X18FA0F0) 1"
74-
.TH IO::FILE=IO(0X18FA0F0) 1 "2014-09-04" "perl v5.18.1" "User Contributed Perl Documentation"
73+
.IX Title "IO::FILE=IO(0XF7B0F0) 1"
74+
.TH IO::FILE=IO(0XF7B0F0) 1 "2014-09-04" "perl v5.18.1" "User Contributed Perl Documentation"
7575
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
7676
.\" way too many mistakes in technical documents.
7777
.if n .ad l
@@ -684,13 +684,13 @@ Close an issue. You can also use \f(CW\*(C`issue\-edit\*(C'\fR to close an issue
684684
.el .IP "\f(CWissue\-resolve [<owner>/<repo>] <issue\-id\-number>\fR" 4
685685
.IX Item "issue-resolve [<owner>/<repo>] <issue-id-number>"
686686
Add a comment to an issue and then close it.
687-
.ie n .IP """pulls [<owner>/<repo>]""" 4
688-
.el .IP "\f(CWpulls [<owner>/<repo>]\fR" 4
689-
.IX Item "pulls [<owner>/<repo>]"
687+
.ie n .IP """pr\-list [<owner>/<repo>]""" 4
688+
.el .IP "\f(CWpr\-list [<owner>/<repo>]\fR" 4
689+
.IX Item "pr-list [<owner>/<repo>]"
690690
List the pull requests for a repo.
691-
.ie n .IP """pull\-request [<issue\-id\-number>] [<options>]""" 4
692-
.el .IP "\f(CWpull\-request [<issue\-id\-number>] [<options>]\fR" 4
693-
.IX Item "pull-request [<issue-id-number>] [<options>]"
691+
.ie n .IP """pr\-new [<issue\-id\-number>] [<options>]""" 4
692+
.el .IP "\f(CWpr\-new [<issue\-id\-number>] [<options>]\fR" 4
693+
.IX Item "pr-new [<issue-id-number>] [<options>]"
694694
Create a new pull request for a repository based on the current branch. If an
695695
issue \s-1ID\s0 number is given, this command will attach the pull request to the
696696
issue instead of creating a new one.
@@ -700,21 +700,21 @@ branch of the parent repository. Otherwise the pull request will target the
700700
default branch of the default remote itself. Use \f(CW\*(C`\-\-remote\*(C'\fR, \f(CW\*(C`\-\-branch\*(C'\fR, \f(CW\*(C`\-\-
701701
parent\*(C'\fR, and \f(CW\*(C`\-\-base\*(C'\fR options to change the default source remote, source
702702
branch, target remote and target branch (respectively).
703-
.ie n .IP """pull\-diff [<owner>/<repo>] <issue\-id\-number>""" 4
704-
.el .IP "\f(CWpull\-diff [<owner>/<repo>] <issue\-id\-number>\fR" 4
705-
.IX Item "pull-diff [<owner>/<repo>] <issue-id-number>"
703+
.ie n .IP """pr\-diff [<owner>/<repo>] <issue\-id\-number>""" 4
704+
.el .IP "\f(CWpr\-diff [<owner>/<repo>] <issue\-id\-number>\fR" 4
705+
.IX Item "pr-diff [<owner>/<repo>] <issue-id-number>"
706706
Show the diff for a pull request.
707-
.ie n .IP """pull\-fetch [<owner>/<repo>] <issue\-id\-number>""" 4
708-
.el .IP "\f(CWpull\-fetch [<owner>/<repo>] <issue\-id\-number>\fR" 4
709-
.IX Item "pull-fetch [<owner>/<repo>] <issue-id-number>"
707+
.ie n .IP """pr\-fetch [<owner>/<repo>] <issue\-id\-number>""" 4
708+
.el .IP "\f(CWpr\-fetch [<owner>/<repo>] <issue\-id\-number>\fR" 4
709+
.IX Item "pr-fetch [<owner>/<repo>] <issue-id-number>"
710710
Fetches a pull request to a local \f(CW\*(C`review/$number\*(C'\fR branch
711-
.ie n .IP """pull\-merge [<owner>/<repo>] <issue\-id\-number>""" 4
712-
.el .IP "\f(CWpull\-merge [<owner>/<repo>] <issue\-id\-number>\fR" 4
713-
.IX Item "pull-merge [<owner>/<repo>] <issue-id-number>"
711+
.ie n .IP """pr\-merge [<owner>/<repo>] <issue\-id\-number>""" 4
712+
.el .IP "\f(CWpr\-merge [<owner>/<repo>] <issue\-id\-number>\fR" 4
713+
.IX Item "pr-merge [<owner>/<repo>] <issue-id-number>"
714714
Merge and close a pull request.
715-
.ie n .IP """pull\-queue [<user>] [\-\-count=#] [\-\-all]""" 4
716-
.el .IP "\f(CWpull\-queue [<user>] [\-\-count=#] [\-\-all]\fR" 4
717-
.IX Item "pull-queue [<user>] [--count=#] [--all]"
715+
.ie n .IP """pr\-queue [<user>] [\-\-count=#] [\-\-all]""" 4
716+
.el .IP "\f(CWpr\-queue [<user>] [\-\-count=#] [\-\-all]\fR" 4
717+
.IX Item "pr-queue [<user>] [--count=#] [--all]"
718718
Show a user's Pull Request queue, for all repos. Shows the open PRs for any
719719
repo that has them. The \f(CW\*(C`\-\-count\*(C'\fR option tells how many repos to check. The
720720
\&\f(CW\*(C`\-\-all\*(C'\fR option says to show closed as well as open PRs.

note/Commands

+4-4
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ org
2424
org-edit
2525
org-get
2626
orgs
27-
pull-diff
28-
pulls
29-
pull-merge
30-
pull-request
27+
pr-diff
28+
pr-list
29+
pr-merge
30+
pr-request
3131
repo
3232
repo-delete
3333
repo-edit

note/ToDo

+3-3
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,6 @@ x Chunk list json into an array of texts
187187
+ Support @ as shorthand for login-name
188188
+ Try loading git-hub-foo plugin for git-hub-foo-bar command
189189
+ repo-delete repo (don't require user/repo)
190-
+ pull-list - list pull requests
191-
+ pull-request - issue a pull request
192-
+ pull-merge - merge a pull request
190+
+ pr-list - list pull requests
191+
+ pr-new - issue a pull request
192+
+ pr-merge - merge a pull request

0 commit comments

Comments
 (0)