[darcs-users] DRAFT Proposal: Navigating the space of versions using Tree hashes

Zooko O'Whielacronx zooko at zooko.com
Tue Sep 7 12:22:08 UTC 2010

On Mon, Sep 6, 2010 at 8:08 AM, Eric Kow <kowey at darcs.net> wrote:
> Perhaps adding a bit more motivation to point #1, if I'm reading Zooko
> on the ticket correctly, a typical use case for a short secure (fast)
> version identifier is where
> 1. Alice gets an identifier from her repository
>    alice $ darcs show state --repo alice-repo
>    coffee0123456789abcdef
> 2. Alice tells Bob to get the version from the Central repo
>   (centralness not essential here, just to help imagine).
>   Email to Bob: Hey Bob, why don't you grab coffee0123456789abcdef
>   from the central repository
> 3. Bob gets the repo as identified:
>    bob $ darcs get http://example.com/central --state coffee0123456789abcdef
> 4. Now Bob and Alice know they have the same repo even though
>   they didn't directly exchange any patches.


Follow-on use case: Alice writes some code to automatically finds out
your --state hash and bake that hash into your version number.
(Currently something like this is done for mercurial by hgdistver [1]
and for git by Brian's  Warner's Python setup script [2].) So Alice
writes a tool (or contributes a patch to darcsver [3]) which does so.
Charlie uses Alice's tool for his application. Doug downloads and uses
Charlie's application.


Doug says "Hey Charlie, here is a bug report for your application."

Charlie says "Thanks. Please tell me the version number."

Doug says "It is version 2.0.2-coffee0123456789abcdef."

Charlie now knows exactly which version, from his centralized
repository, was used to build the application in which Doug found the
bug. Also note that Charlie now knows whether the application that
Doug is using *was* built from Charlie's centralized repository or
not. If the code that went into that application is not present in
Charlie's repository at all then Charlie will know that Doug is using
an application built from a different repository.

This last feature is something that a simple version number such as
"2.0.2" can't do.



[1] http://bitbucket.org/RonnyPfannschmidt/hgdistver/src
[2] http://github.com/warner/python-ecdsa/blob/4ee29a137fb5473c2b41dda519cd3883549adc36/setup.py#L34
[3] http://pypi.python.org/pypi/darcsver

More information about the darcs-users mailing list