monotone-devel
[Top][All Lists]
Advanced

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

Re: [Monotone-devel] branch abbreviations


From: Peter Todd
Subject: Re: [Monotone-devel] branch abbreviations
Date: Mon, 18 Jun 2007 12:15:57 -0400
User-agent: Mutt/1.5.13 (2006-08-11)

On Mon, Jun 18, 2007 at 07:04:18PM +0300, Tero Koskinen wrote:
> The idea of branch aliases is great, but atleast I put all my personal
> projects into a single database and have names like:
>  project-a.trunk
>  project-a.release_1
>  project-b.trunk
>  project-b.release_1
>  project-c.trunk
> 
> In this case giving the suffix doesn't help.
> 
> Maybe one could create a lua hook for resolving branch aliases and
> place it to monotonerc? Then people could customize the alias behaviour
> as they want.
> 
> For example:
> function resolve_branch_name(name)
>    if (name == "monotone") then return "net.venge.monotone" end
> 
>    return name;
> end

I'll second the idea of a hook.

If I were to write such a hook, I'd have it return whatever branch
has a substring match with the given branch name. Then return the branch
name with the fewest characters, either in total, or perhaps after the
substring match.

For instance here are some branches from my database:

io.pkt.art.light-recorder
io.pkt.art.light-recorder.pcb.v1.0
io.pkt.art.light-recorder.tests

If I use light-recorder as my branch name, chances are I want the first
entry, not the more specific pcb or tests branches.

-- 
http://petertodd.org

Attachment: signature.asc
Description: Digital signature


reply via email to

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