Git::R...n::Log(3pm)

πŸ“¦
version 1.314 Β· 2 versions
  • 1.314 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 1.314 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– Git::R...n::Log(3pm) β€” aka the perl manual page, bestie edition πŸŽ€

okay so this is a page from the perl manual (User Contributed Perl Documentation, to be exact), and it's about Git::Repository::Plugin::Log. yes the title is literally Git::R...n::Log(3pm) because terminal people love abbreviating things. sit down, grab a snack πŸ“, we're doing this.


✨ NAME ✨

Git::Repository::Plugin::Log β€” bestie, this adds a log() method to Git::Repository. that's the whole vibe. πŸ’…


✨ SYNOPSIS ✨

    # load the plugin
    use Git::Repository 'Log';

    my $r = Git::Repository->new();

    # get all log objects
    my @logs = $r->log(qw( --since=yesterday ));

    # get an iterator
    my $iter = $r->log(qw( --since=yesterday ));
    while ( my $log = $iter->next() ) {
        ...;
    }

look at that. immaculate. you load the plugin, you make a repo object, and then you either grab all the log objects at once or you get a lil iterator and pull them one at a time like a sensible person. πŸ‘‘


✨ DESCRIPTION ✨

This module adds a new method to Git::Repository. that's it, that's the description, and honestly? iconic for being so short. 🌈


✨ METHOD ✨

πŸ’œ log

       # iterator
       my $iter = $r->log( @args );

       # all Git::Repository::Log objects obtained from the log
       my @logs = $r->log( @args );

So log runs git log with whatever arguments you hand it. fr fr, that's the job.

Now here's the context tea, and it matters:

  • In scalar context, you get back a Git::Repository::Log::Iterator object, and that thing hands you Git::Repository::Log objects on demand. lazy loading, we love to see it. πŸ¦‹
  • In list context, you get the full list of Git::Repository::Log objects. and bestie... > heads up: this can be very memory-intensive. 😭 like, it's gonna hold everything at once, so know what you're doing.

For the details on how the parameters get handled, go read Git::Repository::Log::Iterator's documentation. that's where the parameter lore lives. πŸ“–


✨ ACKNOWLEDGEMENTS ✨

Many thanks to Aristotle Pagaltzis, who requested a log() method in the first place β€” like, the whole reason this exists β€” and for very interesting conversations on the topic. we stan a collaborator. 🫢


✨ SEE ALSO ✨

  • Git::Repository::Plugin
  • Git::Repository::Log::Iterator
  • Git::Repository::Log

go read all three, they're the friend group. πŸ’–


Copyright 2010-2016 Philippe Bruhat (BooK), all rights reserved.


✨ LICENSE ✨

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. ✨


and that's the whole page, bestie!! πŸŽ€ this was Git::R...n::Log(3pm) from perl v5.34.0, dated 2022-06-14. slay, go run some git log. πŸ’…πŸ”₯

πŸ“¦ where this page comes from