Skip to content

Commit

Permalink
Merge branch 'master' into fix/remove-jaeger-env-vars
Browse files Browse the repository at this point in the history
  • Loading branch information
ajnavarro authored Jul 3, 2018
2 parents bf1934a + e7091ed commit aac53bd
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 80 deletions.
Binary file modified docs/assets/gitbase-db-diagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/gitbase_model.mwb
Binary file not shown.
94 changes: 17 additions & 77 deletions docs/using-gitbase/schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,21 @@ This table represents the relation between commits and blobs. With this table yo

This table represents the relation between commits and trees. With this table you can obtain all the tree entries contained on a commit object.

### commit_files
```sql
+---------------+------+
| name | type |
+---------------+------+
| repository_id | TEXT |
| commit_hash | TEXT |
| file_path | TEXT |
| blob_hash | TEXT |
| tree_hash | TEXT |
+---------------+------+
```

This table represents the relation between commits and [files](#files). Using this table, you can obtain all the files related to a certain commit object.

### ref_commits
```sql
+---------------+-------+
Expand All @@ -171,83 +186,8 @@ Commits will be repeated if they are in several repositories or references.
## Database diagram
<!--
repositories as r
-
repository_id string
remotes
-
repository_id string FK - r.repository_id
remote_name string
remote_push_url string
remote_fetch_url string
remote_push_refspec string
remote_fetch_refspec string
refs
-
repository_id string FK >- repositories.repository_id
ref_name string
commit_hash string FK >- commits.commit_hash
commits as c
-
repository_id string FK >- repositories.repository_id
commit_hash string
commit_author_name string
commit_author_email string
commit_author_when timestamp
committer_name string
committer_email string
committer_when timestamp
commit_message string
tree_hash string FK >- tree_entries.tree_hash
commit_parents array[string]
blobs as b
-
repository_id string FK >- repositories.repository_id
blob_hash string
blob_size number
blob_content blob
tree_entries as te
-
repository_id string FK >- repositories.repository_id
tree_hash string
blob_hash string FK >- blobs.blob_hash
tree_entry_mode number
tree_entry_name string
files as f
-
repository_id string FK >- repositories.repository_id
blob_hash string FK >- blobs.blob_hash
file_path string
tree_hash string FK >- tree_entries.tree_hash
tree_entry_mode number
blob_content blob
blob_size number
ref_commits
-
repository_id string FK >- repositories.repository_id
commit_hash string FK >- commits.commit_hash
ref_name string FK >- refs.ref_name
index number
commit_trees
-
repository_id string FK >- repositories.repository_id
commit_hash string FK >- commits.commit_hash
tree_hash string FK >- tree_entries.tree_hash
commit_blobs
-
repository_id string FK >- repositories.repository_id
commit_hash string FK >- commits.commit_hash
blob_hash string FK >- blobs.blob_hash
Diagram generated with MySQL Workbench. Edit the model in docs/assets/gitbase_model.mwb to generate a new diagram in case it needs some changes.
-->

![gitbase schema](/docs/assets/gitbase-db-diagram.png)
![gitbase schema](/docs/assets/gitbase-db-diagram.png)
11 changes: 8 additions & 3 deletions rev-upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,18 @@ echo "Project: $PRJ"
echo "Old rev: $REV_OLD"
echo "New rev: $REV_NEW"

if [ $REV_OLD == $REV_NEW ]; then
if [ "$REV_OLD" == "$REV_NEW" ]; then
exit 0
fi

for file in $(git ls-files | xargs egrep -l $REV_OLD); do
for file in $(git ls-files | xargs egrep -l "$REV_OLD"); do
echo "# $file"
sed -i '' "s/$REV_OLD/$REV_NEW/g" $file
if [[ $OSTYPE == darwin* ]]; then
sed -i '' "s/$REV_OLD/$REV_NEW/g" "$file"
else
sed -i'' "s/$REV_OLD/$REV_NEW/g" "$file"
fi

done

err=$?
Expand Down

0 comments on commit aac53bd

Please sign in to comment.