| 1 | package Git::Raw::Graph; | ||
| 2 | 1 | $Git::Raw::Graph::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::Graph - Git graph class | ||
| 11 | |||
| 12 | =head1 VERSION | ||
| 13 | |||
| 14 | version 0.90 | ||
| 15 | |||
| 16 | =head1 SYNOPSIS | ||
| 17 | |||
| 18 | use Git::Raw; | ||
| 19 | |||
| 20 | # open the Git repository at $path | ||
| 21 | my $repo = Git::Raw::Repository -> open($path); | ||
| 22 | |||
| 23 | my $commit1 = Git::Raw::Commit -> lookup($repo, | ||
| 24 | '4a202b346bb0fb0db7eff3cffeb3c70babbd2045'); | ||
| 25 | |||
| 26 | my $commit2 = Git::Raw::Commit -> lookup($repo, | ||
| 27 | '5b5b025afb0b4c913b4c338a42934a3863bf3644'); | ||
| 28 | |||
| 29 | if (Git::Raw::Graph -> is_descendant_of($repo, $commit1, $commit2)) { | ||
| 30 | print $commit1 -> id, ' is a descendant of ', $commit2 -> id, "\n"; | ||
| 31 | } else { | ||
| 32 | print $commit1 -> id, ' is a not descendant of ', $commit2 -> id, "\n"; | ||
| 33 | } | ||
| 34 | |||
| 35 | =head1 DESCRIPTION | ||
| 36 | |||
| 37 | B<WARNING>: The API of this module is unstable and may change without warning | ||
| 38 | (any change will be appropriately documented in the changelog). | ||
| 39 | |||
| 40 | =head2 ahead( $repo, $local, $upstream ) | ||
| 41 | |||
| 42 | Get the commits C<$local> is ahead of C<$upstream>. C<$local> and C<$upstream> | ||
| 43 | should be peelable to a L<Git::Raw::Commit> object, that is, it should be a | ||
| 44 | L<Git::Raw::Commit> or L<Git::Raw::Reference> object, or alternatively a commit | ||
| 45 | id or commit id prefix. This method returns a list of L<Git::Raw::Commit> | ||
| 46 | objects, sorted in topological order. | ||
| 47 | |||
| 48 | =head2 behind( $repo, $local, $upstream ) | ||
| 49 | |||
| 50 | Get the commits C<$local> is behind C<$upstream>. C<$local> and C<$upstream> | ||
| 51 | should be peelable to a L<Git::Raw::Commit> object, that is, it should be a | ||
| 52 | L<Git::Raw::Commit> or L<Git::Raw::Reference> object, or alternatively a commit | ||
| 53 | id or commit id prefix. This method returns a list of L<Git::Raw::Commit> | ||
| 54 | objects, sorted in topological order. | ||
| 55 | |||
| 56 | =head2 ahead_behind( $repo, $local, $upstream ) | ||
| 57 | |||
| 58 | Get the unique commits between C<$local> and C<$upstream>. C<$local> | ||
| 59 | and C<$upstream> should be peelable to a L<Git::Raw::Commit> object, that is, | ||
| 60 | it should be a L<Git::Raw::Commit> or L<Git::Raw::Reference> object, or | ||
| 61 | alternatively a commit id or commit id prefix. This method returns a hash | ||
| 62 | reference with optional members C<"ahead"> and C<"behind">, each an array | ||
| 63 | of L<Git::Raw::Commit> objects, sorted in topological order. | ||
| 64 | |||
| 65 | =head2 is_descendant_of( $repo, $commitish, $ancestor ) | ||
| 66 | |||
| 67 | Determine if C<$commitish> is the descendant of C<$ancestor>. C<$commitish> | ||
| 68 | and C<$ancestor> should be peelable to a L<Git::Raw::Commit> object, that is, | ||
| 69 | it should be a L<Git::Raw::Commit> or L<Git::Raw::Reference> object, or | ||
| 70 | alternatively a commit id or commit id prefix. | ||
| 71 | |||
| 72 | =head1 AUTHOR | ||
| 73 | |||
| 74 | Jacques Germishuys <jacquesg@cpan.org> | ||
| 75 | |||
| 76 | =head1 LICENSE AND COPYRIGHT | ||
| 77 | |||
| 78 | Copyright 2014 Jacques Germishuys. | ||
| 79 | |||
| 80 | This program is free software; you can redistribute it and/or modify it | ||
| 81 | under the terms of either: the GNU General Public License as published | ||
| 82 | by the Free Software Foundation; or the Artistic License. | ||
| 83 | |||
| 84 | See http://dev.perl.org/licenses/ for more information. | ||
| 85 | |||
| 86 | =cut | ||
| 87 | |||
| 88 | 1 | 1; # End of Git::Raw::Graph | |