[darcs-users] new trackdown command

David Roundy droundy at abridgegame.org
Sat Oct 25 16:05:44 UTC 2003


I've just implemented a new command called darcs trackdown, which is
intended to allow you to easily track down which patch introduced a bug.
I'm soliciting comments because I'm not sure where exactly to go with this
command (which is so far only a sort of working prototype).

Basically, you use it by calling

darcs trackdown [INITIALIZE] CHECK

where initialize and check are two shell commands.  INITIALIZE is run once
on the currently recorded version, and CHECK is run again and again on
different versions.  Trackdown tries to find the most recent version for
which check succeeds.

So 

darcs trackdown 'grep FIXME Record.lhs'

locates the most recent version with a FIXME in Record.lhs.

darcs trackdown 'autoconf && ./configure' \
    'make darcs && ./darcs --version | grep 13'

locates the most recent version of darcs that considers itself to be
version 0.9.13 (which actually isn't darcs 0.9.13, since I forgot to change
the version number after releasing 0.9.13).

Note that trackdown runs all the tests in the same directory, so if you
have a good makefile it hopefully won't be *too* painful running make on
all these versions.

Currently, trackdown just goes down the line backing off one patch at a
time until it finds a version that passes the test.  I'd like to make it
smart enough to reorder patches and look for the version with the largest
number of patches in it that passes the test.  This would require a clever
heuristic algorithm, since the space of passible sets of N patches is 2^N
(which may be rather large).

It would also be nice be able to restrict what possibilities trackdown
tries.  For example, to only try versions that contain tag '0.9.12', or
perhaps to allow the user to interactively specify which patches trackdown
should consider removing.  This would be particularly important if
trackdown really tries to find the *largest* set of patches that passes the
test (which could be very time consuming).

I'm not particularly pleased with the output of trackdown, but am not sure
how to do things better.  In a sense, the fundamental output is something
like a list of versions that are known to work and versions that don't
work.  But as a user what I'd like to know is something more like a
dependency graph between patches.  e.g. something like: patch A causes the
test to fail unless patch B is also present, patch C always causes the test
to fail, and patch D is harmless.  I'm not sure how to present this
information, and it's not necesarily always possible to simplify the
results in this manner.

Anyhow, any comments, suggestions, scenarios in which you would like to use
such a feature, related features you might want, etc, would be welcome.

Many of these issues are related to those involved in repository
searching--trackdown is really a sort of complex search.  So any
suggestions or requests related to a repository searching mechanism may be
relevant here, since it would perhaps be nice to use a similar framework
for both features (not that I've yet implemented a search feature, but it's
been requested).
-- 
David Roundy
http://www.abridgegame.org/darcs




More information about the darcs-users mailing list