Skip to content

Commit c8926fc

Browse files
committed
Requested changes.
Signed-off-by: Antonio Jesus Navarro Perez <[email protected]>
1 parent 4134237 commit c8926fc

9 files changed

+37
-43
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ FROM ubuntu:16.04
1515
COPY --from=builder /go/bin/gitbase /bin
1616
RUN mkdir -p /opt/repos
1717

18-
ENV GITBASE_USER=gitbase
18+
ENV GITBASE_USER=root
1919
ENV GITBASE_PASSWORD=""
2020
ENV GITBASE_REPOS=/opt/repos
2121
EXPOSE 3306

README.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,23 @@ about the [Universal AST](https://doc.bblf.sh/) of the code itself. gitbase is b
88
gitbase implements the *MySQL* wire protocol, it can be accessed using any MySQL
99
client or library from any language.
1010

11-
[src-d/go-mysql-server](https://github.com/src-d/go-mysql-server) is the project where the SQL engine used by ***gitbase*** is implemented.
11+
[src-d/go-mysql-server](https://github.com/src-d/go-mysql-server) is the SQL engine implementation used by `gitbase`.
1212

1313
## Status
1414

1515
The project is currently in **alpha** stage, meaning it's still lacking performance in a number of cases but we are working hard on getting a performant system able to process thousands of repositories in a single node. Stay tuned!
1616

1717
## Examples
1818

19-
You can see some examples [here](/docs/using-gitbase/examples.md).
20-
21-
For more info about how to use it, see the [docs](/docs).
19+
You can see some [query examples](/docs/using-gitbase/examples.md) in [gitbase documentation](/docs).
2220

2321
## Motivation and scope
2422

25-
gitbase was born to make easier the task of analyze git repositories and source code contained on them.
23+
gitbase was born to ease the analysis of git repositories and its source code.
2624

27-
Also, making it MySQL compatible, we want the maximum compatibility between languages and existing tools.
25+
Also, making it MySQL compatible, we provide the maximum compatibility between languages and existing tools.
2826

29-
Having that running on a simple binary allow us to use as a stand-alone service able to process some local repositories, or integrate it with other existing tools and frameworks like Spark to make large-scale source code analysis.
27+
As a single binary allows use it as a standalone service. The service is able to process local repositories or integrate with existing tools and frameworks (e.g. spark) to make source code analysis on the large scale.
3028

3129
## Further reading
3230

docs/join-the-community.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,12 @@ If you need support, want to contribute or just want to say hi, join us at the [
66

77
## Contributing
88

9-
You can start contributing in many ways
9+
You can start contributing in many ways:
1010

11-
* [Reporting bugs.](/docs/join-the-community.md#reporting-bugs)
12-
* [Request a feature.](https://github.com/src-d/gitbase/issues)
13-
* Improve the [documentation](https://github.com/src-d/gitbase/docs).
14-
* Contribute code to [gitbase](https://github.com/src-d/gitbase),
15-
* Write a new data source using [go-mysql-server](https://github.com/src-d/go-mysql-server)
11+
* [Report bugs](/docs/join-the-community.md#reporting-bugs)
12+
* [Request a feature](https://github.com/src-d/gitbase/issues)
13+
* Improve the [documentation](https://github.com/src-d/gitbase/docs)
14+
* Contribute code to [gitbase](https://github.com/src-d/gitbase)
1615

1716
## Reporting bugs
1817

docs/using-gitbase/configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
| `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).|
1212
| `GITBASE_SKIP_GIT_ERRORS` | do not stop queries on git errors, default disabled |
1313

14-
## Executable parameters
14+
## Command line arguments
1515

1616
```bash
1717
Please specify one command of: server or version

docs/using-gitbase/examples.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ WHERE commits.commit_author_name = 'Javi Fontan' AND refs.ref_name='HEAD';
1515
SELECT * FROM refs WHERE ref_name = 'HEAD'
1616
```
1717

18-
## Commits that appears in more than one reference
18+
## Commits that appear in more than one reference
1919

2020
```sql
2121
SELECT * FROM (
@@ -39,7 +39,7 @@ INNER JOIN commit_blobs cb
3939
GROUP BY c.commit_hash
4040
```
4141

42-
## Get commits per commiter, per month in 2015
42+
## Get commits per committer, per month in 2015
4343

4444
```sql
4545
SELECT COUNT(*) as num_commits, month, repo_id, committer_email

docs/using-gitbase/functions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## gitbase functions
44

5-
To make some common tasks easier for the user, there are some functions to interact with the previous mentioned tables:
5+
To make some common tasks easier for the user, there are some functions to interact with the aforementioned tables:
66

77
| Name | Description |
88
|:-------------|:----------------------------------------------------------------------------------------------------|
@@ -14,4 +14,4 @@ To make some common tasks easier for the user, there are some functions to inter
1414

1515
## Standard functions
1616

17-
You can check standard functions from `go-mysql-server` [here](https://github.com/src-d/go-mysql-server/tree/5620932d8b3ca58edd6bfa4c168073d4c1ff665f#custom-functions).
17+
You can check standard functions in [`go-mysql-server` documentation](https://github.com/src-d/go-mysql-server/tree/5620932d8b3ca58edd6bfa4c168073d4c1ff665f#custom-functions).

docs/using-gitbase/getting-started.md

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,56 +2,56 @@
22

33
## Prerequisites
44

5-
**gitbase** has two optional dependencies that should be running on your system if you're planning on using certain functionality.
5+
`gitbase` has two optional dependencies that should be running on your system if you're planning on using certain functionality.
66

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).
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)
99

10-
## Download an use the binary
10+
## Download and use the binary
1111

12-
Check the [Release](https://github.com/src-d/gitbase/releases) page to download the gitbase binary.
12+
Check the [Releases](https://github.com/src-d/gitbase/releases) page to download the gitbase binary.
1313

14-
For more info about executable parameters, [go here](/docs/using-gitbase/configuration.md#executable-parameters).
14+
For more info about command line arguments, [go here](/docs/using-gitbase/configuration.md#command-line-arguments).
1515

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

1818
```
19-
$ gitbase server -v -g /path/to/repositories -u gitbase
19+
$ gitbase server -v -g /path/to/repositories
2020
```
2121

2222
## Installing from source
2323

2424
Because gitbase uses [bblfsh's client-go](https://github.com/bblfsh/client-go), which uses cgo, you need to install some dependencies by hand instead of just using `go get`.
2525

26-
_Note_: we use `go get -d` so the code is not compiled yet, as it would
26+
**Note**: we use `go get -d` so the code is not compiled yet, as it would
2727
fail before `make dependencies` is executed successfully.
2828

2929
```
30-
go get -d github.com/src-d/gitbase
31-
cd $GOPATH/src/github.com/src-d/gitbase
32-
make dependencies
30+
$ go get -d github.com/src-d/gitbase
31+
$ cd $GOPATH/src/github.com/src-d/gitbase
32+
$ make dependencies
3333
```
3434

3535
## Running with docker
3636

3737
You can use the official image from [docker hub](https://hub.docker.com/r/srcd/gitbase/tags/) to quickly run gitbase:
3838
```
39-
docker run --rm --name gitbase -p 3306:3306 -v /my/git/repos:/opt/repos srcd/gitbase:latest
39+
$ docker run --rm --name gitbase -p 3306:3306 -v /my/git/repos:/opt/repos srcd/gitbase:latest
4040
```
4141

42-
If you want to speedup gitbase using indexes, you must run a pilosa container:
42+
If you want to speedup gitbase using indexes you must run a pilosa container:
4343
```
44-
docker run -it --rm --name pilosa -p 10101:10101 pilosa/pilosa:v0.9.0
44+
$ docker run -it --rm --name pilosa -p 10101:10101 pilosa/pilosa:v0.9.0
4545
```
4646

4747
Then link the gitbase container to the pilosa one:
4848
```
49-
docker run --rm --name gitbase -p 3306:3306 --link pilosa:pilosa -e PILOSA_ENDPOINT="http://pilosa:10101" -v /my/git/repos:/opt/repos srcd/gitbase:latest
49+
$ docker run --rm --name gitbase -p 3306:3306 --link pilosa:pilosa -e PILOSA_ENDPOINT="http://pilosa:10101" -v /my/git/repos:/opt/repos srcd/gitbase:latest
5050
```
5151

5252
## Connecting to the server
5353

54-
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:
5555

5656
```bash
5757
$ mysql -q -u root -h 127.0.0.1
@@ -64,9 +64,4 @@ SELECT commit_hash, commit_author_email, commit_author_name FROM commits LIMIT 2
6464
| 01ace9e4d144aaeb50eb630fed993375609bcf55 | [email protected] | Antonio Navarro Perez |
6565
+------------------------------------------+---------------------+-----------------------+
6666
2 rows in set (0.01 sec)
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-
```
67+
```

docs/using-gitbase/schema.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ This table contains all hash [git references](https://git-scm.com/book/en/v2/Git
6767
+---------------------+-----------+
6868
```
6969

70-
Commits contains all the [commits](https://git-scm.com/book/en/v2/Git-Internals-Git-Objects#_git_commit_objects) from all the references from all the repositories, not duplicated by repository. Note that you can have the same commit in several repositories. In that case, the commit will appears two times on the table, one per repository.
70+
Commits contains all the [commits](https://git-scm.com/book/en/v2/Git-Internals-Git-Objects#_git_commit_objects) from all the references from all the repositories, not duplicated by repository. Note that you can have the same commit in several repositories. In that case the commit will appear two times on the table, one per repository.
7171

7272
> Note that this table is not only showing `HEAD` commits but all the commits on the repository (that can be a lot more than the commits on `HEAD` reference).
7373
@@ -120,6 +120,8 @@ This table exposes blob objects, that are the content without path from files.
120120

121121
`files` is an utility table mixing `tree_entries` and `blobs` to create files. It includes the file path.
122122

123+
Queries to this table are expensive and they should be done carefully (applying filters or using directly `blobs` or `tree_entries` tables).
124+
123125
## Relation tables
124126

125127
### commit_blobs

pull_request_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!--
22
3-
All PRs must keep up to date the documentation. If this PR changes or add some new behavior don't forget to check:
3+
All PRs must keep the documentation up to date. If this PR changes or adds some new behavior don't forget to check:
44
55
- Schema changes
66
- Syntax changes

0 commit comments

Comments
 (0)