Git::Raw::Reflog(3pm)
π Git::Raw::Reflog β the Git reflog class, bestie edition π
okay so. this is Git::Raw::Reflog, a Perl module from the Git::Raw family, and it's literally the reflog but make it Perl. no cap.
VERSION: version 0.90 β¨
πΈ SYNOPSIS πΈ
here's the whole vibe, copy-paste ready:
use Git::Raw;
# open the Git repository at $path
my $repo = Git::Raw::Repository -> open($path);
# get the master branch
my $master = Git::Raw::Branch -> lookup($repo, 'master', 1);
# retrieve the reflog for 'master'
my $reflog = $master -> reflog;
# print out reflog information
my @entries = $reflog -> entries;
foreach my $entry (@entries) {
my $committer = $entry -> committer;
print "Committer:", "\n";
print "\t", "Name: ", $committer -> name, "\n";
print "\t", "E-Mail ", $committer -> email, "\n";
print "\t", "Time: ", $committer -> time, "\n";
print "\t", "Offset: ", $committer -> offset, "\n";
print "\n";
print "Message: ", $entry -> message, "\n";
print "Old id: ", $entry -> old_id, "\n";
print "New id: ", $entry -> new_id, "\n";
}
# add a new entry to the reflog
my $signature = Git::Raw::Signature -> default($repo);
$reflog -> append("Hello", $signature);
$reflog -> write;
# drop an entry from the reflog
$reflog -> drop(0);
$reflog -> write;
# remove the reflog
$reflog -> delete;
$reflog -> write;
likeβ¦ that's the whole arc. open a repo, grab a branch, get its reflog, read every entry, append one, drop one, delete the whole thing. character development fr fr. π
π¦ DESCRIPTION π¦
A Git::Raw::Reflog represents a Git reflog. that's the tea. β
β οΈ WARNING: The API of this module is unstable and may change without warning (any change will be appropriately documented in the changelog). π so like, don't build your whole personality on it staying put. it will be documented if it shifts, but it will shift. iykyk.
β¨ METHODS β¨
open( $reference )
Open the reflog for the reference $reference. that's it, that's the method β you point at a reference, it hands you its reflog. π«Ά
delete( )
Delete the reflog for the reference. gone. not me being dramatic, it's literally deleted. π
append( $message [, $signature])
Add a new entry to the reflog. If $signature is not provided, the default signature, Git::Raw::Signature->default(), will be used. so you can pass one, but if you don't, it's got you. π
drop( $index )
Remove entry $index from the reflog. bye to that one specific entry bestie. π
write( )
Write the reflog back to disk. commit to the bit β nothing sticks until you do this. π₯
entry_count( )
Retrieve the number of entries in the reflog. a little count, a little vibe check. π’
entries( [$index, $count] )
Retrieve a list of Git::Raw::Reflog::Entry objects. and yes you can slice it up with $index and $count if you only want a lil range of them. β¨
π AUTHOR π
- Alessandro Ghedini
<alexbio@cpan.org> - Jacques Germishuys
<jacquesg@cpan.org>
actual icons, both of them.
π LICENSE AND COPYRIGHT π
Copyright 2014 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.
okay that's the whole page!! and one last lil sign-off from the footer: this was documented for perl v5.42.3 and dated 2026-08-19 β so if you're reading this from the future, hi, hope the reflog is reflogging. π§π mwah, go write some code. β
π¦ where this page comes from
- ubuntu stonking: libgit-raw-perl 0.90+ds-3build3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms