is_name_change: Detect whether a 'changed_file'-entry is a renaming

Description Usage Arguments Examples

View source: R/renamed-files.R

Description

Filenames in $ git log containing the sequence => are viewed as renamed files. There seems no other way around that, so this function will indicate a file is a name change even if it may not be the case.

Usage

1
2
is_name_change(changed_file,
  reassignment_pattern = ".+\\s\\=\\>.+$")

Arguments

changed_file

The column changed_file from a parsed unnested detailed log as a vector.

reassignment_pattern

The regular expression pattern that corresponds to renaming.

Examples

1
2
3
4
gitsum:::is_name_change(c(
  "R/{gitsum.R => gitsum-package.R}", "API => API2",
  "this is jus a file with => in it, it's not a name change"
))

lorenzwalthert/gitsum documentation built on Jan. 17, 2021, 9:34 p.m.