Return all top-level commits since a particular version as commit objects.
Arguments
- since
A commit SHA, e.g. as returned in the
commitcomponent ofget_last_version_tag(). IfNULL, the entire log is retrieved.
Examples
# Create mock package in a temporary directory.
# Set open to TRUE if you want to play in the mock package.
with_demo_project({
# Use functions as if inside the newly created package project.
# (Or go and actually run code inside the newly created package project!)
# Add a new R file.
usethis::use_r("cool-function", open = FALSE)
# Pretend we added useful code inside it.
# Track the new R file with Git.
gert::git_add("R/cool-function.R")
gert::git_commit("- Add cool function.")
# Bump version with fledge.
fledge::bump_version()
fledge::finalize_version()
print(get_top_level_commits(since = NULL))
print(fledge::get_last_tag())
})
#> ✔ Setting active project to "/tmp/Rtmp4PDYWz/fledge3fb64193e548/tea".
#> ☐ Edit R/cool-function.R.
#> → Digesting messages from 3 commits.
#> ✔ Found 1 NEWS-worthy entry.
#>
#> ── Updating NEWS ──
#>
#> → Adding new entries to NEWS.md.
#>
#> ── Updating Version ──
#>
#> ✔ Package version bumped to 0.0.0.9001.
#> → Added header to NEWS.md.
#> → Committing changes.
#>
#> ── Tagging Version ──
#>
#> → Creating tag v0.0.0.9001 with tag message derived from NEWS.md.
#> ! Run `fledge::finalize_version()`.
#> → Resetting to previous commit.
#> → Committing changes.
#>
#> ── Tagging Version ──
#>
#> ℹ Tag v0.0.0.9001 exists and points to the current commit.
#> # A tibble: 4 × 3
#> commit message merge
#> <chr> <chr> <lgl>
#> 1 6a3526346b18e6bffd4d44b11ddcc61e31408565 "fledge: Bump version to 0.0.0… FALSE
#> 2 08653f46467f079e4a780bc5add1d6db6b5c59cb "- Add cool function.\n" FALSE
#> 3 a995706b4a98c6ddb02c74c568e662c24375cefa "Add NEWS.md to track changes.… FALSE
#> 4 20568efe77a57d36c862978f64ab1f403298b9a7 "First commit\n" FALSE
#> # A tibble: 1 × 3
#> name ref commit
#> * <chr> <chr> <chr>
#> 1 v0.0.0.9001 refs/tags/v0.0.0.9001 83bed94e60da1a9d66b67880c49e1e4e51d04bb7
#> ✔ Setting active project to "<no active project>".