[darcs-users] darcs patch: Add Repository.checkPristineAgainstSlurpy. (and 14 more)

David Roundy droundy at darcs.net
Thu Sep 4 13:37:47 UTC 2008


(Comments on Eric's comments...)

On Thu, Sep 04, 2008 at 09:14:46AM +0100, Eric Y. Kow wrote:
> Refactor Cache's handling of hashed paths. No functional change.
> ----------------------------------------------------------------
> > +hashedFilePath :: CacheLoc -> HashedDir -> String -> String
> > +hashedFilePath (Cache Directory _ d) s f = d ++ "/" ++ (hashedDir s) ++ "/" ++ f
> > +hashedFilePath (Cache Repo _ r) s f =
> > +    r ++ "/"++darcsdir++"/" ++ (hashedDir s) ++ "/" ++ f
> 
> Another minor note: This could return FilePath, for documentation
> purposes :-)

I'd rather it didn't, though, for documentation purposes.  :) It
doesn't actually always return a file path, so it'd probably be better
to change its name, perhaps to hashedUrl.

> >  speculateFileUsingCache :: Cache -> HashedDir -> String -> IO ()
> >  speculateFileUsingCache c sd h = do debugMessage $ "Speculating on "++h
> 
> Did you ever figure out what it means to 'speculate' on a file?  It may
> be worth haddocking if you have the time :-)

It means to speculatively download the file, hoping it'll come in
handy later.

> Replace [DarcsFlag] with Compression in HashedIO Slurpy.
> --------------------------------------------------------
> I'm a fan of this kind of work.

I'm less so.  Constant code refactoring leads to considerable churn,
which takes time and energy, and every so often introduces bugs.  I'd
rather restrict code refactoring to code that we're already working on
for other reasons.  It also, of course, creates trouble for people
like Jason, who is trying to perform a refactor that will have a much
more tangible benefit in terms of type safety.

But this is probably partly my frustration speaking at not being able
to use my computers for three days straight.  Supposedly the power is
back up, but the computers won't be turned on until a fellow prof gets
into the office and turns them on (we haven't properly configured the
UPSs and bioses to boot up after the power comes back on for a certain
amount of time).

> Remove [DarcsFlag] use in (most of) HashedIO, HashedRepo API.
> -------------------------------------------------------------
> No shockers here.  Hopefully we can revisit this code and make it tidier
> when we have a clearer idea what are all the opts being used in Repository

I certainly do like the idea of eliminating unused input parameters to
functions.

David


More information about the darcs-users mailing list