Dist::...::Repo(3pm)

πŸ’– Dist::Zilla::Role::Git::Repo β€” the 3pm girlies' cut πŸ’–

okay bestie, so this is a Perl manual page, filed under User Contributed Perl Documentation, and it's literally just called Dist::...::Repo in the header because man headers are dramatic like that. It's the 3pm section, meaning it's a module doc. Let's go ✨


✨ NAME ✨

Dist::Zilla::Role::Git::Repo β€” the role that hands out repository info for your Git plugins πŸŽ€


🌸 VERSION 🌸

version 2.052 β€” yeah, it's giving established, it's giving stable 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

So the way this works: this role gets consumed by the Git plugins, and its whole job is two things:

  • it goes and finds out how your repo is structured (where's the root, etc.)
  • it builds you a Git::Wrapper object so you can actually talk to git

That's it. That's the whole vibe. No cap πŸ’…


πŸ‘‘ ATTRIBUTES πŸ‘‘

repo_root

This is the repository root, bestie. You can give it as a full path, or you can give it relative to the distribution root β€” both are valid, queen.

The default? It's just the distribution root, which in code is written like:

$zilla->root

so if you don't say anything, it assumes the repo lives right at the top of your dist. Simple. Clean. Iconic. ✨


πŸ”₯ METHODS πŸ”₯

current_git_branch

$branch = $plugin->current_git_branch;

This one returns the current branch in the repository. But β€” and hear me out β€” if your repo has a detached HEAD (iykyk, we've all been there, floating in the void with no branch 😭), it returns undef instead.

⚠️ warning bestie: this value is cached. Like, it gets remembered and it does not update if the branch gets changed during the run. So if something switches branches mid-run, this method is still out here telling you about the old one. It's committed to that memory, fr fr πŸ’€

git

$git = $plugin->git;

This method returns a Git::Wrapper object for the repo_root directory. If one doesn't exist yet, it constructs one on the spot β€” no hesitation, no prep, just builds it 🧚

And here's the cute part: the object is shared between all the plugins that consume this role β€” as long as they've all got the same repo_root. So everybody's holding hands and using the same wrapper. Community. Collaboration. Slay 🌈


🫢 SUPPORT 🫢

Got beef with the code? Found a bug? You can submit it through the RT bug tracker here:

or if you're an email girlie, straight to:

  • bug-Dist-Zilla-Plugin-Git@rt.cpan.org

There's also a mailing list for users of this distribution, right here:

and there's an IRC channel if you wanna hang with the distribution users β€” it's #distzilla on irc.perl.org:

  • <irc://irc.perl.org/#distzilla>

Come through, the people are nice πŸ’œ


⭐ AUTHOR ⭐

Jerome Quelin β€” the icon, the legend, the moment πŸ‘‘


This software is copyright (c) 2009 by Jerome Quelin.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. Free as in, like, actually free bestie πŸŽ€


that's the whole page!! every flag-free, method-laden, license-covered inch of it, no details left behind, periodt πŸ’…βœ¨

source/version: perl v5.40.1, dated 2025-09-29, straight out of the Dist::...::Repo(3pm) file β€” mwah, love that for us πŸ¦‹πŸ’–

πŸ“¦ where this page comes from