From ff1e8ce576bb4e9833f3ca929f7bf621f00ce9c8 Mon Sep 17 00:00:00 2001 From: florisvdh Date: Wed, 18 Feb 2026 18:17:21 +0100 Subject: [PATCH 1/5] rename_variable(): fix documentation of return value --- R/rename_variable.R | 3 ++- man/rename_variable.Rd | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/R/rename_variable.R b/R/rename_variable.R index 6466fab..2268c1c 100644 --- a/R/rename_variable.R +++ b/R/rename_variable.R @@ -13,7 +13,8 @@ #' @inheritParams write_vc #' @param change A named vector with the old names as values and the new names #' as names. -#' @return invisible `NULL`. +#' @return a named vector with the file paths relative to `root`. The names +#' contain the hashes of the files. #' @export #' @examples #' diff --git a/man/rename_variable.Rd b/man/rename_variable.Rd index 5876df0..6b62be1 100644 --- a/man/rename_variable.Rd +++ b/man/rename_variable.Rd @@ -35,7 +35,8 @@ writing the data. Defaults to \code{FALSE}.} \item{force}{Add ignored files. Default is FALSE.} } \value{ -invisible \code{NULL}. +a named vector with the file paths relative to \code{root}. The names +contain the hashes of the files. } \description{ The raw data file contains a header with the variable names. From d6ab4ad9da560c90e6ab40425ab97f60e4a02a50 Mon Sep 17 00:00:00 2001 From: florisvdh Date: Wed, 18 Feb 2026 18:18:39 +0100 Subject: [PATCH 2/5] rename_variable(): test that return value contains no root path --- tests/testthat/test_g_rename_variable.R | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tests/testthat/test_g_rename_variable.R b/tests/testthat/test_g_rename_variable.R index 5872dd5..59fb445 100644 --- a/tests/testthat/test_g_rename_variable.R +++ b/tests/testthat/test_g_rename_variable.R @@ -227,3 +227,24 @@ test_that("rename_variable() handles wrong type of root", { "a 'root' of class numeric is not supported" ) }) + +test_that("rename_variable() shows no root in returned file names", { + root <- tempfile(pattern = "git2rdata-rename-") + dir.create(root) + filename <- "unsorted" + files <- suppressWarnings( + write_vc( + test_data, + file = filename, + split_by = "test_factor", + root = root, + strict = FALSE + ) + ) + result <- rename_variable( + file = filename, + root = root, + change = c("new_var" = "test_Date") + ) + expect_no_match(result, "git2rdata-rename-") +}) From f486662d0f4f72fef8fcea9cf1c4f86abfa127b2 Mon Sep 17 00:00:00 2001 From: florisvdh Date: Wed, 18 Feb 2026 18:43:56 +0100 Subject: [PATCH 3/5] rename_variable(): normalize root and file paths * In Windows, this avoids that pattern mismatches occur between root and file. Before, this could lead to not removing the root part from the returned vector. --- R/rename_variable.R | 2 ++ 1 file changed, 2 insertions(+) diff --git a/R/rename_variable.R b/R/rename_variable.R index 2268c1c..acda87c 100644 --- a/R/rename_variable.R +++ b/R/rename_variable.R @@ -107,6 +107,8 @@ rename_variable.character <- function(file, change, root = ".", ...) { yaml[["..generic"]][["data_hash"]] <- datahash(file["raw_file"]) write_yaml(yaml, file["meta_file"], fileEncoding = "UTF-8") + root <- normalizePath(root, winslash = "/", mustWork = TRUE) + file <- normalizePath(file, winslash = "/", mustWork = TRUE) hashes <- remove_root(file = file, root = root) names(hashes) <- c( From 2bbd7d8ab1087e42fdc10d7daa495687ae62f992 Mon Sep 17 00:00:00 2001 From: Thierry Onkelinx Date: Thu, 19 Feb 2026 11:56:47 +0100 Subject: [PATCH 4/5] =?UTF-8?q?=F0=9F=94=96=20Bump=20package=20version?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .zenodo.json | 2 +- CITATION.cff | 2 +- DESCRIPTION | 4 ++-- NEWS.md | 5 +++++ inst/CITATION | 6 +++--- organisation.yml | 4 ++-- 6 files changed, 14 insertions(+), 9 deletions(-) diff --git a/.zenodo.json b/.zenodo.json index 2ef5af3..7a352bb 100644 --- a/.zenodo.json +++ b/.zenodo.json @@ -1,6 +1,6 @@ { "title": "git2rdata: Store and Retrieve Data.frames in a Git Repository", - "version": "0.5.1", + "version": "0.5.2", "license": "GPL-3.0", "upload_type": "software", "description": "

The git2rdata package is an R package for writing and reading dataframes as plain text files. A metadata file stores important information. 1) Storing metadata allows to maintain the classes of variables. By default, git2rdata optimizes the data for file storage. The optimization is most effective on data containing factors. The optimization makes the data less human readable. The user can turn this off when they prefer a human readable format over smaller files. Details on the implementation are available in vignette(“plain_text”, package = “git2rdata”). 2) Storing metadata also allows smaller row based diffs between two consecutive commits. This is a useful feature when storing data as plain text files under version control. Details on this part of the implementation are available in vignette(“version_control”, package = “git2rdata”). Although we envisioned git2rdata with a git workflow in mind, you can use it in combination with other version control systems like subversion or mercurial. 3) git2rdata is a useful tool in a reproducible and traceable workflow. vignette(“workflow”, package = “git2rdata”) gives a toy example. 4) vignette(“efficiency”, package = “git2rdata”) provides some insight into the efficiency of file storage, git repository size and speed for writing and reading.<\/p>", diff --git a/CITATION.cff b/CITATION.cff index 2ac49fa..e677933 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -40,4 +40,4 @@ identifiers: value: 10.5281/zenodo.1485309 - type: url value: https://ropensci.github.io/git2rdata/ -version: 0.5.1 +version: 0.5.2 diff --git a/DESCRIPTION b/DESCRIPTION index 60e5a5a..11b2fc3 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: git2rdata Title: Store and Retrieve Data.frames in a Git Repository -Version: 0.5.1 +Version: 0.5.2 Authors@R: c( person("Thierry", "Onkelinx", , "thierry.onkelinx@inbo.be", role = c("aut", "cre"), comment = c(ORCID = "0000-0001-8804-4216", affiliation = "Research Institute for Nature and Forest (INBO)")), @@ -11,7 +11,7 @@ Authors@R: c( person("Els", "Lommelen", , "els.lommelen@inbo.be", role = "ctb", comment = c(ORCID = "0000-0002-3481-5684", affiliation = "Research Institute for Nature and Forest (INBO)")), person("Research Institute for Nature and Forest (INBO)", , , "info@inbo.be", role = c("cph", "fnd"), - comment = c(ROR = "https://ror.org/00j54wy13")) + comment = c(ROR = "00j54wy13")) ) Description: The git2rdata package is an R package for writing and reading dataframes as plain text files. A metadata file stores important diff --git a/NEWS.md b/NEWS.md index e9d834b..fd69dec 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,8 @@ +# git2rdata 0.5.2 + +* Bugfix in `rename_variable()` thanks to @florisvdh for finding and fixing the + bug. + # git2rdata 0.5.1 * `write_vc()` stores metadata stored in the data frame. diff --git a/inst/CITATION b/inst/CITATION index 2441f94..2269147 100644 --- a/inst/CITATION +++ b/inst/CITATION @@ -2,12 +2,12 @@ citHeader("To cite `git2rdata` in publications please use:") # begin checklist entry bibentry( bibtype = "Manual", - title = "git2rdata: Store and Retrieve Data.frames in a Git Repository. Version 0.5.1", + title = "git2rdata: Store and Retrieve Data.frames in a Git Repository. Version 0.5.2", author = c(person(given = "Thierry", family = "Onkelinx")), - year = 2025, + year = 2026, url = "https://ropensci.github.io/git2rdata/", abstract = "The git2rdata package is an R package for writing and reading dataframes as plain text files. A metadata file stores important information. 1) Storing metadata allows to maintain the classes of variables. By default, git2rdata optimizes the data for file storage. The optimization is most effective on data containing factors. The optimization makes the data less human readable. The user can turn this off when they prefer a human readable format over smaller files. Details on the implementation are available in vignette(\"plain_text\", package = \"git2rdata\"). 2) Storing metadata also allows smaller row based diffs between two consecutive commits. This is a useful feature when storing data as plain text files under version control. Details on this part of the implementation are available in vignette(\"version_control\", package = \"git2rdata\"). Although we envisioned git2rdata with a git workflow in mind, you can use it in combination with other version control systems like subversion or mercurial. 3) git2rdata is a useful tool in a reproducible and traceable workflow. vignette(\"workflow\", package = \"git2rdata\") gives a toy example. 4) vignette(\"efficiency\", package = \"git2rdata\") provides some insight into the efficiency of file storage, git repository size and speed for writing and reading.", - textVersion = "Onkelinx, Thierry (2025) git2rdata: Store and Retrieve Data.frames in a Git Repository. Version 0.5.1. https://ropensci.github.io/git2rdata/", + textVersion = "Onkelinx, Thierry (2026) git2rdata: Store and Retrieve Data.frames in a Git Repository. Version 0.5.2. https://ropensci.github.io/git2rdata/", keywords = "git; version control; plain text data", doi = "10.5281/zenodo.1485309", ) diff --git a/organisation.yml b/organisation.yml index 85f7264..332c08e 100644 --- a/organisation.yml +++ b/organisation.yml @@ -1,4 +1,4 @@ -checklist version: 0.5.1 +checklist version: 0.5.3 git: https://github.com/ropensci info@inbo.be: name: @@ -9,7 +9,7 @@ info@inbo.be: email: info@inbo.be website: https://www.vlaanderen.be/inbo/en-gb logo: https://inbo.github.io/checklist/reference/figures/logo-en.png - ror: https://ror.org/00j54wy13 + ror: 00j54wy13 orcid: yes zenodo: inbo rightsholder: single From d1daf37ee16ac971696bab528a4b609d08aefbb8 Mon Sep 17 00:00:00 2001 From: Thierry Onkelinx Date: Thu, 19 Feb 2026 12:20:50 +0100 Subject: [PATCH 5/5] =?UTF-8?q?=F0=9F=91=B7=20Remove=20pr=5Ftitle=20GHA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/pr_title.yml | 20 -------------------- 1 file changed, 20 deletions(-) delete mode 100644 .github/workflows/pr_title.yml diff --git a/.github/workflows/pr_title.yml b/.github/workflows/pr_title.yml deleted file mode 100644 index 553db64..0000000 --- a/.github/workflows/pr_title.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: 'PR Title Checker' -on: - pull_request: - types: [edited, opened, synchronize, reopened] - branches: - - main - - master - -jobs: - title-check: - runs-on: ubuntu-latest - steps: - - uses: naveenk1223/action-pr-title@master - with: - regex: 'Version [0-9]+\.[0-9]+(\.[0-9]+)?$' # Regex the title should match. - allowed_prefixes: ':bookmark:' # title should start with the given prefix - prefix_case_sensitive: true # title prefix are case insensitive - min_length: 11 # Min length of the title - max_length: -1 # Max length of the title - name: Check PR title