monotone-devel
[Top][All Lists]
Advanced

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

Re: [Monotone-devel] Suggestion for new commit variant


From: Nathaniel Smith
Subject: Re: [Monotone-devel] Suggestion for new commit variant
Date: Thu, 27 Oct 2005 01:00:30 -0700
User-agent: Mutt/1.5.9i

On Thu, Oct 27, 2005 at 08:55:30AM +0200, Wim Oudshoorn wrote:
> monotone newcommit [-b branch] -parentrevs rev1 rev2 ....
>
> That is, I can commit a set of source files  
> and explicitly specify the parent revisions.

I've been thinking it might be nice to have some sort of explicitly
controlled commit command for use in automation, that let you specify
all the pieces explicitly instead of having to set up a tree, play
nice with the commit editor, etc.

A problem with this solution is that you need more than a set of
files; you need the changeset from each parent.  If there are no
renames, the changeset can be derived from the set of files, but...
that's a special case, and we should be consistent.

> This would solve quite a few of my problems:
> 
> 1 - merging outside of monotone's control:
> 
>   * Check out HEAD1
>   * Check out HEAD2
>   * Check out ANCESTOR
>   * Do my merge on my tree
>   * monotone newcommit -parentrevs HEAD1 HEAD2

Merge in working copy is on the TODO list anyway, and the new merge
code in the rosters branch should make it much easier to implement.
(The current merge code has a baked-in assumption that each conflict
is resolved before it continues merging the next part of the tree,
which is hard to fix without rewriting everything.  Avoiding this is
one of the explicit goals of the roster merger.)

> 3 - I can do an explicit dissapprove
> 
>   REV1       -----> REV2
>   branch A          branch A
>                /
>               /
>          ....
> 
> 
>    namely checkout REV1 
>    and do:
> 
>    monotone newcommit -parentrevs REV1 REV2.

You want to read the links I posted about disapprove earlier -- they
explain why disapproving over a merge is not just a random thing we
left out, but an actively bad idea, that doesn't give you the behavior
you want.

(The key example is
       A
      / \
     B   C
      \ /
       D
      / \
     B'  C'
where B' = B and C' = C, and are created by disapproving D.  merge(B',
C') does not give you D again; rather, it gives you A (!).  See the
IRC log for full discussion.)

-- Nathaniel

-- 
When the flush of a new-born sun fell first on Eden's green and gold,
Our father Adam sat under the Tree and scratched with a stick in the mould;
And the first rude sketch that the world had seen was joy to his mighty heart,
Till the Devil whispered behind the leaves, "It's pretty, but is it Art?"
  -- The Conundrum of the Workshops, Rudyard Kipling




reply via email to

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