monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Monotone-devel] Getting all certificates efficiently


From: Nathaniel Smith
Subject: Re: [Monotone-devel] Getting all certificates efficiently
Date: Sun, 30 Apr 2006 15:06:20 -0700
User-agent: Mutt/1.5.11

On Sun, Apr 30, 2006 at 07:01:32PM +0200, Wim Oudshoorn wrote:
> For my emacs monotone mode I want to fetch all certificates
> of all revisions in a somewhat efficient manner.  
> 
> With monotone version 0.23 I used
> 
>      monotone db execute "SELECT id,name,value FROM revision_certs"
> 
> and this returned all the certificates. the format 
> 
>     revision_id | name | base64-encoded-value
> 
> Now this is not perfect, but it is fast.  With a hot cache
> the command line above (with output redirected to /dev/null) 
> takes less than a second.
> 
> Unfortunately in monotone 0.26 the output format is changed to
> 
>     revision_id | name | value (not encoded at all)
> 
> This makes parsing really hard, if the value contains a newline,
> which often happens for changelog certs, or a pipe symbol
> you can't reliable tell where one certificate stops and the next
> one starts.  

Hrm.  I was doing to say "SELECT id, name, base64(value) FROM
revision_certs", but it looks like we don't actually expose a base64
function to sqlite.  It would be trivial enough to do so, though I'm
not sure how generally useful it would be.

This is still a hack, though.

Do you have any ideas on what sort of interface "automate" could grow
that be useful?  Is it really _all_ certs that you want?  Or do you
need any sort of filtering?

In general I'm getting the impression that we need some more general
solutions to querying certs, just like we currently have for querying
revisions (via select, ancestors, descendents, graph, erase_ancestors,
etc. etc.).  Someone else was asking about how to find tags that lie
in a particular branch, for instance.  I'm not sure what the interface
should look like, though.

One solution in such cases is to just start adding special cases to
the interface, so that later we'll be able to see where the
commonalities are and refactor.

So if people want to start randomly adding stupid cert-querying
commands to 'automate', go for it!

-- Nathaniel

-- 
"But in Middle-earth, the distinct accusative case disappeared from
the speech of the Noldor (such things happen when you are busy
fighting Orcs, Balrogs, and Dragons)."




reply via email to

[Prev in Thread] Current Thread [Next in Thread]