BISECT_...SING_GIT(1)

πŸ“¦
version 0.33 Β· 2 versions
, in fedora 43

✨ BISECT_...SING_GIT ✨

okay bestie, welcome to the bisect_perl_using_git page πŸ’– this one lives in the User Contributed Perl Documentation corner of your manual, and it's genuinely one of the most useful little tools you'll ever meet, no cap.


πŸ¦‹ NAME πŸ¦‹

bisect_perl_using_git β€” literally here to help you bisect Perl πŸ’…


🌸 DESCRIPTION 🌸

so bisect_perl_using_git helps you bisect Perl. that's the whole vibe. it helps you find at what commit a change happened in Perl πŸ•΅οΈβ€β™€οΈ

you can check for file addition and removal β€” it checks out various commits of Perl and figures out which change was involved. you can also check for a difference in Perl evaluation, in which case it will check out various commits of Perl, compile them, and find out which change was involved. heads up though: that second one is more CPU intensive and you must install ccache 😭 it's giving "worth it but prepare your fans".

first things first, you gotta download the current Git repository of Perl, so run something like this:

mkdir git
cd git
git clone git://perl5.git.perl.org/perl.git perl-git
cd perl-git

πŸŽ€ example one: the autodie origin story

now, I happen to know that the autodie pragma was added sometime in December 2008, but I would like to know which commit. let's find out some commits at the beginning and the end of that month, and see when lib/autodie.pm was added πŸ‘‘

# git log --before=2008-12-01 -n 1
# 1409bc0658469580630ba458c85fe9cc3cb2d78c
# git log --before=2008-12-31 -n 1
# 675b0f774d374f6951c02c6463c64a746ad46acd
git bisect reset
git bisect start
git bisect good 1409bc0658469580630ba458c85fe9cc3cb2d78c
git bisect bad 675b0f774d374f6951c02c6463c64a746ad46acd
# Bisecting: 114 revisions left to test after this
git bisect run bisect_perl_using_git --action file_added \
  --filename lib/autodie.pm
# ... after checking out 10 trees and about 10 seconds, it says:
# 0b09a93a0cec34bc5d1740400c4ed9500d2f1dbe is first bad commit
# commit 0b09a93a0cec34bc5d1740400c4ed9500d2f1dbe
# Author: Paul Fenwick <pjf@perltraining.com.au>
# Date:   Sat Dec 20 22:21:02 2008 +0900
#
# git-flavoured autodie 1.997 patch
# G'day p5p,
# ...
git bisect reset

ate and left no crumbs πŸ“


🧚 example two: bye bye MANIFEST

sometime after June 2009, ext/Storable/MANIFEST was removed from Perl. let's find out which commit removed it:

# git log --before=2009-06-01 -n 1
# 20f91e418dfa8bdf6cf78614bfebebc28a7613ee
git bisect reset
git bisect start
git bisect good 20f91e418dfa8bdf6cf78614bfebebc28a7613ee
git bisect bad HEAD
# Bisecting: 266 revisions left to test after this
git bisect run bisect_perl_using_git --action file_removed \
  --filename ext/Storable/MANIFEST
# ... after checking out 11 trees and about 10 seconds, it says:
# 2868e48536e3f471e5ba483466cc1bc53caff5a is first bad commit
# commit e2868e48536e3f471e5ba483466cc1bc53caff5a
# Author: David Mitchell <davem@iabyn.com>
# Date:   Fri Jun 12 17:24:43 2009 +0100
#
#    remove ext/Storable/MANIFEST; its out of date related to CPAN
#    and for most dual-life modules we don't bother including it in blead
# ...
git bisect reset

πŸ”₯ example three: the real bug report moment

now for a real bug report, where some code that works in Perl 5.8.8 and should work in Perl 5.10.0 but does not 😭 the main character energy of a genuine regression:

http://rt.perl.org/rt3/Public/Bug/Display.html?id=62056

we create a ~/testcase.pl which contains the following:

#!perl
use strict;
use warnings;
use charnames ':full';
my $x;
m/$x\N{START OF HEADING}/

and then run:

git bisect reset
git bisect start
git bisect good perl-5.8.8
git bisect bad perl-5.10.0
# Bisecting: 4041 revisions left to test after this
git bisect run bisect_perl_using_git --action perl_fails \
  --filename ~/testcase.pl
# ... after checking out 16 trees and about one hour, it says:
# fc8cd66c26827f6c2ee1aa00ab2d3b3c320a4a28 is first bad commit
# commit fc8cd66c26827f6c2ee1aa00ab2d3b3c320a4a28
# Author: Yves Orton <demerphq@gmail.com>
# Date:   Tue Sep 19 03:37:19 2006 +0200
#
#    Re: \N{...} in regular expression [PATCH]
# ...
git bisect reset
ngl, "checking out 16 trees and about one hour" is the moment where you go make a snack and let the computer cook 🫢

πŸ’œ AUTHOR πŸ’œ

Leon Brocard, "<acme@astray.com>"


Copyright (C) 2009, Leon Brocard


🌈 LICENSE 🌈

This module is free software; you can redistribute it or modify it under the same terms as Perl itself.


and that's the whole page, bestie ✨ this was perl v5.42.0, dated 2025-07-25, filed under BISECT_...SING_GIT(1) β€” go bisect something iconic πŸ‘‘πŸ’…

πŸ“¦ where this page comes from