| 1 | package Git::Raw::Patch; | ||
| 2 | 1 | $Git::Raw::Patch::VERSION = '0.90'; | |
| 3 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | 1 | ▶ | use Git::Raw; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | |||
| 8 | =head1 NAME | ||
| 9 | |||
| 10 | Git::Raw::Patch - Git patch class | ||
| 11 | |||
| 12 | =head1 VERSION | ||
| 13 | |||
| 14 | version 0.90 | ||
| 15 | |||
| 16 | =head1 DESCRIPTION | ||
| 17 | |||
| 18 | A L<Git::Raw::Patch> represents all the text diffs for a delta. | ||
| 19 | |||
| 20 | B<WARNING>: The API of this module is unstable and may change without warning | ||
| 21 | (any change will be appropriately documented in the changelog). | ||
| 22 | |||
| 23 | =head1 METHODS | ||
| 24 | |||
| 25 | =head2 buffer( ) | ||
| 26 | |||
| 27 | Get the content of a patch as a single diff text. | ||
| 28 | |||
| 29 | =head2 hunk_count( ) | ||
| 30 | |||
| 31 | Get the number of hunks in the patch. | ||
| 32 | |||
| 33 | =head2 hunks( [$index] ) | ||
| 34 | |||
| 35 | Returns a list of L<Git::Raw::Diff::Hunk> objects. If C<$index> is specified | ||
| 36 | only the hunk at the specified index will be returned. | ||
| 37 | |||
| 38 | =head2 line_stats( ) | ||
| 39 | |||
| 40 | Get line counts of each type in the patch. Returns a hash with entries | ||
| 41 | C<"context">, C<"additions"> and C<"deletions">. | ||
| 42 | |||
| 43 | =head2 delta( ) | ||
| 44 | |||
| 45 | Get the delta associated with the patch. Returns a L<Git::Raw::Diff::Delta> | ||
| 46 | object. | ||
| 47 | |||
| 48 | =head1 AUTHOR | ||
| 49 | |||
| 50 | Alessandro Ghedini <alexbio@cpan.org> | ||
| 51 | |||
| 52 | Jacques Germishuys <jacquesg@cpan.org> | ||
| 53 | |||
| 54 | =head1 LICENSE AND COPYRIGHT | ||
| 55 | |||
| 56 | Copyright 2014 Alessandro Ghedini. | ||
| 57 | |||
| 58 | This program is free software; you can redistribute it and/or modify it | ||
| 59 | under the terms of either: the GNU General Public License as published | ||
| 60 | by the Free Software Foundation; or the Artistic License. | ||
| 61 | |||
| 62 | See http://dev.perl.org/licenses/ for more information. | ||
| 63 | |||
| 64 | =cut | ||
| 65 | |||
| 66 | 1 | 1; # End of Git::Raw::Patch | |