-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
72 lines (52 loc) · 1.82 KB
/
README.Rmd
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
[![Build Status](https://travis-ci.org/stewid/gix.png)](https://travis-ci.org/stewid/gix)
# Introduction
`gix` is an R package that aims to index and search a Git repository
using the [Xapian](http://xapian.org/) search engine.
## Index a repository
Index the content of a git repository to documents with the Xapian
search engine. A `document` is the data returned from a search. The
indexing creates a database located in the `.xapian` folder in the
repository.
```{r, index, message=FALSE}
library(gix)
## Index the 'gix' repository. (Current directory)
gixit(".", github = "stewid/gix")
```
## Search a repository
```{r, search_author, message=FALSE}
## Search for author Widgren and display url to blob on GitHub
gix(".", "author:widgren")$url
```
```{r, search_sha, message=FALSE}
## Search for sha that starts with 'd7'
gix(".", "sha:d7*")[, c("sha", "url")]
```
```{r, search_content, message=FALSE}
## Search for 'biarch' and view date of author commit and url
gix(".", "biarch")[, c("when", "url")]
```
## Installation
The following two R packages must be installed:
- [xapr](https://github.com/stewid/xapr)
- [git2r](https://github.com/ropensci/git2r)
To install the development version of `gix`, it's easiest to use the
devtools package:
```{r, install, eval = FALSE}
# install.packages("devtools")
library(devtools)
install_github("stewid/gix")
```
Another alternative is to use `git` and `make`
```
$ git clone https://github.com/stewid/gix.git
$ cd gix
$ make install
```
**NOTE:** The package is in a very early development phase. Functions
and documentation may be incomplete and subject to
change. Suggestions, bugs, forks and pull requests are
appreciated. Get in touch.
# License
The `gix` package is licensed under the GPL (>= 2). See these files
for additional details:
- [LICENSE](LICENSE) - `gix` package license