App::KGB::Change(3pm)

πŸ’– App::KGB::Change πŸ’–

okay bestie, this is App::KGB::Change β€” a single file change, from the App::KGB family (it's the Perl manpage collection, you're in the right place 🫢).


✨ SYNOPSIS ✨

my $c = App::KGB::Change->new(
    { action => "M", prop_change => 1, path => "/there" } );

print $c;

my $c = App::KGB::Change->new("(M+)/there");

🌸 DESCRIPTION 🌸

So like, App::KGB::Change encapsulates a single path change coming out of a given change set (or commit, same vibe πŸ’…).

And the icon behaviour? App::KGB::Change overloads the "" operator so your change objects get a default string representation. no cap, that's the whole point πŸŽ€


πŸ¦‹ FIELDS πŸ¦‹

  • action (mandatory) β€” the action that was performed on the item. The possible values are:
    • M β€” the path was modified.
    • A β€” the path was added.
    • D β€” the path was deleted.
    • R β€” the path was replaced.
  • path (mandatory) β€” the path that was changed. yeah, that one. πŸ‘‘
  • prop_change β€” Boolean. Indicates that some properties of the path were changed, not the content. lowkey important distinction bestie ✨

🧚 CONSTRUCTOR 🧚

πŸ’œ new ( { initial values } )

More-or-less standard constructor. It's giving "you already know what this does."

  • It can take a hashref with keys that are all the field names (See ).
  • Or, it can take a single string, which gets de-composed into components. πŸͺ„

See for examples.


⭐ METHODS ⭐

  • as_string() β€” returns a string representation of the change. This is what the "" overload uses. And the glow-up? The resulting string is suitable for feeding back into the constructor if you ever need to. circular queen πŸ’…

🌈 CLASS METHODS 🌈

detect_common_dir("changes")

Give it an arrayref of changes (instances of APP::KGB::Change) and it detects the longest path that is common to all of them. All the changes' paths get trimmed from that common part. βœ‚οΈ

Example, fr fr:

foo/b
foo/x
foo/bar/a

would return 'foo' and the paths would be trimmed down to:

b
x
bar/a

obSESSED with how clean that is 🌸


πŸ’– that's the whole page bestie, every field, every flag, every trim, no skips, no cuts 🫢

perl v5.40.1, dated 2026-07-10 β€” written for App::KGB::Change. slay, go forth and log your changes πŸ’…βœ¨

πŸ“¦ where this page comes from