Ragex. Git. Log
(Ragex v0.18.4)
View Source
High-level git log API.
Provides file-level and function-level history. Function evolution
tracking uses git log -L which always goes through the CLI backend
since libgit2 does not support it.
Examples
# File history
{:ok, commits} = Ragex.Git.Log.file_history("/opt/project", "lib/user.ex")
# Function evolution
{:ok, commits} = Ragex.Git.Log.function_history("/opt/project",
"create_user", "lib/user.ex")
# Filtered by author and time
{:ok, commits} = Ragex.Git.Log.file_history("/opt/project", "lib/user.ex",
author: "alice", since: "2025-01-01")
Summary
Functions
Get details for a single commit.
Get commit history for a file.
Track a function's evolution through history using git log -L.
Functions
@spec commit_info(String.t(), String.t()) :: {:ok, Ragex.Git.Commit.t()} | {:error, term()}
Get details for a single commit.
@spec file_history(String.t(), String.t(), keyword()) :: {:ok, [Ragex.Git.Commit.t()]} | {:error, term()}
Get commit history for a file.
Options
:max_count-- maximum commits to return (default 50):since-- ISO-8601 date or~Ddate:author-- author name substring filter
Returns
{:ok, [%Commit{}]}
@spec function_history(String.t(), String.t(), String.t(), keyword()) :: {:ok, [Ragex.Git.Commit.t()]} | {:error, term()}
Track a function's evolution through history using git log -L.
This always uses the CLI backend because libgit2 does not
support the -L flag.
Parameters
path-- any path inside the repositoryfunction_name-- the function name to trackfile_path-- file path relative to the repo rootopts--:max_count(default 20)
Returns
{:ok, [%Commit{}]} -- commits that modified the function, newest first.
Returns {:ok, []} if git can't find the function pattern.