.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Git::Raw::Diff 3pm" .TH Git::Raw::Diff 3pm "2019-01-12" "perl v5.28.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Git::Raw::Diff \- Git diff class .SH "VERSION" .IX Header "VERSION" version 0.79 .SH "DESCRIPTION" .IX Header "DESCRIPTION" A Git::Raw::Diff represents the diff between two entities. .PP \&\fB\s-1WARNING\s0\fR: The \s-1API\s0 of this module is unstable and may change without warning (any change will be appropriately documented in the changelog). .SH "METHODS" .IX Header "METHODS" .ie n .SS "new( $buffer )" .el .SS "new( \f(CW$buffer\fP )" .IX Subsection "new( $buffer )" Create a diff from the content of a git patch. .SS "patchid( )" .IX Subsection "patchid( )" Calculate the patch id. .ie n .SS "merge( $from )" .el .SS "merge( \f(CW$from\fP )" .IX Subsection "merge( $from )" Merge the given diff with the Git::Raw::Diff \f(CW$from\fR. .ie n .SS "buffer( $format )" .el .SS "buffer( \f(CW$format\fP )" .IX Subsection "buffer( $format )" Get the content of a diff as text. See \f(CW\*(C`Git::Raw::Diff\->print()\*(C'\fR for valid \&\f(CW$format\fR values. .SS "delta_count( )" .IX Subsection "delta_count( )" Query how many diff records there are in the diff. .SS "deltas( [$index] )" .IX Subsection "deltas( [$index] )" Returns a list of Git::Raw::Diff::Delta objects. If \f(CW$index\fR is specified only the delta at the specified index will be returned. .SS "find_similar( [\e%options] )" .IX Subsection "find_similar( [%options] )" Transform the diff marking file renames, copies, etc. Valid fields for the \&\f(CW%options\fR hash include: .IP "\(bu" 4 \&\*(L"flags\*(R" .Sp Flags for finding similar files. Valid values include: .RS 4 .IP "\(bu" 8 \&\*(L"renames\*(R" .Sp Look for renames. .IP "\(bu" 8 \&\*(L"renames_from_rewrites\*(R" .Sp Consider old side of modifies files for renames. .IP "\(bu" 8 \&\*(L"copies\*(R" .Sp Look for copies. .IP "\(bu" 8 \&\*(L"copies_from_unmodified\*(R" .Sp Consider unmodified files as copy sources. .IP "\(bu" 8 \&\*(L"rewrites\*(R" .Sp Mark significant rewrites for split. .IP "\(bu" 8 \&\*(L"break_rewrites\*(R" .Sp Actually split large rewrites into delete/add pairs. .IP "\(bu" 8 \&\*(L"untracked\*(R" .Sp Find renames/copies for untracked items in the working directory. .IP "\(bu" 8 \&\*(L"all\*(R" .Sp Turn on all finding features. .IP "\(bu" 8 \&\*(L"ignore_leading_whitespace\*(R" .Sp Measure similarity ignoring leading whitespace (default). .IP "\(bu" 8 \&\*(L"ignore_whitespace\*(R" .Sp Measure similarity ignoring all whitespace. .IP "\(bu" 8 \&\*(L"dont_ignore_whitespace\*(R" .Sp Measure similarity including all data. .IP "\(bu" 8 \&\*(L"exact_match_only\*(R" .Sp Measure similarity only by comparing SHAs (fast and cheap). .IP "\(bu" 8 \&\*(L"break_rewrites_for_renames_only\*(R" .Sp Do not break rewrites unless they contribute to a rename. .IP "\(bu" 8 \&\*(L"remove_unmodified\*(R" .Sp Remove any unmodified deltas after \f(CW\*(C`find_similar\*(C'\fR is done. .RE .RS 4 .RE .IP "\(bu" 4 \&\*(L"rename_threshold\*(R" .Sp Similarity to consider a file renamed (default 50). .IP "\(bu" 4 \&\*(L"rename_from_rewrite_threshold\*(R" .Sp Similarity of modified to be eligible rename source (default 50). .IP "\(bu" 4 \&\*(L"copy_threshold\*(R" .Sp Similarity to consider a file a copy (default 50). .IP "\(bu" 4 \&\*(L"break_rewrite_threshold\*(R" .Sp Similarity to split modify into delete/add pair (default 60). .IP "\(bu" 4 \&\*(L"rename_limit\*(R" .Sp Maximum similarity sources to examine for a file (default 200). .SS "patches( )" .IX Subsection "patches( )" Return a list of Git::Raw::Patch objects for the diff. .ie n .SS "print( $format, $callback )" .el .SS "print( \f(CW$format\fP, \f(CW$callback\fP )" .IX Subsection "print( $format, $callback )" Generate text output from the diff object. The \f(CW$callback\fR will be called for each line of the diff with two arguments: the first one represents the type of the patch line (\f(CW"ctx"\fR for context lines, \f(CW"add"\fR for additions, \f(CW"del"\fR for deletions, \f(CW"file"\fR for file headers, \f(CW"hunk"\fR for hunk headers, \f(CW"bin"\fR for binary data or \f(CW"noeol"\fR if both files have no \s-1LF\s0 at end) and the second argument contains the content of the patch line. .PP The \f(CW$format\fR can be one of the following: .IP "\(bu" 4 \&\*(L"patch\*(R" .Sp Full git diff. .IP "\(bu" 4 \&\*(L"patch_header\*(R" .Sp Only the file headers of the diff. .IP "\(bu" 4 \&\*(L"raw\*(R" .Sp Like \f(CW\*(C`git diff \-\-raw\*(C'\fR. .IP "\(bu" 4 \&\*(L"name_only\*(R" .Sp Like \f(CW\*(C`git diff \-\-name\-only\*(C'\fR. .IP "\(bu" 4 \&\*(L"name_status\*(R" .Sp Like \f(CW\*(C`git diff \-\-name\-status\*(C'\fR. .SS "stats( )" .IX Subsection "stats( )" Accumlated diff statistics for all patches in the diff. Returns a Git::Raw::Diff::Stats object. .SH "AUTHOR" .IX Header "AUTHOR" Alessandro Ghedini .PP Jacques Germishuys .SH "LICENSE AND COPYRIGHT" .IX Header "LICENSE AND COPYRIGHT" Copyright 2012 Alessandro Ghedini. .PP This program is free software; you can redistribute it and/or modify it under the terms of either: the \s-1GNU\s0 General Public License as published by the Free Software Foundation; or the Artistic License. .PP See http://dev.perl.org/licenses/ for more information.