App::K...nt::Git(3pm)

✨ NAME ✨

App::KGB::Client::Git β€” Git support for the KGB client πŸ’– (yes bestie, that's the whole manual name, the header up top just truncates it because the terminal is a hater)


🌸 SYNOPSIS 🌸

my $c = App::KGB::Client::Git->new({
    ...
    git_dir => '/some/where',   # defaults to $ENV{GIT_DIR}
    old_rev     => 'a7c42f58',
    new_rev     => '8b37ed8a', });

πŸ¦‹ DESCRIPTION πŸ¦‹

So, App::KGB::Client::Git is the module that hands the KGB client all its Git-repository knowledge 🫢. Its method returns a whole series of App::KGB::Commit objects β€” and every single one of them is the next commit in the series you received. One per commit, in order, no skips, no crumbs left behind. Periodt. ✨

ngl the manpage literally forgot to print the method's name there (there's just a lil empty gap πŸ‘€), so that's exactly what I'm telling you: its method. No cap.

πŸ‘‘ CONSTRUCTION πŸ‘‘

πŸŽ€ App::KGB::Client::Git->new( { parameters... } )

You can hand over the input data in any of these ways, pick ur fighter πŸ₯°:

  • as parameters to the constructor β€” the classic, single-commit, main-character move:
# a single commit
my $c = App::KGB::Client::Git->new({
    old_rev => '9ae45bc',
    new_rev => 'a04d3ef',
    refname => 'master',
});
  • as a list of revisions/refnames β€” when you've got several commits and you're not doing them one by one like a peasant:
# several commits
my $c = App::KGB::Client::Git->new({
    changesets  => [
        [ '4b3d756', '62a7c8f', 'master' ],
        [ '7a2fedc', '0d68c3a', 'my'     ],
        ...
    ],
});

Every other way of supplying the changes data gets converted internally into this one. The pipeline says: we all end up here. πŸ’…

  • in a file whose name is in the reflog parameter β€” a file name of "-" means standard input, and honestly that's the normal way for Git post-receive hooks to get their data.

The file has to have three words separated by spaces on every line, okay? First word = the old revision. Second = the new revision. Third = the refname. In that order, don't freestyle it. πŸ™ˆ

  • on the command line β€” lowkey iconic for when you're testing the KGB client from the command line. If old_rev, new_rev, refname and changesets are all not given to the constructor, and @ARGV has exactly three elements, those three become old revision, new revision and refname, respectively. Heads up though: only one commit can be represented on the command line. Just the one. 🀏

With literally all of the methods above, the location of the .git directory can be passed in the git_dir parameter β€” or it gets taken from the environment variable GIT_DIR. Your call, queen. πŸ‘‘

πŸ’œ git-config parameters

These can be set in the "[kgb]" section of git-config(1). Oh and, important: if they're present, they override the settings in the configuration file and the ones given on the command line. They said "my rules now". πŸ’€

  • project-id β€” the project ID. See "project-id" in App::KGB::Client for details. πŸ“
  • web-link β€” see "web-link" in App::KGB::Client for details.
  • squash-threshold number β€” this one is unique to the Git KGB client ✨. It sets a threshold for the notifications produced for a given branch update. If there are more commits in the update than that, instead of flooding everyone with a huge amount of notifications, the commits get "squashed" into one notification per branch, with a summary of the changes. Considerate of them tbh.

The default value is 20.

  • squash-message-template string β€” a template for constructing those squashed messages. See "message-template" in App::KGB::Client for details.

The default is "${{module} }${{branch} }${{commit} }${{author-name} }${{log}}".

  • tag-squash-threshold number β€” also unique to the Git KGB client 🌈. This sets the threshold for notifications produced on tag creations. If more tags than that get created in the push, instead of a huge amount of notifications, the tags get "squashed" into a single notification summarizing the information.

The default value is 5.

  • tag-squash-message-template string β€” a template for constructing squashed tags messages. See "message-template" in App::KGB::Client for details.

The default is "${{module} }${{author-name} }${{log}}".

  • enable-branch-ff-notification bool β€” turns notifications on for branch updates whose commits have already been reported. Normally that makes a notification like "fast forward" show up. If that's not ur vibe, set it to false. 🚫

The default is "true".


πŸ’… METHODS πŸ’…

  • describe_commit β€” returns an instance of the App::KGB::Change class for each commit. And when all the commits have been processed? It returns undef. That's it, that's the whole farewell. 😭
  • format_git_stat text β€” returns a colored version of text, which is expected to be the result of git diff --shortstat. Cute-ify that stat, bestie. 🎨

Copyright (c) 2009, 2013 Damyan Ivanov

Based on the shell post-receive hook by Andy Parkins

This file is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. ⚠️

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.


okay that's the whole page, we ate and left absolutely no crumbs 🍽️✨ this lil writeup came from perl v5.40.1, dated 2026-07-10, and it lives under the page name App::KGB::Client::Git(3pm) β€” stan, follow, subscribe, bye bestie πŸ’–πŸ¦‹

πŸ“¦ where this page comes from