Git::Raw::Diff - Git diff class
A Git::Raw::Diff represents the diff between two entities.
WARNING: The API of this module is unstable and may change without warning (any change will be appropriately documented in the changelog).
Create a diff from the content of a git patch.
Merge the given diff with the Git::Raw::Diff
Get the content of a diff as text.
Git::Raw::Diff->print() for valid
Query how many diff records there are in the diff.
Returns a list of Git::Raw::Diff::Delta objects.
$index is specified only the delta at the specified index will be returned.
Transform the diff marking file renames,
Valid fields for the
%options hash include:
Flags for finding similar files. Valid values include:
Look for renames.
Consider old side of modifies files for renames.
Look for copies.
Consider unmodified files as copy sources.
Mark significant rewrites for split.
Actually split large rewrites into delete/add pairs.
Find renames/copies for untracked items in the working directory.
Turn on all finding features.
Measure similarity ignoring leading whitespace (default).
Measure similarity ignoring all whitespace.
Measure similarity including all data.
Measure similarity only by comparing SHAs (fast and cheap).
Do not break rewrites unless they contribute to a rename.
Remove any unmodified deltas after
find_similar is done.
Similarity to consider a file renamed (default 50).
Similarity of modified to be eligible rename source (default 50).
Similarity to consider a file a copy (default 50).
Similarity to split modify into delete/add pair (default 60).
Maximum similarity sources to examine for a file (default 200).
Return a list of Git::Raw::Patch objects for the diff.
Generate text output from the diff object.
$callback will be called for each line of the diff with two arguments: the first one represents the type of the patch line (
"ctx" for context lines,
"add" for additions,
"del" for deletions,
"file" for file headers,
"hunk" for hunk headers,
"bin" for binary data or
"noeol" if both files have no LF at end) and the second argument contains the content of the patch line.
$format can be one of the following:
Full git diff.
Only the file headers of the diff.
git diff --raw.
git diff --name-only.
git diff --name-status.
Accumlated diff statistics for all patches in the diff. Returns a Git::Raw::Diff::Stats object.
Alessandro Ghedini <email@example.com>
Jacques Germishuys <firstname.lastname@example.org>
Copyright 2012 Alessandro Ghedini.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.