Git::Raw::Graph(3pm)

πŸ’… Git::Raw::Graph β€” the perl manual page, but make it cute ✨

okay bestie so Git::Raw::Graph is the Git graph class from the Git::Raw family β€” it's the part of the manual that lives in the User Contributed Perl Documentation section of the man pages, and it's here to answer the one question your group chat asks every single day: "wait am I ahead or behind" πŸ’€


✨ VERSION ✨

This is version 0.90 πŸŽ€ lowkey iconic, highkey still cooking.


🌈 SYNOPSIS 🌈

okay so picture this β€” you open a repo, you grab two commits, and you check if one is a descendant of the other, no cap:

use Git::Raw;

# open the Git repository at $path
my $repo = Git::Raw::Repository -> open($path);

my $commit1 = Git::Raw::Commit -> lookup($repo,
  '4a202b346bb0fb0db7eff3cffeb3c70babbd2045');

my $commit2 = Git::Raw::Commit -> lookup($repo,
  '5b5b025afb0b4c913b4c338a42934a3863bf3644');

if (Git::Raw::Graph -> is_descendant_of($repo, $commit1, $commit2)) {
  print $commit1 -> id, ' is a descendant of ', $commit2 -> id, "\n";
} else {
  print $commit1 -> id, ' is a not descendant of ', $commit2 -> id, "\n";
}

(yes, the "is a not descendant" is verbatim, it's giving ✨ quirk ✨ and we respect it 🫢)


πŸ¦‹ DESCRIPTION πŸ¦‹

WARNING: bestie listen to me very carefully β€” the API of this module is unstable and may change without warning 😭 any change will be appropriately documented in the changelog, so like… read the changelog, fr fr πŸ’…

πŸ’– ahead( $repo, $local, $upstream ) πŸ’–

Get the commits that $local is ahead of $upstream. queen energy, she's out here front-running.

Both $local and $upstream should be peelable to a Git::Raw::Commit object, i.e. it should be a Git::Raw::Commit or Git::Raw::Reference object, or alternatively a commit id or commit id prefix. (it's giving flexible πŸ’…)

This method returns a list of Git::Raw::Commit objects, sorted in topological order. no notes, periodt.


πŸŽ€ behind( $repo, $local, $upstream ) πŸŽ€

Get the commits that $local is behind $upstream. it's giving FOMO, she's catching up πŸ₯²

Same deal bestie β€” both $local and $upstream should be peelable to a Git::Raw::Commit object, that is, a Git::Raw::Commit or Git::Raw::Reference object, or alternatively a commit id or commit id prefix.

This method returns a list of Git::Raw::Commit objects, sorted in topological order. πŸ’―


🌸 ahead_behind( $repo, $local, $upstream ) 🌸

Get the unique commits between $local and $upstream. both directions, one call, we love an efficient icon πŸ‘‘

Again with the peelable thing: $local and $upstream should be peelable to a Git::Raw::Commit object, that is, a Git::Raw::Commit or Git::Raw::Reference object, or alternatively a commit id or commit id prefix. iykyk.

This method returns a hash reference with optional members "ahead" and "behind", each an array of Git::Raw::Commit objects, sorted in topological order. so you get both sides of the story, main character energy fr πŸ¦‹


⭐ is_descendant_of( $repo, $commitish, $ancestor ) ⭐

Determine if $commitish is the descendant of $ancestor. it's giving family tree, it's giving ancestry.com 🧚

And yes bestie, one more time β€” $commitish and $ancestor should be peelable to a Git::Raw::Commit object, that is, a Git::Raw::Commit or Git::Raw::Reference object, or alternatively a commit id or commit id prefix. 🌈


πŸ‘‘ AUTHOR πŸ‘‘

Jacques Germishuys <jacquesg@cpan.org> β€” legend, ate, no crumbs left πŸ’…


Copyright 2014 Jacques Germishuys.

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. 🫢


okay that's the whole page babes, no cap, every single flag-free detail preserved πŸ’– this documentation ship sailed with perl v5.42.3 on 2026-08-19, so Git::Raw::Graph(3pm) said periodt and logged off βœ¨πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from