NAME
Review::Helper::VCS::Git - Git as the version control system of a review.
DESCRIPTION
The git implementation of Review::Helper::VCS, holding everything about git the rest of Review::Helper does not know: commands, options, ref names, the git directory and pathspec magic.
Git always runs as a list-form process, never through a shell, with GIT_CONFIG_NOSYSTEM=1 and GIT_CONFIG_GLOBAL=/dev/null, and with the GIT_*_PATHSPECS variables unset, so user configuration cannot change its output. A single file is named as :(literal)<path>. Diffs use one fixed set of options so line anchors stay stable.
Arguments are character strings and are passed to git as UTF-8. Paths and commit text coming back from the higher-level methods are decoded from UTF-8; the diffs and file return raw bytes.
The format specification gives the git meaning of each of the role's terms. user (user.name and user.email) is the one git run that reads the user's own configuration; a git older than 2.36 shows no merge resolutions.
SYNOPSIS
use Review::Helper::VCS::Git;
my $git = Review::Helper::VCS::Git->find($path);
my $head = $git->resolve('HEAD');
my $revs = $git->revisions($base, $head);
my $changes = $git->range_changes($base, $head);
ATTRIBUTES
- $dir = $git->root()
-
Absolute path of the worktree's top directory.
- $dir = $git->git_dir()
-
Absolute path of the worktree's git directory.
- $dir = $git->common_dir()
-
Absolute path of the git directory shared by all worktrees.
PUBLIC METHODS
Every method the role requires, as Review::Helper::VCS describes them. find here:
- $git = Review::Helper::VCS::Git->find($path)
-
Find the worktree holding
$path, a file or directory. A file need not exist, but its directory must. Paths inside a git directory (where review files live by default) resolve to that git directory's worktree. Croaks when there is no worktree, including for bare repositories.
SOURCE
The source code repository for Review-Helper can be found at https://github.com/exodist/Review-Helper.
MAINTAINERS
AUTHORS
COPYRIGHT
Copyright Chad Granum <exodist7@gmail.com>.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.