view_commits: View commits within a repository

Description Usage Arguments Details Value Examples

View source: R/commits.R

Description

view_commits() summarises commits in a table with the properties as columns and a row for each commit in the history of the given reference. view_commit() returns a list of all properties for a single commit. browse_commits() and browse_commit() opens the web page for the commit history and commit details respectively in the default browser.

Usage

1
2
3
4
5
6
7
view_commits(ref, repo, path, author, since, until, n_max = 1000, ...)

view_commit(ref, repo, ...)

browse_commits(ref, repo, ...)

browse_commit(ref, repo, ...)

Arguments

ref

(string) Either a SHA, branch or tag used to identify the commit.

repo

(string) The repository specified in the format: owner/repo.

path

(string, optional) Only commits containing this file path will be returned.

author

(string, optional) Author login to filter commits by.

since

(string, optional) A date & time to filter by. Must be in the format: YYYY-MM-DD HH:MM:SS.

until

(string, optional) A date & time to filter by. Must be in the format: YYYY-MM-DD HH:MM:SS.

n_max

(integer, optional) Maximum number to return. Default: 1000.

...

Parameters passed to gh_page() or gh_request().

Details

For more details see the GitHub API documentation:

Value

view_commits() returns a tibble of commit properties. view_commit() returns a list of properties for a single commit. browse_commits() and browse_commit opens the default browser on the commit's history or details page and returns the URL.

Commit Properties:

Examples

 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
## Not run: 

  # View the history of commits for the main branch
  view_commits("main", "ChadGoymer/githapi")

  # View commits where the README.md file has been changed
  view_commits(
    ref  = "main",
    repo = "ChadGoymer/githapi",
    path = "README.md"
  )

  # View commits created by an author
  view_commits(
    ref    = "main",
    repo   = "ChadGoymer/githapi",
    author = "ChadGoymer"
  )

  # View commits within a time window
  view_commits(
    ref   = "main",
    repo  = "ChadGoymer/githapi",
    since = "2020-01-01 00:00:00",
    until = "2020-04-01 00:00:00"
  )

  # View the properties of the last commit on the main branch
  view_commit("main", "ChadGoymer/githapi")

  # View the properties of the commit with tag "0.8.7"
  view_commit("0.8.7", "ChadGoymer/githapi")


## End(Not run)

ChadGoymer/githapi documentation built on Oct. 22, 2021, 10:56 a.m.