From: Rob Landley <rob@landley.net>
To: John Bradford <john@grabjohn.com>, Larry McVoy <lm@bitmover.com>,
Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: log-buf-len dynamic
Date: Mon, 29 Sep 2003 07:30:52 -0500 [thread overview]
Message-ID: <200309290730.52631.rob@landley.net> (raw)
In-Reply-To: <200309291124.h8TBOlam000872@81-2-122-30.bradfords.org.uk>
On Monday 29 September 2003 06:24, John Bradford wrote:
> > BK is really just a merging tool that fixes rejects
> > automatically, everything else is details...
>
> IFF that is true, then taking this to it's logical extreme, what is
> the point in having an SCM system for kernel development at all?
>
> It could be argued that what we really need is enhanced versions of
> diff and patch that actually understand C constructs and are able to
> make intellegent decisions about merging two pieces of code, even
> without knowledge of other merges.
But you can't always make intelligent merging decisions without knowledge
about other merges.
Suppose that tree 1 has a line "x=function(3*yy)+2", and tree 2 has the
corresponding line "x=fred+1". Your only merge choice is to pick one or the
other. You as a fully intelligent human being have no other choice unless
you're writing fresh code.
Now let's look at the patch history back to where the two trees diverged from:
Patch series:
original line:
x=yy+1;
Patch 1:
- x=yy+1;
+ x=function(3*yy)+2;
Patch 2:
- x=yy+1;
+ x=fred+1;
Looking at this, you can see that the result you probably want is
"x=function(3*fred)+2;", but you couldn't figure that out until you'd see the
original line they both diverged from. One tree probably had s/yy/fred/
applied to it, and the other tweaked the algorithm, thus the merges conflict
going either way.
But if the original line had instead been "x=fred+2;", the logical merge would
instead be "x=function(3*yy)+1;".
Original line:
x=fred+2;
Patch 1:
- x=fred+2;
+ x=function(3*yy)+2;
Patch 2:
- x=fred+2;
+ x=fred+1;
Logical merge: "x=function(3*yy)+1;"
You CANNOT KNOW THIS until you see the common ancestor they diverged from.
There just isn't enough information to work it out, unless you do so from
first principles by actually comprehending the algorithm being implemented
and what the changes are trying to accomplish.
That's why bitkeeper has to remember all the past changes to do its job of
merging new ones.
> 'Enhanced' is, of course, a complete understatement. What I am
> suggesting is basicaly adding A.I. functionality to diff and patch, to
> the point where they can merge three pieces of C code as efficiently
> as a good developer can.
If you've gotten AI working, why not just have it write the code and save us
the trouble?
> This would probably involve analysing code and identifying discrete
> sections, (analogous to the way a human developer would draw a flow
> chart), within which the purpose of algorithms and variable names
> could be deduced.
You're suggesting making a computer figure out the purpose of something.
Uh-huh. Has this ever happened, even once, in the entire history of
computing?
> This knowledge could then be used to adapt code
> that was submitted as a diff against a compltely different piece of
> code.
Written in a diferent language, performing a completely different task even...
> Ultimately, it should be possible for two people to independently
> write code to do a certain task, for one of them to add an extra
> facility to their codebase, and for the enhanced diff and patch tools
> to then add this facilty to the other, completely separate,
> implementation.
It'd be nice, sure. I do not know how to implement that. I don't know
anybody who does. If you do, by all means code it up. (My guess is you
don't understand the scope of the problem, but I could always be wrong....)
> John
Rob
next prev parent reply other threads:[~2003-09-29 12:34 UTC|newest]
Thread overview: 97+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20030923142706.54b2428a.davem@redhat.com>
2003-09-23 21:53 ` log-buf-len dynamic Linus Torvalds
2003-09-23 22:15 ` Andrea Arcangeli
2003-09-23 22:54 ` Linus Torvalds
2003-09-24 0:36 ` Andrea Arcangeli
2003-09-24 1:19 ` Larry McVoy
2003-09-24 2:04 ` andrea
2003-09-24 2:29 ` Larry McVoy
2003-09-24 2:39 ` Andrea Arcangeli
2003-09-24 3:16 ` Larry McVoy
2003-09-24 3:31 ` Rik van Riel
2003-09-24 3:45 ` Larry McVoy
2003-09-24 3:54 ` Linus Torvalds
2003-09-24 4:12 ` Rik van Riel
2003-09-24 21:11 ` yodaiken
2003-09-24 13:09 ` Alan Cox
2003-09-24 18:56 ` Jörn Engel
2003-09-24 3:46 ` Andrea Arcangeli
2003-09-24 4:02 ` Larry McVoy
2003-09-24 4:06 ` Rik van Riel
2003-09-24 2:36 ` Linus Torvalds
2003-09-24 2:48 ` Andrea Arcangeli
2003-09-24 3:06 ` Linus Torvalds
2003-09-24 3:28 ` Andrea Arcangeli
2003-09-24 3:38 ` Linus Torvalds
2003-09-24 3:56 ` Andrea Arcangeli
2003-09-24 4:26 ` viro
2003-09-24 3:42 ` Rik van Riel
2003-09-24 3:11 ` David S. Miller
2003-09-24 14:43 ` Roman Zippel
2003-09-25 4:08 ` Miles Bader
2003-09-25 4:20 ` Nick Piggin
2003-09-25 17:15 ` Eric W. Biederman
2003-09-25 17:30 ` Linus Torvalds
2003-09-25 17:57 ` Jeff Garzik
2003-09-25 18:22 ` Jörn Engel
2003-09-25 18:33 ` Randy.Dunlap
2003-09-25 18:36 ` Larry McVoy
2003-09-25 19:02 ` Jörn Engel
2003-09-25 19:41 ` OT go to gnu-arch-users for these matters (Re: log-buf-len dynamic) Andrea Arcangeli
2003-09-25 18:28 ` log-buf-len dynamic Charles Cazabon
2003-09-25 18:29 ` Larry McVoy
2003-09-25 20:15 ` David Lang
2003-09-25 20:27 ` Larry McVoy
2003-09-29 8:56 ` Rob Landley
2003-09-29 11:24 ` John Bradford
2003-09-29 12:30 ` Rob Landley [this message]
2003-09-29 15:22 ` John Bradford
2003-09-29 13:20 ` Rik van Riel
2003-09-29 13:23 ` Valdis.Kletnieks
2003-09-29 15:03 ` Larry McVoy
2003-09-29 18:21 ` Hua Zhong
2003-09-29 15:07 ` Larry McVoy
2003-09-25 19:23 ` Eric W. Biederman
2003-09-25 17:31 ` Christoph Hellwig
2003-09-25 19:28 ` Erik Andersen
2003-09-25 17:36 ` Dave Jones
2003-09-25 18:34 ` Larry McVoy
2003-09-25 18:35 ` Eric W. Biederman
2003-09-25 18:49 ` Larry McVoy
2003-09-25 20:02 ` Eric W. Biederman
2003-09-25 23:36 ` Pau Aliagas
2003-09-26 2:25 ` Miles Bader
2003-09-26 4:38 ` Davide Libenzi
2003-09-26 17:09 ` John Goerzen
2003-09-24 7:56 ` Pau Aliagas
2003-09-26 13:24 Samium Gromoff
2003-09-26 14:49 ` viro
-- strict thread matches above, loose matches on Subject: below --
2003-09-25 19:43 Mudama, Eric
2003-09-24 17:39 Ken Ryan
2003-09-22 19:48 Andrea Arcangeli
2003-09-23 1:51 ` Matthew Wilcox
2003-09-23 21:08 ` Andrea Arcangeli
2003-09-23 4:28 ` Willy Tarreau
2003-09-23 12:49 ` Andrea Arcangeli
2003-09-23 14:06 ` Willy Tarreau
2003-09-23 14:44 ` Andrea Arcangeli
2003-09-23 15:01 ` Jan Evert van Grootheest
2003-09-23 15:41 ` Andrea Arcangeli
2003-09-23 16:09 ` Willy Tarreau
2003-09-23 16:26 ` Andrea Arcangeli
2003-09-23 16:56 ` Ruth Ivimey-Cook
2003-09-23 17:40 ` Tom Zanussi
2003-09-23 17:53 ` Andrea Arcangeli
2003-09-23 21:37 ` Andrew Morton
2003-09-23 22:22 ` Andrea Arcangeli
2003-09-24 0:15 ` Andrew Morton
2003-09-24 0:38 ` Andrea Arcangeli
2003-09-23 16:06 ` Willy Tarreau
2003-09-23 16:23 ` Andrea Arcangeli
2003-09-23 19:02 ` Willy Tarreau
2003-09-23 22:34 ` Andrea Arcangeli
2003-09-23 23:29 ` Willy Tarreau
2003-09-23 23:48 ` Andrea Arcangeli
2003-09-23 23:50 ` Willy Tarreau
2003-09-23 12:46 ` Daniel Jacobowitz
2003-09-25 13:40 ` marcelo
2003-09-26 20:26 ` Andrea Arcangeli
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200309290730.52631.rob@landley.net \
--to=rob@landley.net \
--cc=john@grabjohn.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lm@bitmover.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox