Skip to content

Commit 4134237

Browse files
committed
merge documentation with new one from master
Signed-off-by: Antonio Jesus Navarro Perez <[email protected]>
1 parent f4eada5 commit 4134237

File tree

3 files changed

+62
-47
lines changed

3 files changed

+62
-47
lines changed

cmd/gitbase/command/server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const (
2323
ServerDescription = "Starts a gitbase server instance"
2424
ServerHelp = ServerDescription + "\n\n" +
2525
"The squashing tables and pushing down join conditions is still a\n" +
26-
"work in progress and unstable, disable by default. It can be enabled\n" +
26+
"work in progress and unstable, disabled by default. It can be enabled\n" +
2727
"using a not empty value at GITBASE_UNSTABLE_SQUASH_ENABLE env variable.\n\n" +
2828
"By default when gitbase encounters an error in a repository it\n" +
2929
"stops the query. With GITBASE_SKIP_GIT_ERRORS variable it won't\n" +

docs/using-gitbase/configuration.md

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,54 @@
55
| Name | Description |
66
|:---------------------------------|:----------------------------------------------------|
77
| `BBLFSH_ENDPOINT` | bblfshd endpoint, default "127.0.0.1:9432" |
8+
| `PILOSA_ENDPOINT` | pilosa endpoint, default "http://localhost:10101" |
89
| `GITBASE_BLOBS_MAX_SIZE` | maximum blob size to return in MiB, default 5 MiB |
910
| `GITBASE_BLOBS_ALLOW_BINARY` | enable retrieval of binary blobs, default `false` |
1011
| `GITBASE_UNSTABLE_SQUASH_ENABLE` | enable join squash rule to improve query performance **experimental**. This optimization collects inner joins between tables with a set of supported conditions and converts them into a single node that retrieves the data in chained steps (getting first the commits and then the blobs of every commit instead of joining all commits and all blobs, for example).|
1112
| `GITBASE_SKIP_GIT_ERRORS` | do not stop queries on git errors, default disabled |
1213

13-
## Executable parameters
14+
## Executable parameters
15+
16+
```bash
17+
Please specify one command of: server or version
18+
Usage:
19+
gitbase [OPTIONS] <server | version>
20+
21+
Help Options:
22+
-h, --help Show this help message
23+
24+
Available commands:
25+
server Starts a gitbase server instance
26+
version Show the version information
27+
```
28+
29+
`server` command contains the following options:
30+
31+
```bash
32+
Usage:
33+
gitbase [OPTIONS] server [server-OPTIONS]
34+
35+
Starts a gitbase server instance
36+
37+
The squashing tables and pushing down join conditions is still a
38+
work in progress and unstable, disable by default. It can be enabled
39+
using a not empty value at GITBASE_UNSTABLE_SQUASH_ENABLE env variable.
40+
41+
By default when gitbase encounters an error in a repository it
42+
stops the query. With GITBASE_SKIP_GIT_ERRORS variable it won't
43+
complain and just skip those rows or repositories.
44+
45+
Help Options:
46+
-h, --help Show this help message
47+
48+
[server command options]
49+
-v Activates the verbose mode
50+
-g, --git= Path where the git repositories are located, multiple directories can be defined. Accepts globs.
51+
--siva= Path where the siva repositories are located, multiple directories can be defined. Accepts globs.
52+
-h, --host= Host where the server is going to listen (default: localhost)
53+
-p, --port= Port where the server is going to listen (default: 3306)
54+
-u, --user= User name used for connection (default: root)
55+
-P, --password= Password used for connection
56+
--pilosa= URL to your pilosa server (default: http://localhost:10101)
57+
-i, --index= Directory where the gitbase indexes information will be persisted. (default: /var/lib/gitbase/index)
58+
```

docs/using-gitbase/getting-started.md

Lines changed: 15 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,22 @@
11
# Getting started
22

3-
## Download an use the binary
3+
## Prerequisites
44

5-
Check the [Release](https://github.com/src-d/gitbase/releases) page to download the gitbase binary.
5+
**gitbase** has two optional dependencies that should be running on your system if you're planning on using certain functionality.
66

7-
```bash
8-
Please specify one command of: server or version
9-
Usage:
10-
gitbase [OPTIONS] <server | version>
7+
- [bblfsh](https://github.com/bblfsh/bblfshd) >= 2.5.0 (only if you're planning to use the `UAST` functionality provided in gitbase).
8+
- [pilosa](https://github.com/pilosa/pilosa) 0.9.0 (only if you're planning on using indexes).
119

12-
Help Options:
13-
-h, --help Show this help message
10+
## Download an use the binary
1411

15-
Available commands:
16-
server Starts a gitbase server instance
17-
version Show the version information
18-
```
12+
Check the [Release](https://github.com/src-d/gitbase/releases) page to download the gitbase binary.
1913

20-
`server` command contains the following options:
21-
22-
```bash
23-
Usage:
24-
gitbase [OPTIONS] server [server-OPTIONS]
25-
26-
Starts a gitbase server instance
27-
28-
The squashing tables and pushing down join conditions is still a
29-
work in progress and unstable, disable by default. It can be enabled
30-
using a not empty value at GITBASE_UNSTABLE_SQUASH_ENABLE env variable.
31-
32-
By default when gitbase encounters an error in a repository it
33-
stops the query. With GITBASE_SKIP_GIT_ERRORS variable it won't
34-
complain and just skip those rows or repositories.
35-
36-
Help Options:
37-
-h, --help Show this help message
38-
39-
[server command options]
40-
-v Activates the verbose mode
41-
-g, --git= Path where the git repositories are located, multiple directories can be defined. Accepts globs.
42-
--siva= Path where the siva repositories are located, multiple directories can be defined. Accepts globs.
43-
-h, --host= Host where the server is going to listen (default: localhost)
44-
-p, --port= Port where the server is going to listen (default: 3306)
45-
-u, --user= User name used for connection (default: root)
46-
-P, --password= Password used for connection
47-
--pilosa= URL to your pilosa server (default: http://localhost:10101)
48-
-i, --index= Directory where the gitbase indexes information will be persisted. (default: /var/lib/gitbase/index)
49-
```
14+
For more info about executable parameters, [go here](/docs/using-gitbase/configuration.md#executable-parameters).
5015

5116
You can start a server by providing a path which contains multiple git repositories `/path/to/repositories` with this command:
5217

5318
```
54-
$ gitbase server -v -g /path/to/repositories
19+
$ gitbase server -v -g /path/to/repositories -u gitbase
5520
```
5621

5722
## Installing from source
@@ -86,7 +51,7 @@ docker run --rm --name gitbase -p 3306:3306 --link pilosa:pilosa -e PILOSA_ENDPO
8651

8752
## Connecting to the server
8853

89-
When the server is started,a MySQL client is needed to connect to the server. For example:
54+
When the server is started, a MySQL client is needed to connect to the server. For example:
9055

9156
```bash
9257
$ mysql -q -u root -h 127.0.0.1
@@ -99,4 +64,9 @@ SELECT commit_hash, commit_author_email, commit_author_name FROM commits LIMIT 2
9964
| 01ace9e4d144aaeb50eb630fed993375609bcf55 | [email protected] | Antonio Navarro Perez |
10065
+------------------------------------------+---------------------+-----------------------+
10166
2 rows in set (0.01 sec)
102-
```
67+
```
68+
69+
If gitbase is running in a container from the official image, you must use `gitbase` as user:
70+
```
71+
mysql -q -u gitbase -h 127.0.0.1
72+
```

0 commit comments

Comments
 (0)