App::SVN::Bisect(3pm)

๐Ÿ“ฆ
version 1.1 ยท 2 versions
, in fedora 43

โœจ App::SVN::Bisect โœจ

okay bestie, so this is App::SVN::Bisect โ€” yes it's a Perl module (3pm, she's a library manual, not a command), and yes she's literally the brains behind svn-bisect. binary search through svn revisions?? it's giving detective energy ๐Ÿ”๐Ÿ’…


๐Ÿฆ‹ SYNOPSIS ๐Ÿฆ‹

my $bisect = App::SVN::Bisect->new(
    Action => $action,
    Min => $min,
    Max => $max
);
$bisect->do_something_intelligent(@ARGV);

๐Ÿ’– DESCRIPTION ๐Ÿ’–

so this module is the whole backend of the svn-bisect command line tool. the glow-up is real. if you wanna know how to actually use the command line thing, go read the POD documentation of that tool โ€” that's where the usage details live. this page is the behind-the-scenes lore ๐ŸŽฌ


๐Ÿ‘‘ API METHODS ๐Ÿ‘‘

๐ŸŒธ new

$self = App::SVN::Bisect->new(Action => "bad", Min => 0, Max => undef);

creates an App::SVN::Bisect object, periodt. the arguments are typically parsed straight off the command line, no cap.

the Action argument has to be listed in the %actions table โ€” like, that's non-negotiable bestie. and the "read_config" attribute of the action decides whether the metadata file (typically named .svn/bisect.yaml) is gonna get read.

๐ŸŒˆ do_something_intelligent

$self->do_something_intelligent(@ARGV);

runs whichever action the user asked for. the deets live in the "Action methods" section right below this one ๐Ÿ‘‡

if the action's "write_config" bit is set in the %actions table, then the metadata file gets written after the action runs. and if that bit was not set? the metadata file gets removed. bye bitch ๐Ÿซถ


๐Ÿ’… ACTION METHODS ๐Ÿ’…

๐ŸŽ€ start

kicks off a bisect session. sets up the parameters, goes and asks the subversion repository some nosy questions, and then serves you your very first bisect. main character entrance fr.

๐Ÿฆ‹ before

sets the "min" parameter to the revision you specified (or the current one, if you didn't specify), and then yeets you to the middle of the resulting range.

๐Ÿ“ after

sets the "max" parameter to the revision you specified (or the current one), and then yeets you to the middle of the resulting range. she's symmetric like that โœจ

๐Ÿงš reset

cleans up after a bisect session โ€” the whole post-party tidy-up. and if you pass --back, she also moves the working tree back to the original revision it had when start was first called. nostalgic queen.

โญ skip

tells svn-bisect to ignore the revision you specified (or the current one), then moves you to another, strategically useful revision. we love strategy.

you may specify as many revisions at once as you like. go off.

๐Ÿ’œ unskip

tells svn-bisect to stop ignoring the specified revision, then moves you to another, strategically useful revision. un-ignoring is self care.

you may specify as many revisions at once as you like. again, go off.

๐Ÿ”ฅ run

runs a command over and over again to automate the whole bisection process. it's giving hands free.

we run the command and arguments until a conclusion is reached. the command (usually a shell script) tells us about the current revision by way of its return code. here's the whole menu of return codes that are handled, don't skip this part:

0: This revision is before the change we're looking for
1-124, 126-127: This revision includes the change we're looking for
125: This revision is untestable and should be skipped
any other value: The command failed to run, abort bisection.
the normal caveats apply. in particular, if your script makes any changes, don't forget to clean up afterwards. i'm serious bestie, clean up your mess ๐Ÿ˜ญ

๐Ÿซถ help

lets the user get some descriptions and usage information. wholesome.

this function calls exit() directly, specifically so that do_something_intelligent() doesn't go and remove the metadata file. sneaky but iconic.

๐ŸŒธ view

lets the user get some information about the current state of things. very "let me check my notes" of her.

this function also calls exit() directly, to prevent do_something_intelligent() from removing the metadata file. same trick, same slay.


๐Ÿ”ฎ INTERNAL METHODS ๐Ÿ”ฎ

๐Ÿ’€ cmd

my $stdout = $self->cmd("svn info");

runs a command, returns its output. that's it, that's the whole thing.

๐Ÿ’– ready

$self->next_rev() if $self->ready();

returns a true value if we have enough information to begin bisecting. specifically, this returns true if we've been given at least one "bad" and one "good" revision. those can come in as arguments to the "before" and "after" commands, or as --min and --max arguments to the "start" command. two data points, that's the vibe check โœ…

โœจ next_rev

$self->next_rev();

finds a spot in the middle of the current "suspect revisions" list, and calls "svn update" to move the checkout directory to that revision. right in the middle, like a true diplomat.

๐ŸŒˆ list_revs

my @revs = $self->list_revs();

returns the set of valid revisions between the current "min" and "max" values, exclusive. (exclusive, bestie โ€” not inclusive. don't come for me.)

she's smart about revisions that don't affect the current tree (because they won't be returned by fetch_log_revs, below) and about skipped revisions (which the user may specify with the "skip" command). smart girl summer.

๐ŸŽ€ stdout

$self->stdout("Hello, world!\n");

outputs a message to stdout. it's basically just the "print" function, except we do it as a method so the testsuite can override it through subclassing. fancy for a reason โœจ

๐Ÿฆ‹ verbose

$self->verbose("Hello, world!\n");

outputs a message to stdout, if the user specified the --verbose option. it's basically just a conditional wrapper around the "print" function. shy but only on purpose.

๐Ÿ“ exit

$self->exit(0);

exits. this lets the test suite override exiting. it does not provide any other features above and beyond what the normal exit system call provides โ€” so don't expect extra โœจ, it's just exit with a wig on.


๐Ÿงš SUBVERSION ACCESSOR METHODS ๐Ÿงš

โญ update_to

$self->update_to(25000);

calls svn update to move to the specified revision. chauffeur behavior.

๐Ÿ’œ fetch_log_revs

my $hashref = $self->fetch_log_revs();

calls "svn log" and parses the output. returns a hash reference whose keys are valid revision numbers โ€” so you can use exists() to find out whether a number is in the list. this hash reference is used by list_revs(), up above. teamwork makes the dream work ๐Ÿซถ

๐Ÿ”ฅ find_max

my $rev = $self->find_max();

plays some tricks with "svn log" to figure out the latest revision contained within the repository. she's doing stunts for the plot.

๐ŸŒธ find_cur

my $rev = $self->find_cur();

parses the output of "svn info" to figure out what the current revision is. nosy, in the best way.


๐Ÿ’– AUTHOR ๐Ÿ’–

Mark Glines <mark-cpan@glines.org>

๐Ÿซถ THANKS ๐Ÿซถ

  • thanks to the git-bisect author(s), for coming up with a user interface that I actually like. (their words, and honestly valid.)
  • thanks to Will Coleda for inspiring me to actually write and release this.
  • thanks to the Parrot project for having so much random stuff going on as to make a tool like this necessary. chaos creating necessity, iconic honestly.

๐Ÿ‘€ SEE ALSO ๐Ÿ‘€

App::SVNBinarySearch by Will Coleda: <http://search.cpan.org/dist/App-SVNBinarySearch/>


this software is copyright (c) 2008-2009 Mark Glines.

it is distributed under the terms of the Artistic License 2.0. for details, see the "LICENSE" file packaged alongside this module. read it bestie, licenses are self care ๐Ÿ’…


and that's the whole page!! this was perl v5.42.0, dated 2025-07-25 โ€” shoutout to App::SVN::Bisect(3pm), she's booked, she's busy, she's bisecting. mwah ๐Ÿ’‹โœจ

๐Ÿ“ฆ where this page comes from