git2r

R bindings to the libgit2 library

https://github.com/ropensci/git2r

Science Score: 36.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    4 of 32 committers (12.5%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.3%) to scientific vocabulary

Keywords

git git-client libgit2 libgit2-library r r-package rstats

Keywords from Contributors

tidy-data rmarkdown package-creation csv genome setup pandoc literate-programming fwf parsing
Last synced: 6 months ago · JSON representation

Repository

R bindings to the libgit2 library

Basic Info
Statistics
  • Stars: 218
  • Watchers: 9
  • Forks: 61
  • Open Issues: 96
  • Releases: 32
Topics
git git-client libgit2 libgit2-library r r-package rstats
Created about 12 years ago · Last pushed 11 months ago
Metadata Files
Readme Changelog License

README.md

R-CMD-check CRAN status CRAN RStudio mirror downloads Coverage Status

Introduction

The git2r package gives you programmatic access to Git repositories from R. Internally the package uses the libgit2 library which is a pure C implementation of the Git core methods. For more information about libgit2, check out libgit2's website (http://libgit2.github.com).

Suggestions, bugs, forks and pull requests are appreciated. Get in touch.

Installation

To install the version available on CRAN:

coffee install.packages("git2r")

To install the development version of git2r, it's easiest to use the devtools package:

```coffee

install.packages("remotes")

library(remotes) install_github("ropensci/git2r") ```

Usage

Repository

The central object in the git2r package is the S3 class git_repository. The following three methods can instantiate a repository; init, repository and clone.

Create a new repository

Create a new repository in a temporary directory using init

coffee library(git2r)

```

> Loading required package: methods

```

```coffee

Create a temporary directory to hold the repository

path <- tempfile(pattern="git2r-") dir.create(path)

Initialize the repository

repo <- init(path)

Display a brief summary of the new repository

repo ```

```

> Local: /tmp/Rtmp7CXPlx/git2r-1ae2305c0e8d/

> Head: nothing commited (yet)

```

```coffee

Check if repository is bare

is_bare(repo) ```

```

> [1] FALSE

```

```coffee

Check if repository is empty

is_empty(repo) ```

```

> [1] TRUE

```

Create a new bare repository

```coffee

Create a temporary directory to hold the repository

path <- tempfile(pattern="git2r-") dir.create(path)

Initialize the repository

repo <- init(path, bare=TRUE)

Check if repository is bare

is_bare(repo) ```

```

> [1] TRUE

```

Clone a repository

```coffee

Create a temporary directory to hold the repository

path <- file.path(tempfile(pattern="git2r-"), "git2r") dir.create(path, recursive=TRUE)

Clone the git2r repository

repo <- clone("https://github.com/ropensci/git2r", path) ```

```

> cloning into '/tmp/Rtmp7CXPlx/git2r-1ae27d811539/git2r'...

> Receiving objects: 1% (24/2329), 12 kb

> Receiving objects: 11% (257/2329), 60 kb

> Receiving objects: 21% (490/2329), 100 kb

> Receiving objects: 31% (722/2329), 125 kb

> Receiving objects: 41% (955/2329), 237 kb

> Receiving objects: 51% (1188/2329), 574 kb

> Receiving objects: 61% (1421/2329), 1014 kb

> Receiving objects: 71% (1654/2329), 1350 kb

> Receiving objects: 81% (1887/2329), 1733 kb

> Receiving objects: 91% (2120/2329), 2614 kb

> Receiving objects: 100% (2329/2329), 2641 kb, done.

```

```coffee

Summary of repository

summary(repo) ```

```

> Remote: @ origin (https://github.com/ropensci/git2r)

> Local: master /tmp/Rtmp7CXPlx/git2r-1ae27d811539/git2r/

>

> Branches: 1

> Tags: 0

> Commits: 320

> Contributors: 3

> Ignored files: 0

> Untracked files: 0

> Unstaged files: 0

> Staged files: 0

```

```coffee

List all references in repository

references(repo) ```

```

> $refs/heads/master

> [6fb440] master

>

> $refs/remotes/origin/master

> [6fb440] origin/master

```

```coffee

List all branches in repository

branches(repo) ```

```

> [[1]]

> 6fb440 (HEAD) master

>

> [[2]]

> 6fb440 master

```

Open an existing repository

```coffee

Open an existing repository

repo <- repository(path)

Workdir of repository

workdir(repo) ```

```

> [1] "/tmp/Rtmp7CXPlx/git2r-1ae27d811539/git2r/"

```

```coffee

List all commits in repository

commits(repo)[[1]] # Truncated here for readability ```

```

> Commit: 6fb440133765e80649de8d714eaea17b114bd0a7

> Author: Stefan Widgren stefan.widgren@gmail.com

> When: 2014-04-22 21:43:19

> Summary: Fixed clone progress to end line with newline

```

```coffee

Get HEAD of repository

repository_head(repo) ```

```

> 6fb440 (HEAD) master

```

```coffee

Check if HEAD is head

ishead(repositoryhead(repo)) ```

```

> [1] TRUE

```

```coffee

Check if HEAD is local

islocal(repositoryhead(repo)) ```

```

> [1] TRUE

```

```coffee

List all tags in repository

tags(repo) ```

```

> list()

```

Configuration

```coffee config(repo, user.name="Git2r Readme", user.email="git2r.readme@example.org")

Display configuration

config(repo) ```

```

> global:

> core.autocrlf=input

> local:

> branch.master.merge=refs/heads/master

> branch.master.remote=origin

> core.bare=false

> core.filemode=true

> core.logallrefupdates=true

> core.repositoryformatversion=0

> remote.origin.fetch=+refs/heads/:refs/remotes/origin/

> remote.origin.url=https://github.com/ropensci/git2r

> user.email=git2r.readme@example.org

> user.name=Git2r Readme

```

Commit

```coffee

Create a new file

writeLines("Hello world!", file.path(path, "test.txt"))

Add file and commit

add(repo, "test.txt") commit(repo, "Commit message") ```

```

> Commit: 0a6af48cedf43208bde34230662280514e0956eb

> Author: Git2r Readme git2r.readme@example.org

> When: 2014-04-22 21:44:57

> Summary: Commit message

```

License

The git2r package is licensed under the GPLv2.


Owner

  • Name: rOpenSci
  • Login: ropensci
  • Kind: organization
  • Email: info@ropensci.org
  • Location: Berkeley, CA

GitHub Events

Total
  • Create event: 2
  • Issues event: 6
  • Release event: 2
  • Watch event: 5
  • Issue comment event: 16
  • Push event: 26
  • Pull request event: 7
  • Fork event: 4
Last Year
  • Create event: 2
  • Issues event: 6
  • Release event: 2
  • Watch event: 5
  • Issue comment event: 16
  • Push event: 26
  • Pull request event: 7
  • Fork event: 4

Committers

Last synced: 9 months ago

All Time
  • Total Commits: 2,697
  • Total Committers: 32
  • Avg Commits per committer: 84.281
  • Development Distribution Score (DDS): 0.047
Past Year
  • Commits: 61
  • Committers: 5
  • Avg Commits per committer: 12.2
  • Development Distribution Score (DDS): 0.066
Top Committers
Name Email Commits
Stefan Widgren s****n@g****m 2,569
Karthik Ram k****m@g****m 34
Jeroen Ooms j****s@g****m 16
John Blischak j****k@g****m 13
Gregory Jefferis j****s@g****m 11
Elliott Sales de Andrade q****t@g****m 10
jennybc j****y@s****a 6
Jim Hester j****r@g****m 4
Scott Chamberlain m****s@g****m 4
Gabor Csardi c****r@g****m 3
Thierry Onkelinx T****O 3
Christophe Dervieux c****x@g****m 2
Peter Meissner r****r@g****m 2
Thomas Rosendal t****l@s****e 2
Bernie Gray b****3@g****m 1
Arni Magnusson a****a@h****s 1
Stefan Widgren s****n@s****) 1
Sander Maijers S****s@g****m 1
Kirill Müller k****r@i****h 1
Felipe Balbi b****i@t****m 1
Dean Attali d****n@a****m 1
Elias Pipping e****g@f****e 1
Gregor Lichtner 3****r 1
Ian Lyttle i****e@s****m 1
Kirill Müller k****r@m****g 1
Peter Carbonetto p****o@g****m 1
Pierrick Roger p****r@i****m 1
Tim D. Smith g****t@t****s 1
Tomas Kalibera k****a 1
aoles a****s@g****m 1
and 2 more...

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 107
  • Total pull requests: 26
  • Average time to close issues: 5 months
  • Average time to close pull requests: 9 days
  • Total issue authors: 84
  • Total pull request authors: 13
  • Average comments per issue: 3.13
  • Average comments per pull request: 2.54
  • Merged pull requests: 19
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 5
  • Pull requests: 7
  • Average time to close issues: 7 days
  • Average time to close pull requests: 3 days
  • Issue authors: 5
  • Pull request authors: 3
  • Average comments per issue: 2.2
  • Average comments per pull request: 0.71
  • Merged pull requests: 5
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • jdblischak (12)
  • ThierryO (5)
  • jennybc (3)
  • JiaxiangBU (2)
  • tdhock (2)
  • pat-s (2)
  • yli110-stat697 (2)
  • rtaph (2)
  • ignatenkobrain (1)
  • p-phillips (1)
  • Miachol (1)
  • salim-b (1)
  • dave-lovell (1)
  • yjqiu (1)
  • fenguoerbian (1)
Pull Request Authors
  • jdblischak (6)
  • glichtner (4)
  • stewid (3)
  • AleKoure (2)
  • cderv (2)
  • pkrog (2)
  • kalibera (2)
  • ThierryO (2)
  • benmarwick (1)
  • anniew (1)
  • daattali (1)
  • pcarbo (1)
  • jeroen (1)
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 3
  • Total downloads:
    • cran 38,833 last-month
  • Total docker downloads: 557,412
  • Total dependent packages: 55
    (may contain duplicates)
  • Total dependent repositories: 465
    (may contain duplicates)
  • Total versions: 73
  • Total maintainers: 1
cran.r-project.org: git2r

Provides Access to Git Repositories

  • Versions: 30
  • Dependent Packages: 50
  • Dependent Repositories: 450
  • Downloads: 38,833 Last month
  • Docker Downloads: 557,412
Rankings
Docker downloads count: 0.0%
Dependent repos count: 0.7%
Forks count: 1.2%
Average: 1.3%
Dependent packages count: 1.6%
Stargazers count: 2.1%
Downloads: 2.2%
Maintainers (1)
Last synced: 6 months ago
proxy.golang.org: github.com/ropensci/git2r
  • Versions: 30
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 9.0%
Average: 9.6%
Dependent repos count: 10.2%
Last synced: 6 months ago
conda-forge.org: r-git2r
  • Versions: 13
  • Dependent Packages: 5
  • Dependent Repositories: 15
Rankings
Dependent repos count: 9.2%
Dependent packages count: 10.4%
Average: 17.3%
Forks count: 23.6%
Stargazers count: 26.0%
Last synced: 6 months ago

Dependencies

DESCRIPTION cran
  • R >= 3.4 depends
  • graphics * imports
  • utils * imports
  • getPass * suggests
.github/workflows/R-CMD-check.yaml actions
  • actions/checkout v2 composite
  • actions/upload-artifact main composite
  • r-lib/actions/check-r-package v1 composite
  • r-lib/actions/setup-pandoc v1 composite
  • r-lib/actions/setup-r v1 composite
  • r-lib/actions/setup-r-dependencies v1 composite