README.md 1.42 KB
Newer Older
Jonah Brüchert's avatar
Jonah Brüchert committed
1
2
# Git Lab

3
4
Subcommand for git providing a command line interface to GitLab.
An arc-style interface is also provided for a simplified transition from Phabricator to GitLab.
Jonah Brüchert's avatar
Jonah Brüchert committed
5

6
7
8
9
10
11
12
13
## Installation

```
git clone https://invent.kde.org/sdk/git-lab && cd git-lab
sudo pip3 install -r requirements.txt
sudo ./setup.py install
```

14
## Workflow
Jonah Brüchert's avatar
Jonah Brüchert committed
15

16
17
18
19
20
21
### Logging in

```
git lab login --host invent.kde.org --token ${YOUR_PRIVATE_TOKEN}
```

22
Your token is saved in the json file `~/.config/gitlabconfig` by default.
23
24
25
Alternatively, instead of a token, you can also specify a command (`--command`) that returns the token.
This way, you can store the token in a password manager or gpg-encrypted.

26
### Creating a merge request
Jonah Brüchert's avatar
Jonah Brüchert committed
27
28
29
30

```
git checkout -b feature
```
31
32
33

Do your changes

Jonah Brüchert's avatar
Jonah Brüchert committed
34
35
```
git commit -m "Commit message"
36
git lab mr
Jonah Brüchert's avatar
Jonah Brüchert committed
37
38
```

39
40
41
42
43
### Listing merge requests

* Merge requests for the current repository

```
44
git lab mrs --project
45
46
47
48
```

* Merge requests for the current GitLab instance (detected from the repository)
```
49
git lab mrs
50
51
```

Tobias Fella's avatar
Tobias Fella committed
52
53
* To only show merge requests in specific states, any combination of `--merged`, `--opened` and `--closed` can be added

54
### Testing a merge request
Jonah Brüchert's avatar
Jonah Brüchert committed
55
56

```
57
git lab checkout ${NUMBER}
Jonah Brüchert's avatar
Jonah Brüchert committed
58
59
```

60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
### Searching for a project

```
git lab search ${NAME}
```

### Creating a snippet

```
git lab snippet ${FILENAME}
```

or

```
echo "Paste data" | git lab snippet
```

78
79
80
81
82
83
84
85
86
## Contributing

### Run tests
```
pytest
```

### Run linter
```
87
./scripts/lint.sh
88
```