File: README.md

package info (click to toggle)
android-platform-tools 29.0.6-28
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 365,224 kB
  • sloc: cpp: 1,049,638; java: 460,532; ansic: 375,452; asm: 301,257; xml: 134,509; python: 92,731; perl: 62,008; sh: 26,753; makefile: 3,210; javascript: 3,172; yacc: 1,403; lex: 455; awk: 368; ruby: 183; sql: 140
file content (123 lines) | stat: -rw-r--r-- 3,234 bytes parent folder | download | duplicates (2)
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
Repo Pull
=========

`repo_pull.py` pulls multiple change lists from a Gerrit code review website.
A user may specify a query string and `repo_pull.py` will pull the matching
change lists.

For example, to pull the `repo-pull-initial-cl` topic from AOSP, run this
command:

    repo_pull.py pull 'topic:repo-pull-initial-cl' \
        -g https://android-review.googlesource.com

Read [Usage](#Usages) and [Examples](#Examples) for more details.


## Installation

`repo_pull.py` requires `.gitcookies` to access Gerrit APIs.  Please
check whether the Gerrit Code Review URL is in `~/.gitcookies`.

If you don't have an entry, follow these steps:

1. Visit the [Gerrit Code Review](https://android-review.googlesource.com).

2. Click [Settings -> HTTP Credentials](https://android-review.googlesource.com/settings/#HTTPCredentials)

3. Click **Obtain password**

4. Copy the highlighted shell commands and paste them in a terminal.

Note: You must repeat these for each Gerrit Code Review websites.


## Usages

Command line usages:

    $ repo_pull.py [sub-command] [query] \
                   [-g gerrit] \
                   [-b local-topic-branch] \
                   [-j num-threads] \
                   [--limits max-num-changes]


Three sub-commands are supported:

* `repo_pull.py json` prints the change lists in the JSON file format.

* `repo_pull.py bash` prints the *bash commands* that can pull the change lists.

* `repo_pull.py pull` *pulls the change lists* immediately.


### Query String

`[query]` is the query string that can be entered to the Gerrit search box.

These are common queries:

* `topic:name`
* `hashtag:name`
* `branch:name`
* `project:name`
* `owner:name`
* `is:open` | `is:merged` | `is:abandoned`
* `message:text`


### Options

* `-g` or `--gerrit` specifies the URL of the Gerrit Code Review website.
  *(required)*

* `-b` or `--branch` specifies the local branch name that will be passed to
  `repo start`.

* `-j` or `--parallel` specifies the number of parallel threads while pulling
  change lists.

* `-n` or `--limits` specifies the maximum number of change lists.  (default:
  1000)

* `-m` or `--merge` specifies the method to pick the merge commits.  (default:
  `merge-ff-only`)

* `-p` or `--pick` specifies the method to pick the non-merge commits.
  (default: `pick`)

  * `pick` maps to `git cherry-pick --allow-empty`
  * `merge` maps to `git merge --no-edit`
  * `merge-ff-only` maps to `git merge --no-edit --ff-only`
  * `merge-no-ff` maps to `git merge --no-edit --no-ff`
  * `reset` maps to `git reset --hard`
  * `checkout` maps to `git checkout`


## Examples

To print the change lists with the topic `repo-pull-initial-cl` in JSON file
format:

```
repo_pull.py json 'topic:repo-pull-initial-cl' \
    -g https://android-review.googlesource.com
```

To print the bash commands that can pull the change lists, use the `bash`
command:

```
repo_pull.py bash 'topic:repo-pull-initial-cl' \
    -g https://android-review.googlesource.com \
    -b my-local-topic-branch
```

To pull the change lists immediately, use the `pull` command:

```
repo_pull.py pull 'topic:repo-pull-initial-cl' \
    -g https://android-review.googlesource.com \
    -b my-local-topic-branch
```