[darcs-users] darcs patch: Hide the inefficient "darcs put" command.
Dan Pascu
dan at ag-projects.com
Sat Dec 6 15:37:43 UTC 2008
On Saturday 06 December 2008, Trent W. Buck wrote:
> Florent Becker <florent.becker at ens-lyon.org> writes:
> > Either we drop put now and forever, or we keep it and a/ try and make
> > it efficient b/ warn our users.
>
> Currently we do (b); I'd like to do (a) but until (a) happens I was
> proposing to hide or remove the current implementation. (This has been
> rejected by Eric elsewhere in the thread, because there's a lot of
> disagreement.)
>
> > By the way, UI leanness is not measured in terms of number of
> > commands/flags, but in terms of coherence. For this, having symmetric
> > pairs is much preferable to removing the least used direction.
>
> Except that for the most common case, a local branch, get is
> bi-directional, and more efficient that the currently implementation of
> put. Using darcs' repository as an example:
>
> $ time darcs get --lazy --repodir $PWD.branch1 $PWD
> Finished getting.
>
> real 0m2.206s
> user 0m1.012s
> sys 0m0.464s
>
> $ time darcs put $PWD.branch2
> Merging them 3414/7011
> Writing pristine 205/236
> Optimizing inventory 3575/7011
> Writing inventory 1/1 :
> Synchronizing pristine 203/236
> Finished applying...
> Put successful.
>
> real 4m49.517s
> user 3m23.681s
> sys 0m35.830s
I think you are comparing apples with oranges here. You issues a lazy get
which only took the pristine tree, while put took and applied all patches
IMO, it's less useful to have a lazy put (maybe it should be there for
symmetry), because the use target for put is a bit different from get.
With get you can afford to retrieve a repository in lazy mode because it
is a local copy. Put OTOH, is mostly used to setup a central repository
for syncing between multiple disconnected developers. In this case I do
not want a central repository that has none or only has a few patches.
I want a complete repository so that people can synchronize their work.
Otherwise it will try to connect to the original publisher repository to
fetch patches from, which can fail for many reasons (that computer is not
online, not authorized to connect to it, ...). With get is more likely
that you can connect again later, since you already connected once (at
least if ssh auth doesn't change). But with put you do not know that at
all since it would require a reverse connection which was never
established and may never be possible to establish it anyway.
In fact even with get it can be tricky. If a take a repo in lazy mode over
ssh, and then someone tries to pull a patch from this repo it will try to
connect to the original repo over ssh, but the getter most likely will
not have the credentials to do that.
IMO lazy mode is only useful for a personal copy that one will ever
push/pull from. The only exception is if this lazy copy is just a local
copy of a repo, so it can always take patches from the original without
any ssh involvement. But if a lazy copy is taken over ssh then it's
unusable for others to pull from it.
>
> FWIW the result also includes more files, or does less hard-linking:
>
> $ cd ..
> $ du -sch darcs darcs.branch1 darcs.branch2
> 51M darcs
> 4.5M darcs.branch1
> 5.9M darcs.branch2
> 61M total
>
> _______________________________________________
> darcs-users mailing list
> darcs-users at darcs.net
> http://lists.osuosl.org/mailman/listinfo/darcs-users
--
Dan
More information about the darcs-users
mailing list