git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Smith <yarcs@qualitycode.com>
To: Ray Lee <ray-lk@madrabbit.org>
Cc: git@vger.kernel.org, darcs-devel@darcs.net
Subject: Re: [darcs-devel] Darcs and git: plan of action
Date: Mon, 18 Apr 2005 22:05:46 -0400	[thread overview]
Message-ID: <4264677A.9090003@qualitycode.com> (raw)
In-Reply-To: <1113874931.23938.111.camel@orca.madrabbit.org>

Ray Lee wrote:
> On Mon, 2005-04-18 at 21:05 -0400, Kevin Smith wrote:
> 
>>>>The other is "replace very instace of identifier `foo` with identifier`bar`".
>>>
>>>That could be derived, however, by a particularly smart parser [1].
>>
>>No, it can't. Seriously. A darcs replace patch is encoded as rules, not
>>effects, and it is impossible to derive the rules just by looking at the
>>results. Not difficult. Impossible.
> 
> 
> Okay, either I'm a sight stupider than I thought, or I'm not
> communicating well. Same net effect either way, I 'spose.
> 
> If I do a token replace in an editor (say one of those fancy new-fangled
> refactoring thangs, or good ol' vi), a token-level comparator can
> discover what I did. That link I sent is an example of one such beast.

The big feature of a darcs replace patch is that it works forward and
backward in time. Let me try to come up with an example that can help
explain it. Hopefully I'll get it right. Let's start with a file like
this that exists in a project for which both you and I have darcs repos:

cat
dog
fish

Now, you change it to:

cat dog
dog
fish

while I simultaneously do a replace of "dog" with "plant", resulting in:

cat
plant
fish

We merge. The final result in both of our trees is:

cat plant
plant
fish

Notice that just by looking at my diffs, you can't tell that I used a
replace operation. I didn't just replace the instances of "dog" that
were in my file at that moment. I conceptually replaced all instances,
including ones that aren't there yet.

Now, I should mention here that I personally dislike the replace
operation, and I think it is more dangerous than helpful. However, other
darcs users are quite happy with it, and it certainly is a creative and
powerful feature.

Other creative patch types have also been dreamed of. For example, a
powerful language-specific refactoring operation has been discussed as a
far-future possibility. That would be safe, and cool.

>>Automated refactoring tools, for example, perform the
>>rename+modify as an atomic operation.
> 
> And that's harder, I agree. But unless I'm missing some nifty
> refactoring editor out there that integrates with darcs during the edit
> session, the user *still* has to tell the SCM about the rename manually.

Although there are no such nifty refactoring tools available today, they
will exist at some point. If they existed today, the world would be a
better place.

Even without tools, many shops have policies against checking in code
that won't compile. If you rename a java class, you must simultaneously
perform the rename and modify the class name inside. If you commit
between those steps, it's broken. [I do realize that the kernel doesn't
have java code, by the way.]

I should also mention that I currently believe that Linus is correct
that explicit rename tracking is not required for git. I have every hope
that his plan for handling the more general case of "moved text" will
take care of renames as a side effect. I don't know if that will be
sufficient to allow a two-way lossless gateway between git and darcs or
other systems that do track renames explicitly.

Kevin

  reply	other threads:[~2005-04-19  2:02 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-18 21:04 [darcs-devel] Darcs and git: plan of action linux
2005-04-19  0:07 ` Ray Lee
2005-04-19  1:05   ` Kevin Smith
2005-04-19  1:42     ` Ray Lee
2005-04-19  2:05       ` Kevin Smith [this message]
2005-04-19 22:08         ` Patrick McFarland
2005-04-19 22:40         ` Ray Lee
2005-04-19 23:00           ` Tupshin Harper
2005-04-19 23:21             ` Ray Lee
2005-04-19 23:38               ` Tupshin Harper
2005-04-19 23:03           ` [darcs-devel] " Kevin Smith
2005-04-19 23:06             ` Ray Lee
2005-04-19 23:32               ` Tupshin Harper
2005-04-20  1:11                 ` [darcs-devel] " Ray Lee
2005-04-20  7:52                   ` Juliusz Chroboczek
2005-04-20 11:55                   ` David Roundy
2005-04-20 17:11               ` Ralph Corderoy
2005-04-19 11:05       ` David Roundy
     [not found] <20050419235832.56117.qmail@web51003.mail.yahoo.com>
2005-04-20  7:55 ` Juliusz Chroboczek
     [not found] <7ivf6lm594.fsf@lanthane.pps.jussieu.fr>
2005-04-18 12:20 ` David Roundy
2005-04-18 15:38   ` Linus Torvalds
2005-04-19 10:42     ` [darcs-devel] " David Roundy
2005-04-19 14:55       ` Linus Torvalds
2005-04-19 16:33         ` [darcs-devel] " Tupshin Harper
2005-04-19 16:49           ` Linus Torvalds
2005-04-18 18:35   ` Ray Lee
2005-04-19  0:55   ` Juliusz Chroboczek
2005-04-19  1:43     ` [darcs-devel] " Ray Lee
2005-04-19  8:22       ` Juliusz Chroboczek
2005-04-20  1:22         ` Ray Lee
2005-04-19 11:04     ` David Roundy
2005-04-19 12:20       ` Juliusz Chroboczek
2005-04-19 12:25         ` [darcs-devel] " Petr Baudis
2005-04-20 11:18           ` David Roundy
2005-04-20 11:29         ` David Roundy

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=4264677A.9090003@qualitycode.com \
    --to=yarcs@qualitycode.com \
    --cc=darcs-devel@darcs.net \
    --cc=git@vger.kernel.org \
    --cc=ray-lk@madrabbit.org \
    /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;
as well as URLs for NNTP newsgroup(s).