[FFmpeg-devel] [PATCH] tools: add bisect script

Michael Niedermayer michaelni at gmx.at
Tue Jul 3 13:28:48 CEST 2012


On Tue, Jul 03, 2012 at 02:00:39AM +0200, Stefano Sabatini wrote:
> On date Monday 2012-07-02 16:08:06 +0200, Michael Niedermayer encoded:
> > This script works like "git bisect" except that you can
> > specify with "bisect need ffmpeg|ffplay|ffserver|ffprobe" which tool(s)
> > are needed for testing a checkout
> > 
> > Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> > ---
> >  tools/bisect |   36 ++++++++++++++++++++++++++++++++++++
> >  1 file changed, 36 insertions(+)
> >  create mode 100755 tools/bisect
> > 
> > diff --git a/tools/bisect b/tools/bisect
> > new file mode 100755
> > index 0000000..934646f
> > --- /dev/null
> > +++ b/tools/bisect
> > @@ -0,0 +1,36 @@
> > +#!/bin/sh
> > +
> > +set -e
> > +
> > +case "$1" in
> > +    need)
> 
> > +        case "$2" in
> > +            ffmpeg)
> > +                echo ffmpeg.c >> need
> > +            ;;
> > +            ffplay)
> > +                echo ffplay.c >> need
> > +            ;;
> > +            ffprobe)
> > +                echo ffprobe.c >> need
> > +            ;;
> > +            ffserver)
> > +                echo ffserver.c >> need
> > +            ;;
> > +        esac
> 
> Simpler:
> case $2 in
>      ffmpeg|ffplay|ffprobe|ffserver)
>      echo $2.c >> need
> 

applied with that change


> 
> > +    ;;
> > +    start|reset)
> > +        echo . > need
> > +        git bisect $*
> > +    ;;
> > +    skip)
> > +        git bisect $*
> > +    ;;
> > +    good|bad)
> > +        git bisect $*
> > +
> 
> > +        until ls `cat need` > /dev/null 2> /dev/null; do
> > +            git bisect skip || break
> > +        done
> 
> What's the usefulness of checking for the presence of tool files

if one bisects, one has a testcase and that involves a tool, without
the tool testing may be difficult though in some cases another tool
can be substituted to test the revission, that is not always possible.


> (since I suppose they're usually there since very ancient versions)?
> Or in other words in which scenario is this script useful?

when bisecting its possible to end at checkouts that lack ffmpeg.c
or ffprobe.c, that is especially true as most new bugs originate from
libav and they have removed these tools. So bisect has the tendency
to home in on revissions that lack these tools.

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I am the wisest man alive, for I know one thing, and that is that I know
nothing. -- Socrates
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120703/c8e159a7/attachment.asc>


More information about the ffmpeg-devel mailing list