[darcs-users] darcs patch: Add forceHashSlurped that hashes the slu... (and 1 more)

David Roundy daveroundy at gmail.com
Mon Sep 1 22:18:30 UTC 2008


On Mon, Sep 1, 2008 at 12:11 PM, Petr Rockai <me at mornfall.net> wrote:
> "David Roundy" <daveroundy at gmail.com> writes:
>>  One major advantage of this approach is that it decreases the number
>> of arguments to these functions, which should make them simpler and
>> safer to use.
>
> indeed, looking at how we deal with hashed pristine, and that there's no other
> apparent use of hashSlurped and friends, it might be a good idea to remove all
> parametrisation of that directory and probably rename the functions to make it
> apparent they only work with pristine...
>
> slurpHashedPristine, writeHashedPristine, syncHashedPristine maybe?

Sounds good so far. (writing reply as I read)...

> It seems there are also other functions that are shared between
> pristine.hashed/ and patches/, and I am inclined to propose adding something
> like:
>
> data HashedDir = HashedPristineDir | HashedPatchesDir
>
> hashedDir :: HashedDir -> String
> hashedDir HashedPristineDir = "hashed.pristine"
> hashedDir HashedPatchesDir = "patches"
>
> so that we can change "String" in signatures of those functions to HashedDir,
> which looks much more type-safe to me.

Hmmm.  I was thinking to keep the Cache-related code general so that
if we introduced some other sort of data we could easily reuse this
code, but of course it isn't at all hard to extend your scheme, and it
makes explicit the set of directories that we're interested in.  This
looks like a good refactor to me.

> That's about for proposals, I guess I'll go to have some tea now and read a
> book, then, if you feel like such changes might be worthwhile, get them to a
> patch form (the rework of "hashed repair" might take a little longer, so if not
> tonight CEST, I'd like to have patches by tomorrow evening).

They sound valuable to me.  Enjoy your tea and book!  :)  (Soon I'll
be heading home for dinner and a book.  I should have tea during the
work day, it'd make work pleasanter...)

David


More information about the darcs-users mailing list