git-annex/Types
Joey Hess 17c9ff576d Fix several bugs caused by a bad Ord instance for Remote.
A long time ago I made Remote be an instance of the Ord typeclass, with an
implementation that compared the costs of Remotes. That seemed like a good
idea at the time, as it saved typing.. But at the time I was still making
custom Read and Show instances too. I've since learned that this is *not* a
good idea, and neither is making custom Ord instances, without deep thought
about the possible sets of values in a type. Haskell typeclasses are not a
toy.

This Ord instance came around and bit me when I put Remotes into a Set,
because now remotes with the same cost appeared to be in the Set even if
they were not. Also affected putting Remotes into a Map.

Rarely does a bug go this deep. I've fixed it comprehensively, first
removing the Ord instance entirely, and fixing the places that wanted to
order remotes by cost to do it explicitly. Then adding back an Ord instance
that is much more sane. Also by checking the rest of the Ord instances in
the code base (which were all ok).

While doing that, I found lots of places that kept remotes in Maps and
Sets. All of it was probably subtly broken in one way or another before
this fix, but it would be hard to say exactly how the bugs would
manifest.
2013-03-16 17:43:42 -04:00
..
Backend.hs handle sha*sum's leading \ in checksum with certian unsual filenames 2012-12-20 17:07:10 -04:00
BranchState.hs remove unused fields 2012-12-19 23:41:54 -04:00
Command.hs whitespace fixes 2012-12-13 00:45:27 -04:00
Crypto.hs Added shared cipher mode to encryptable special remotes. 2012-04-29 14:02:43 -04:00
GitConfig.hs split cost out into its own module 2013-03-13 16:30:34 -04:00
Group.hs add --ingroup limit 2012-10-08 15:18:58 -04:00
Key.hs improve imports 2013-02-27 21:48:46 -04:00
KeySource.hs add: Improved detection of files that are modified while being added. 2013-02-14 16:54:36 -04:00
Messages.hs Display a warning when a non-existing file or directory is specified. 2012-11-25 17:54:08 -04:00
Meters.hs refactor 2012-11-18 21:50:16 -04:00
Option.hs per-command options 2012-01-05 23:11:07 -04:00
Remote.hs Fix several bugs caused by a bad Ord instance for Remote. 2013-03-16 17:43:42 -04:00
StandardGroups.hs forgot to add to sum type 2013-03-16 12:09:22 -04:00
TrustLevel.hs test 2012-12-19 23:44:08 -04:00
UUID.hs add ConfigMonitor thread 2012-10-20 16:43:35 -04:00