[Top][All Lists]

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

Re: [Monotone-devel] Notify script available

From: Nathaniel Smith
Subject: Re: [Monotone-devel] Notify script available
Date: Thu, 31 Mar 2005 09:02:23 -0800
User-agent: Mutt/1.5.8i

On Thu, Mar 31, 2005 at 05:44:14PM +0200, Richard Levitte - VMS Whacker wrote:
> In message <address@hidden> on Thu, 31 Mar 2005 14:24:05 +0200 (CEST), 
> Richard Levitte - VMS Whacker <address@hidden> said:
> richard> In message <address@hidden> on Thu, 31 Mar 2005 02:23:08 -0800, 
> Nathaniel Smith <address@hidden> said:
> richard> njs> The script I had in mind when adding some of these commands:
> richard> njs> 
> richard> njs> #!/bin/sh
> richard> njs> # Do a pull, and print out all newly received revisions, in 
> commit
> richard> njs> # order
> richard> njs> OLD_LEAVES=`monotone --db=foo.db automate leaves`
> richard> njs> monotone pull
> richard> njs> NEW_LEAVES=`monotone --db=foo.db automate leaves`
> richard> njs> (for L in $NEW_LEAVES; do
> richard> njs>   monotone --db=foo.db automate ancestry_difference $L 
> richard> njs> done) | xargs monotone automate toposort
> richard> 
> richard> That looks quite nice, and really solves a major part of my
> richard> script.  I can still use those database variables and make
> richard> the above, just get OLD_LEAVES in a different manner...

I'm not entirely convinced this is a good use of database variables...
such a notifier presumably needs some work area, a database that
polls, etc.; why not store the state it needs in a lookaside file?

This has the additional advantage that you can blow away the database
without causing a deluge of email messages...

> Hmm, I just realised that automate leaves doesn't quite do what I
> want.  I want to be able to select leaves from particular branches,
> and as far as I can see, automate leaves doesn't provide such a
> feature.  For my purposes, it would then be quite a bit better to use
> automate heads, looping over branches...

Yeah, if you want to track changes to a single branch, then drop in
"automate heads <branch>" in the place of "automate leaves" above.

> Still, automate ancestry_differences and automate toposort solve other
> parts of my script (that are buggy!) quite well.  All I need now is
> automate log and automate changes, then I'll be able to make it really
> simple.  Hmm, maybe I can create automate log, at the very least...

Hmm, see IRC discussion on the best way to split these up... :-)

I think I like adding a --depth argument to "log" much better than
"automate log" ATM, and not sure about the rest :-).

-- Nathaniel

"If you can explain how you do something, then you're very very bad at it."
  -- John Hopfield

reply via email to

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