This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
make test # Run integration tests (via tools/test.sh)
make install # Install to /usr/local (customize with PREFIX=/path)
make uninstall # Remove installed filesTo run tests with a custom prefix:
make install PREFIX=/custom/pathgit-follow is a Perl 5 Git subcommand that wraps git log to track the full lifetime history of a file across renames.
git-follow (root-level executable) — parses CLI options via Getopt::Long, validates the repository and pathspec, then delegates to GitFollow::Log to build and execute the git log command.
| Module | Role |
|---|---|
Log.pm |
Core logic — assembles git log arguments from normalized options and executes the command |
Cli/OptionsNormalizer.pm |
Maps git-follow flags to their git log equivalents; resolves conflicts (e.g. --no-renames suppresses --follow) |
Config.pm |
Reads follow.* keys from git config (follow.diff.mode, follow.log.format, follow.pager.disable) |
Repository/ObjectUtils.pm |
Validates that the working directory is a git repo and that the pathspec exists in the given ref |
Environment.pm |
Resolves the git binary path (defaults to /usr/bin/git, overridable via $GIT_PATH) |
Metadata.pm |
Version string and usage text |
Stdlib/NumberUtils.pm |
is_numeric helper |
Blame.pm |
Stub/partial blame utilities (not yet wired into main flow) |
git-followvalidates repo + pathspec viaObjectUtils- Raw CLI options are normalized by
OptionsNormalizerintogit logflags Log.pmappends--follow(unless--no-renames), injects diff/format config fromConfig.pm, and execsgit log
tools/test.sh is a shell-based integration test runner. It temporarily patches the use lib path in the main script to point at the local src/ directory, runs ~16 test cases covering option combinations, then restores the original path. Tests invoke the git-follow script directly and check exit codes / output.