[darcs-devel] Re: summary of my recent spurt of patches, and request for suggestions

2006-12-05 Thread Simon Marlow

David Roundy wrote:

On Mon, Dec 04, 2006 at 04:34:48PM +, Simon Marlow wrote:


David Roundy wrote:



I've been working hard on getting support for the new hashed inventory
format into good shape.  If you aren't familiar with the benefits of the
new format (which I've talked about with at least some of you in person),
suffice to say that I see it as a precursor to working out the new way of
dealing with conflicts.


As an interested bystander, I'd really like to hear a brief description of 
what a hashed inventory is, and what benefits it brings.  Not a 12-page 
paper, just a quick outline will do fine, I don't want to distract you from 
the hacking frenzy :)



A hashed inventory is a modification of the darcs repository format, which
essentially replaces the _darcs/inventory file (which is human-readable, if
not human-modifiable, so if you're not familiar with it, you could take a
look) with a _darcs/hashed_inventory file.  The difference is that a hash
of the contents of each patch is stored, along with the identifier of the
patch, as is currently stored.  This hash is then used as the filename in
_darcs/patches/.  This has several benefits.

At the most obvious level, we've now got some extra information for
checking the consistency of a repository (helpful if, e.g. an http proxy
modifies files in transit).

The next advantage is that by cryptographically signing the hashed
inventory, you cryptographically sign the entire contents of the repository
(unless someone cracks sha1).  This is potentially valuable to high-profile
projects, or projects that use untrusted mirrors.

Next, because the filename for patches now depends on patch contents, all
darcs commands will be atomic (except with respect to the pristine
cache--but atomic with respect to remote access), including those that
currently aren't, such as amend-record and obliterate.

With hashed inventories it will be possible to implement lazy partial
repositories, in which darcs downloads patch files as needed to do the
commands you ask, since we'll have the hash with which to verify that the
patch files haven't been commuted (and therefore are still in the proper
context for our use).

Finally, as I mentioned above, the refactoring for this change should help
with our plans for new conflict handling, which will probably require that
we break the current picture of one patch file per named patch (which
wouldn't work in the current scheme where the patch filename is determined
by the name of the patch).


Great, thanks David!

Simon


___
darcs-devel mailing list
darcs-devel@darcs.net
http://www.abridgegame.org/cgi-bin/mailman/listinfo/darcs-devel


[darcs-devel] [issue362] error with commercial sftp

2006-12-05 Thread David Roundy

New submission from David Roundy [EMAIL PROTECTED]:

- Forwarded message from [EMAIL PROTECTED] -

I have been playing around with Darcs for a few months now, but my
experimentation has been hampered by a bug which manifests as Couldn't
read patch:

 vnix$ darcs get -v mydarcs:darcs/demo
Getting the inventory...
Copying patches...
Patches copied
Repo lazily read
Repo local: False

Fail: Couldn't read patch Sun Nov 26 11:17:01 EET 2006  [EMAIL PROTECTED]
  * Initial check-in

I finally managed to track this down to different ssh versions. On the
hosts where darcs doesn't work, local administration has installed a
commercial SSH version, which doesn't support sftp -b:

 vnix$ /usr/bin/sftp -b /tmp/darcsQ5nyCR  mydarcs:
-b requires an argument greater than zero.

 vnix$ echo $?
0

I played around with wrappers and strace and found out that the above
command line is precisely the one darcs tries to run (modulo the path to
the file with sftp commands).

At a minimim, it would be useful if the error message could be a little
more revealing. Certainly it would also be useful if Darcs could check
if the command does anything useful (like it seems to do earlier; it
runs ssh -O an_invalid_command, apparently to see what happens) and
bail out with an error message if not.

For what it's worth, this particular sftp client (the product suite is
called Reflection for Secure IT; I believe it is largely compatible
with the commercial SSH2 product from SSH.com) seems to work just fine
if you use sftp -B file instead of sftp -b file. Actually, you also
have to remove the colon from after the host name.

While playing around with this, I discovered that a non-zero exit code
from sftp would make darcs fail with darcs failed:  (sftp) failed to
fetch files. so the fault really lies with the sftp implementation
which doesn't fail properly. Still, having a workaround for this would
improve the usability and credibility of Darcs.

Attached please find a script which I called sftp_darcs which I set my
DARCS_SFTP to as a workaround.

Thanks for considering this

/* era */

--
messages: 1309
nosy: EricKow, droundy, era, tommy
status: unread
title: error with commercial sftp


Darcs issue tracker [EMAIL PROTECTED]
http://bugs.darcs.net/issue362


___
darcs-devel mailing list
darcs-devel@darcs.net
http://www.abridgegame.org/cgi-bin/mailman/listinfo/darcs-devel