[darcs-devel] Optimizing "darcs diff"

David Roundy droundy at abridgegame.org
Mon Mar 7 04:36:21 PST 2005


On Sun, Mar 06, 2005 at 01:43:16PM -0800, Kannan Goundan wrote:
> David:
> 
> There are two attachments.
> 
> stylistic-change.darcs: A patch in addition to my original two.
> 
> prune-diff.darcs: New versions of my original patches (along with a
> conflict resolution patch).  Since there were some not-really-real
> patch dependencies, I had to unrecord your "resolve conflict with
> symlink ..." patch (along with my two patches).
> 
> I'm not sure which one you prefer.  I kinda like the second one
> because I think it results in fewer dependencies, but it is also more
> complicated (and I'm also not sure if it's OK to mess with the main
> Darcs repo the same way I had to mess with mine).

Generally, if I haven't accepted a patch, I prefer the amend-recorded
variety (or unrecorded and then recorded again), but once I've accepted a
patch into either of the main darcs repositories (as was the case this
time), I don't want to unrecord it.

> BTW, I tried using "darcs record --ask-deps" when creating the first
> patch and I think it got stuck in an infinite loop.  I let it run for
> around half an hour and it didn't complete.  Without "--ask-deps",
> the record works fine.

:(  I'm afraid that --ask-deps isn't well-tested.  I'm guessing that it may
have just been trying to sort out the dependencies between *all* the
patches in darcs' history, but I'm afraid I've almost never used that
feature.  It seemed really cool at the time, and there are still neat ideas
as to how it could actually be used, but I've not really heard of anyone
actually using it...

> Another BTW: I'm not sure how Darcs detects conflicts, but would we
> get fewer of them if GHC allowed commas after the last item in an
> import/export list?  Maybe it would help to add a dummy export to the
> end of every export list to suck up the last comma-less entry.  Then
> again, the Haskell community seems to love Darcs; maybe you could use
> your star power to lobby for a syntax change :)

Actually, ghc *already* allows trailing commas in imports and exports! :) I
sometimes use them for this purpose in exports, and more often in imports,
but if everyone adds new exports to the end of the list, you'll still get
conflicts.  My usual strategy is to try to add new exports somewhere in the
middle of the list, and then as long as noone else adds exports at the same
spot, we'll have no conflicts.  Another strategy would be to alphabetize
the exports, but that would harm readability.

The makefile is alphabetized, because someone decided to reorganize it that
way, but I've tried to keep it that way since, as a trick to reduce the
probability of conflicts.
-- 
David Roundy
http://www.darcs.net




More information about the darcs-devel mailing list