Recent changes to this wiki:

diff --git a/doc/bugs/build_fails_on_debian_jessie.mdwn b/doc/bugs/build_fails_on_debian_jessie.mdwn
new file mode 100644
index 0000000..5dafa26
--- /dev/null
+++ b/doc/bugs/build_fails_on_debian_jessie.mdwn
@@ -0,0 +1,7 @@
+### Please describe the problem.
+
+Can't build on debian jessie using "make" - "apt-get build-dep git-annex" misses various dependencies, and disk-space-free is not actually in jessie.  I have built it with "stack", but that only produces something usable by me (links to stuff in my home dir).
+
+### Have you had any luck using git-annex before? (Sometimes we get tired of reading bug reports all day and a lil' positive end note does wonders)
+
+The stack build works very nicely, thanks.

diff --git a/doc/forum/Content_branch.mdwn b/doc/forum/Content_branch.mdwn
new file mode 100644
index 0000000..6eb268e
--- /dev/null
+++ b/doc/forum/Content_branch.mdwn
@@ -0,0 +1,5 @@
+I was not able to find a convenient way to _only_ see locally available files.
+
+Is there a command to create a branch that only contain files taht are present locally, or is there another way to get a "locally available view" ?
+
+Thanks. 

diff --git a/doc/forum/get_content_of_a_file_from_a_file.mdwn b/doc/forum/get_content_of_a_file_from_a_file.mdwn
new file mode 100644
index 0000000..3965ed4
--- /dev/null
+++ b/doc/forum/get_content_of_a_file_from_a_file.mdwn
@@ -0,0 +1,5 @@
+I have two annex repositories A and B, the connection between them is terribly slow. There is a file in B that A wants to get, but incidentally A already has an exact copy of the file outside the annex repository. Is it possible for A to retrieve the content of that annexed file from its local copy rather than from B?
+
+The only idea I could come up with is to annex the file and then unannexing it, which does not seem optimal. I would prefer to not pollute the git log with these kinds of shenanigans.
+
+Any help is greatly appreciated!

diff --git a/doc/forum/git_annex_vicfg___40__preferred_content__41___examples.mdwn b/doc/forum/git_annex_vicfg___40__preferred_content__41___examples.mdwn
new file mode 100644
index 0000000..5467651
--- /dev/null
+++ b/doc/forum/git_annex_vicfg___40__preferred_content__41___examples.mdwn
@@ -0,0 +1,37 @@
+My problem: I want to free up some disk space by doing `git annex drop FOO`, but then when I do `git annex add BAR; git annex sync --content`, FOO reappears.
+
+Looking into the man pages, I need to set up `git annex vicfg` to make `sync --content` ignore (exclude) FOO.
+
+I am overwhelmed by the configuration file and would just like to see a minimal complete example configuration file that does what I want. In the long run I probably want to use options like "groupwanted" and such, but am not sure what a "group" is exactly.
+
+Grepping for 'exclude', my config file has this already in it:
+
+```
+# Standard preferred contents
+# (Used by wanted or groupwanted expressions containing "standard")
+# (For reference only; built-in and cannot be changed!)
+# standard client = (include=* and ((exclude=*/archive/* and exclude=archive/*) or (not (copies=archive:1 or copies=smallarchive:1)))) or approxlackingcopies=1
+```
+
+but I am not sure how to go about it. For one, the comment hints that I need to use a secondary `wanted` or `groupwanted` expression to reference the `standard` keyword to actually use it, but I am just confused by all of these interlocking components.
+
+Also, I see stuff like this:
+
+```
+# Repository preferred contents
+# (Set to "standard" to use a repository's group's preferred contents)
+# (for web)
+#wanted 00000000-0000-0000-0000-000000000001 = 
+# (for bittorrent)
+#wanted 00000000-0000-0000-0000-000000000002 = 
+# (for l@k0:/dev/shm/annex)
+#wanted 56e6081b-4282-4f07-b53c-9042240cd75e = 
+# (for k0)
+#wanted a71d805d-df77-42e7-97b0-ba7686c05083 = 
+# (for l@m0:/mnt/a/annex.git [origin])
+#wanted c5c012cc-2080-481f-81bc-7f449f33490b =                                                                                                                                     
+```
+
+and am confused by these UUIDs. Where do these UUIDs come from? Am I supposed to use UUIDs?
+
+If there is a link or another doc I missed, please point me in the right direction.

added meta field for myself
diff --git a/doc/todo/__39__info_filename__39___to_provide_information_either_content_is_locally_present.mdwn b/doc/todo/__39__info_filename__39___to_provide_information_either_content_is_locally_present.mdwn
index 05737f6..590595b 100644
--- a/doc/todo/__39__info_filename__39___to_provide_information_either_content_is_locally_present.mdwn
+++ b/doc/todo/__39__info_filename__39___to_provide_information_either_content_is_locally_present.mdwn
@@ -1 +1,4 @@
 ATM in DataLad we rely on 'git annex find' to determine either files have content locally.  Even though it could be used in a batch mode, I wondered if we could may be just use 'annex info' to obtain information either a file (or a key) has content locally?  Another benefit would be is that within single command output we could determine also if a file under annex or not (instead of first doing e.g. 'info' to figure out if under annex and then 'find' again to figure out if content is present locally)
+
+
+[[!meta author=yoh]]

diff --git a/doc/todo/__39__info_filename__39___to_provide_information_either_content_is_locally_present.mdwn b/doc/todo/__39__info_filename__39___to_provide_information_either_content_is_locally_present.mdwn
new file mode 100644
index 0000000..05737f6
--- /dev/null
+++ b/doc/todo/__39__info_filename__39___to_provide_information_either_content_is_locally_present.mdwn
@@ -0,0 +1 @@
+ATM in DataLad we rely on 'git annex find' to determine either files have content locally.  Even though it could be used in a batch mode, I wondered if we could may be just use 'annex info' to obtain information either a file (or a key) has content locally?  Another benefit would be is that within single command output we could determine also if a file under annex or not (instead of first doing e.g. 'info' to figure out if under annex and then 'find' again to figure out if content is present locally)

devblog
diff --git a/doc/devblog/day_411__metadata_--batch.mdwn b/doc/devblog/day_411__metadata_--batch.mdwn
new file mode 100644
index 0000000..acd1429
--- /dev/null
+++ b/doc/devblog/day_411__metadata_--batch.mdwn
@@ -0,0 +1,4 @@
+With yesterday's JSON groundwork in place, I quickly implemented `git annex
+metadata --batch` today in only 45 LoC. The interface is nicely elegant;
+the same JSON format that git-annex metadata outputs can be fed into it
+to get, set, delete, and modify metadata.

Added metadata --batch option, which allows getting, setting, deleting, and modifying metadata for multiple files/keys.
diff --git a/Annex/MetaData.hs b/Annex/MetaData.hs
index d8d8177..6642c36 100644
--- a/Annex/MetaData.hs
+++ b/Annex/MetaData.hs
@@ -63,7 +63,7 @@ parseModMeta p = case lastMaybe f of
 	Just '+' -> AddMeta <$> mkMetaField f' <*> v
 	Just '-' -> DelMeta <$> mkMetaField f' <*> (Just <$> v)
 	Just '?' -> MaybeSetMeta <$> mkMetaField f' <*> v
-	_ -> SetMeta <$> mkMetaField f <*> v
+	_ -> SetMeta <$> mkMetaField f <*> (S.singleton <$> v)
   where
 	(f, sv) = separate (== '=') p
 	f' = beginning f
diff --git a/CHANGELOG b/CHANGELOG
index ca2a417..bccf70f 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -5,6 +5,8 @@ git-annex (6.20160726) UNRELEASED; urgency=medium
     This should be easier to parse than the old format, which mixed up
     metadata fields with other keys in the json object.
     Any consumers of the old format will need to be updated.
+  * Added metadata --batch option, which allows getting, setting, deleting,
+    and modifying metadata for multiple files/keys.
   * Added --branch option to copy, drop, fsck, get, metadata, mirror, move,
     and whereis commands. This option makes git-annex operate on files that
     are included in a specified branch (or other treeish).
diff --git a/Command/MetaData.hs b/Command/MetaData.hs
index d33372d..4233c56a 100644
--- a/Command/MetaData.hs
+++ b/Command/MetaData.hs
@@ -10,9 +10,12 @@ module Command.MetaData where
 import Command
 import Annex.MetaData
 import Logs.MetaData
+import Annex.WorkTree
 import Messages.JSON (JSONActionItem(..))
+import Types.Messages
 
 import qualified Data.Set as S
+import qualified Data.Map as M
 import qualified Data.Text as T
 import qualified Data.ByteString.Lazy.UTF8 as BU
 import Data.Time.Clock.POSIX
@@ -28,6 +31,7 @@ data MetaDataOptions = MetaDataOptions
 	{ forFiles :: CmdParams
 	, getSet :: GetSet
 	, keyOptions :: Maybe KeyOptions
+	, batchOption :: BatchMode
 	}
 
 data GetSet = Get MetaField | GetAll | Set [ModMeta]
@@ -37,6 +41,7 @@ optParser desc = MetaDataOptions
 	<$> cmdParams desc
 	<*> ((Get <$> getopt) <|> (Set <$> some modopts) <|> pure GetAll)
 	<*> optional (parseKeyOptions False)
+	<*> parseBatchOption
   where
 	getopt = option (eitherReader mkMetaField)
 		( long "get" <> short 'g' <> metavar paramField
@@ -62,15 +67,21 @@ optParser desc = MetaDataOptions
 seek :: MetaDataOptions -> CommandSeek
 seek o = do
 	now <- liftIO getPOSIXTime
-	let seeker = case getSet o of
-		Get _ -> withFilesInGit
-		GetAll -> withFilesInGit
-		Set _ -> withFilesInGitNonRecursive
-			"Not recursively setting metadata. Use --force to do that."
-	withKeyOptions (keyOptions o) False
-		(startKeys now o)
-		(seeker $ whenAnnexed $ start now o)
-		(forFiles o)
+	case batchOption o of
+		NoBatch -> do
+			let seeker = case getSet o of
+				Get _ -> withFilesInGit
+				GetAll -> withFilesInGit
+				Set _ -> withFilesInGitNonRecursive
+					"Not recursively setting metadata. Use --force to do that."
+			withKeyOptions (keyOptions o) False
+				(startKeys now o)
+				(seeker $ whenAnnexed $ start now o)
+				(forFiles o)
+		Batch -> withOutputType $ \ot -> case ot of
+			JSONOutput -> batchInput parseJSONInput $
+				commandAction . startBatch now
+			_ -> error "--batch is currently only supported in --json mode"
 
 start :: POSIXTime -> MetaDataOptions -> FilePath -> Key -> CommandStart
 start now o file k = startKeys now o k (mkActionItem afile)
@@ -128,14 +139,37 @@ instance FromJSON MetaDataFields where
 fieldsField :: T.Text
 fieldsField = T.pack "fields"
 
-parseJSONInput :: String -> Maybe (Either FilePath Key, MetaData)
+parseJSONInput :: String -> Either String (Either FilePath Key, MetaData)
 parseJSONInput i = do
-	v <- decode (BU.fromString i)
+	v <- eitherDecode (BU.fromString i)
 	let m = case itemAdded v of
 		Nothing -> emptyMetaData
 		Just (MetaDataFields m') -> m'
-	let keyfile = case (itemKey v, itemFile v) of
-		(Just k, _) -> Right k
-		(Nothing, Just f) -> Left f
-		(Nothing, Nothing) -> error "JSON input is missing either file or key"
-	return (keyfile, m)
+	case (itemKey v, itemFile v) of
+		(Just k, _) -> Right (Right k, m)
+		(Nothing, Just f) -> Right (Left f, m)
+		(Nothing, Nothing) -> Left "JSON input is missing either file or key"
+
+startBatch :: POSIXTime -> (Either FilePath Key, MetaData) -> CommandStart
+startBatch now (i, (MetaData m)) = case i of
+	Left f -> do
+		mk <- lookupFile f
+		case mk of
+			Just k -> go k (mkActionItem (Just f))
+			Nothing -> error $ "not an annexed file: " ++ f
+	Right k -> go k (mkActionItem k)
+  where
+	go k ai = do
+		showStart' "metadata" k ai
+		let o = MetaDataOptions
+			{ forFiles = []
+			, getSet = if MetaData m == emptyMetaData
+				then GetAll
+				else Set $ map mkModMeta (M.toList m)
+			, keyOptions = Nothing
+			, batchOption = NoBatch
+			}
+		next $ perform now o k
+	mkModMeta (f, s)
+		| S.null s = DelMeta f Nothing
+		| otherwise = SetMeta f s
diff --git a/Messages.hs b/Messages.hs
index 63f5b10..339823d 100644
--- a/Messages.hs
+++ b/Messages.hs
@@ -42,6 +42,7 @@ module Messages (
 	commandProgressDisabled,
 	outputMessage,
 	implicitMessage,
+	withOutputType,
 ) where
 
 import System.Log.Logger
diff --git a/Types/MetaData.hs b/Types/MetaData.hs
index a62dd7e..9e153ff 100644
--- a/Types/MetaData.hs
+++ b/Types/MetaData.hs
@@ -204,8 +204,11 @@ emptyMetaData = MetaData M.empty
 {- Can be used to set a value, or to unset it, depending on whether
  - the MetaValue has CurrentlySet or not. -}
 updateMetaData :: MetaField -> MetaValue -> MetaData -> MetaData
-updateMetaData f v (MetaData m) = MetaData $
-	M.insertWith' S.union f (S.singleton v) m
+updateMetaData f v = updateMetaData' f (S.singleton v)
+
+updateMetaData' :: MetaField -> S.Set MetaValue -> MetaData -> MetaData
+updateMetaData' f s (MetaData m) = MetaData $
+	M.insertWith' S.union f s m
 
 {- New metadata overrides old._-}
 unionMetaData :: MetaData -> MetaData -> MetaData
@@ -247,7 +250,7 @@ data ModMeta
 	| DelMeta MetaField (Maybe MetaValue)
 	-- ^ delete value of a field. With Just, only that specific value
 	-- is deleted; with Nothing, all current values are deleted.
-	| SetMeta MetaField MetaValue
+	| SetMeta MetaField (S.Set MetaValue)
 	-- ^ removes any existing values
 	| MaybeSetMeta MetaField MetaValue
 	-- ^ set when field has no existing value
@@ -262,7 +265,7 @@ modMeta _ (DelMeta f (Just oldv)) =
 	updateMetaData f (unsetMetaValue oldv) emptyMetaData
 modMeta m (DelMeta f Nothing) = MetaData $ M.singleton f $
 	S.fromList $ map unsetMetaValue $ S.toList $ currentMetaDataValues f m
-modMeta m (SetMeta f v) = updateMetaData f v $
+modMeta m (SetMeta f s) = updateMetaData' f s $
 	foldr (updateMetaData f) emptyMetaData $
 		map unsetMetaValue $ S.toList $ currentMetaDataValues f m
 modMeta m (MaybeSetMeta f v)
diff --git a/doc/git-annex-metadata.mdwn b/doc/git-annex-metadata.mdwn
index b4e7900..fde4443 100644
--- a/doc/git-annex-metadata.mdwn
+++ b/doc/git-annex-metadata.mdwn
@@ -17,6 +17,11 @@ metadata.
 
 When run without any -s or -t parameters, displays the current metadata.
 
+Each metadata field has its own "field-lastchanged" metadata, which
+contains the date the field was last changed. Unlike other metadata,
+this cannot be directly modified by this command. It is updated
+automatically.
+
 # OPTIONS
 
 * `-g field` / `--get field`
@@ -66,10 +71,27 @@ When run without any -s or -t parameters, displays the current metadata.

(Diff truncated)
update
diff --git a/doc/devblog/day_410__better_JSON_for_metadata.mdwn b/doc/devblog/day_410__better_JSON_for_metadata.mdwn
index a1270e7..44648d9 100644
--- a/doc/devblog/day_410__better_JSON_for_metadata.mdwn
+++ b/doc/devblog/day_410__better_JSON_for_metadata.mdwn
@@ -20,11 +20,9 @@ problem, get in touch.
 
 ----
 
-While making that change, I also improved the JSON outputlayer, so it can
-use Aeson. I didn't switch exclusively to using Aeson, because git-annex
-commands with JSON output often output it incrementally as they go (which
-Aeson can't really do), and are anyway not often doing the kind of
-serialization of data type that Aeson excells at.
+While making that change, I also improved the JSON output layer, so it can
+use Aeson. Update: And switched everything over to using Aeson, so
+git-annex no longer depends on two different JSON libraries.
 
 This let me use Aeson to generate the "fields" object for `metadata
 --json`. And it was also easy enough to use Aeson to parse the output of

devblog
diff --git a/doc/devblog/day_410__better_JSON_for_metadata.mdwn b/doc/devblog/day_410__better_JSON_for_metadata.mdwn
new file mode 100644
index 0000000..a1270e7
--- /dev/null
+++ b/doc/devblog/day_410__better_JSON_for_metadata.mdwn
@@ -0,0 +1,33 @@
+I've had to change the output of `git annex metadata --json`.
+The old output looked like this:
+
+	{"command":"metadata","file":"foo","key":"...","author":["bar"],...,"note":"...","success":true}
+
+That was not good, because it didn't separate the metadata fields
+from the rest of the JSON object. What if a metadata field is named
+"note" or "success"? It would collide with the other "note" and "success"
+in the JSON.
+
+So, changed this to a new format, which moves the metadata fields into
+a "fields" object:
+
+	{"command":"metadata","file":"foo","key":"...","fields":{"author":["bar"],...},"note":"...","success":true}
+
+I don't like breaking backwards compatability of JSON output, but in this
+case I could see no real alternative. I don't know if anyone
+is using `metadata --batch` anyway. If you are and this will cause a
+problem, get in touch.
+
+----
+
+While making that change, I also improved the JSON outputlayer, so it can
+use Aeson. I didn't switch exclusively to using Aeson, because git-annex
+commands with JSON output often output it incrementally as they go (which
+Aeson can't really do), and are anyway not often doing the kind of
+serialization of data type that Aeson excells at.
+
+This let me use Aeson to generate the "fields" object for `metadata
+--json`. And it was also easy enough to use Aeson to parse the output of
+that command (and some simplified forms of it).
+
+So, I've laid the groundwork for `git annex metadata --batch` today.

saner format for metadata --json
metadata --json output format has changed, adding a inner json object
named "fields" which contains only the fields and their values.
This should be easier to parse than the old format, which mixed up
metadata fields with other keys in the json object.
Any consumers of the old format will need to be updated.
This adds a dependency on unordered-containers for parsing MetaData
from JSON, but it's a free dependency; aeson pulls in that library.
diff --git a/CHANGELOG b/CHANGELOG
index 79e4dc1..45da171 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,5 +1,10 @@
-git-annex (6.20160620) UNRELEASED; urgency=medium
+git-annex (6.20160726) UNRELEASED; urgency=medium
 
+  * metadata --json output format has changed, adding a inner json object
+    named "fields" which contains only the fields and their values.
+    This should be easier to parse than the old format, which mixed up
+    metadata fields with other keys in the json object.
+    Any consumers of the old format will need to be updated.
   * Added --branch option to copy, drop, fsck, get, metadata, mirror, move,
     and whereis commands. This option makes git-annex operate on files that
     are included in a specified branch (or other treeish).
diff --git a/Command/MetaData.hs b/Command/MetaData.hs
index 3123a63..66469f2 100644
--- a/Command/MetaData.hs
+++ b/Command/MetaData.hs
@@ -1,6 +1,6 @@
 {- git-annex command
  -
- - Copyright 2014 Joey Hess <id@joeyh.name>
+ - Copyright 2014-2016 Joey Hess <id@joeyh.name>
  -
  - Licensed under the GNU GPL version 3 or higher.
  -}
@@ -10,9 +10,13 @@ module Command.MetaData where
 import Command
 import Annex.MetaData
 import Logs.MetaData
+import Messages.JSON (ParsedJSON(..))
 
 import qualified Data.Set as S
+import qualified Data.Text as T
+import qualified Data.ByteString.Lazy.UTF8 as BU
 import Data.Time.Clock.POSIX
+import Data.Aeson
 
 cmd :: Command
 cmd = withGlobalOptions ([jsonOption] ++ annexedMatchingOptions) $ 
@@ -95,10 +99,38 @@ perform now o k = case getSet o of
 
 cleanup :: Key -> CommandCleanup
 cleanup k = do
-	l <- map unwrapmeta . fromMetaData <$> getCurrentMetaData k
-	maybeShowJSON (JSONObject l)
-	showLongNote $ unlines $ concatMap showmeta l
+	m <- getCurrentMetaData k
+	let Object o = toJSON (MetaDataFields m)
+	maybeShowJSON $ AesonObject o
+	showLongNote $ unlines $ concatMap showmeta $
+		map unwrapmeta (fromMetaData m)
 	return True
   where
 	unwrapmeta (f, v) = (fromMetaField f, map fromMetaValue (S.toList v))
 	showmeta (f, vs) = map ((f ++ "=") ++) vs
+
+-- Metadata serialized to JSON in the field named "fields" of
+-- a larger object.
+newtype MetaDataFields = MetaDataFields MetaData
+	deriving (Show)
+
+instance ToJSON MetaDataFields where
+	toJSON (MetaDataFields m) = object [ (fieldsField, toJSON m) ]
+
+instance FromJSON MetaDataFields where
+	parseJSON (Object v) = do
+		f <- v .: fieldsField
+		case f of
+			Nothing -> return (MetaDataFields emptyMetaData)
+			Just v' -> MetaDataFields <$> parseJSON v'
+	parseJSON _ = fail "expected an object"
+
+fieldsField :: T.Text
+fieldsField = T.pack "fields"
+
+parseJSONInput :: String -> Maybe (Either FilePath Key, MetaData)
+parseJSONInput i = do
+	v <- decode (BU.fromString i)
+	case parsedAdded v of
+		Nothing -> return (parsedKeyfile v, emptyMetaData)
+		Just (MetaDataFields m) -> return (parsedKeyfile v, m)
diff --git a/Types/MetaData.hs b/Types/MetaData.hs
index 449548d..a62dd7e 100644
--- a/Types/MetaData.hs
+++ b/Types/MetaData.hs
@@ -44,14 +44,32 @@ import Common
 import Utility.Base64
 import Utility.QuickCheck
 
+import qualified Data.Text as T
 import qualified Data.Set as S
 import qualified Data.Map as M
+import qualified Data.HashMap.Strict as HM
 import Data.Char
 import qualified Data.CaseInsensitive as CI
+import Data.Aeson
 
 newtype MetaData = MetaData (M.Map MetaField (S.Set MetaValue))
 	deriving (Show, Eq, Ord)
 
+instance ToJSON MetaData where
+	toJSON (MetaData m) = object $ map go (M.toList m)
+	  where
+		go (MetaField f, s) = (T.pack (CI.original f), toJSON s)
+
+instance FromJSON MetaData where
+	parseJSON (Object o) = do
+		l <- HM.toList <$> parseJSON (Object o)
+		MetaData . M.fromList <$> mapM go l
+	  where
+		go (t, l) = case mkMetaField (T.unpack t) of
+			Left e -> fail e
+			Right f -> (,) <$> pure f <*> parseJSON l
+	parseJSON _ = fail "expected an object"
+
 {- A metadata value can be currently be set (True), or may have been
  - set before and we're remembering it no longer is (False). -}
 newtype CurrentlySet = CurrentlySet Bool
@@ -64,6 +82,13 @@ newtype MetaField = MetaField (CI.CI String)
 data MetaValue = MetaValue CurrentlySet String
 	deriving (Read, Show)
 
+instance ToJSON MetaValue where
+	toJSON (MetaValue _ v) = toJSON v
+
+instance FromJSON MetaValue where
+	parseJSON (String v) = return $ MetaValue (CurrentlySet True) (T.unpack v)
+	parseJSON _  = fail "expected a string"
+
 {- Metadata values compare and order the same whether currently set or not. -}
 instance Eq MetaValue where
 	MetaValue _ a == MetaValue _ b = a == b
diff --git a/debian/control b/debian/control
index f9dfec9..30c4274 100644
--- a/debian/control
+++ b/debian/control
@@ -25,6 +25,7 @@ Build-Depends:
 	libghc-uuid-dev,
 	libghc-json-dev,
 	libghc-aeson-dev,
+	libghc-unordered-containers-dev,
 	libghc-ifelse-dev,
 	libghc-bloomfilter-dev,
 	libghc-edit-distance-dev,
diff --git a/doc/git-annex-metadata.mdwn b/doc/git-annex-metadata.mdwn
index fe344ff..b4e7900 100644
--- a/doc/git-annex-metadata.mdwn
+++ b/doc/git-annex-metadata.mdwn
@@ -71,6 +71,16 @@ When run without any -s or -t parameters, displays the current metadata.
   Enable JSON output. This is intended to be parsed by programs that use
   git-annex. Each line of output is a JSON object.
 
+  The format of the JSON objects changed in git-annex version 6.20160726.
+
+  Example of the new format:
+
+	{"command":"metadata","file":"foo","key":"...","fields":{"author":["bar"],...},"note":"...","success":true}
+
+  Example of the old format, which lacks the inner fields object:
+
+	{"command":"metadata","file":"foo","key":"...","author":["bar"],...,"note":"...","success":true}
+
 * `--all`
 
   Specify instead of a file to get/set metadata on all known keys.
diff --git a/git-annex.cabal b/git-annex.cabal
index d0ee988..f9033cc 100644
--- a/git-annex.cabal
+++ b/git-annex.cabal
@@ -323,7 +323,7 @@ Executable git-annex
   Build-Depends:
    base (>= 4.5 && < 5.0),
    optparse-applicative (>= 0.11.0), 
-   containers (>= 0.5.0.0), 
+   containers (>= 0.5.0.0),
    exceptions (>= 0.6),
    QuickCheck (>= 2.1),
    stm (>= 2.3),
@@ -338,6 +338,7 @@ Executable git-annex
    time, old-locale,
    esqueleto, persistent-sqlite, persistent (<2.5), persistent-template,
    aeson,
+   unordered-containers,
    feed,
    regex-tdfa
   CC-Options: -Wall

magic wormhole seems like a nice alternative for arbitrary data sharing here
diff --git a/doc/design/assistant/telehash.mdwn b/doc/design/assistant/telehash.mdwn
index e69f09f..4e6ec67 100644
--- a/doc/design/assistant/telehash.mdwn
+++ b/doc/design/assistant/telehash.mdwn
@@ -2,7 +2,7 @@
 git-annex (assistant) repositories.
 
 Or something similar like [Snow](http://www.trustiosity.com/snow/)
-or [cjdns](https://github.com/cjdelisle/cjdns) or tor or i2p.
+or [cjdns](https://github.com/cjdelisle/cjdns) or tor or i2p or [magic wormhole](http://magic-wormhole.io/).
 
 ## telehash implementation status
 
@@ -29,6 +29,8 @@ or [cjdns](https://github.com/cjdelisle/cjdns) or tor or i2p.
   and the reliabilty of that network is not known. I notice it has only 1
   pre-seeded peer in the source tree for the DHT, and that peer was not up
   when I tried it.
+* Only provides network-layer transport, still need to implement some 
+  file transfer protocol on top.
 
 ## cjdns status
 
@@ -50,6 +52,14 @@ or [cjdns](https://github.com/cjdelisle/cjdns) or tor or i2p.
 
 ## i2p status
 
+## magic wormhole
+
+* simple file transfer protocol with out of band shared secret
+* handles NAT transversal
+* easy to use
+* doesn't require a running daemon
+* can transfer arbitrary blobs (strings, directories, files)
+
 ## implementation basics
 
 * Add a telehash.log that maps between uuid and telehash address.

Added a comment
diff --git a/doc/bugs/Packfile_does_not_match_digest__58___gcrypt_with_assistant/comment_6_88178fa312f351a7667b3b2c48335b02._comment b/doc/bugs/Packfile_does_not_match_digest__58___gcrypt_with_assistant/comment_6_88178fa312f351a7667b3b2c48335b02._comment
new file mode 100644
index 0000000..c31f234
--- /dev/null
+++ b/doc/bugs/Packfile_does_not_match_digest__58___gcrypt_with_assistant/comment_6_88178fa312f351a7667b3b2c48335b02._comment
@@ -0,0 +1,7 @@
+[[!comment format=mdwn
+ username="jgoerzen"
+ subject="comment 6"
+ date="2016-07-25T19:09:09Z"
+ content="""
+This was concerning enough to me that I wound up switching to Syncthing for this particular use case.
+"""]]

Added a comment: Same issue
diff --git a/doc/bugs/Packfile_does_not_match_digest__58___gcrypt_with_assistant/comment_5_f45d09939527be362c586ae1d470afe4._comment b/doc/bugs/Packfile_does_not_match_digest__58___gcrypt_with_assistant/comment_5_f45d09939527be362c586ae1d470afe4._comment
new file mode 100644
index 0000000..4fbbfe1
--- /dev/null
+++ b/doc/bugs/Packfile_does_not_match_digest__58___gcrypt_with_assistant/comment_5_f45d09939527be362c586ae1d470afe4._comment
@@ -0,0 +1,7 @@
+[[!comment format=mdwn
+ username="pot"
+ subject="Same issue"
+ date="2016-07-25T18:23:13Z"
+ content="""
+Anyone got any ideas on how to fix this, or move forward without starting again and trashing the gcrypt repos? Bit of a serious bug this, if it can't be repaired. I was using git-annex for backups, but finding your backups are corrupt would be a bit of a nightmare!
+"""]]

design
diff --git a/doc/todo/metadata_--batch/comment_4_c72eb16b630b200265e125ebaf7d0d36._comment b/doc/todo/metadata_--batch/comment_4_c72eb16b630b200265e125ebaf7d0d36._comment
new file mode 100644
index 0000000..4cd0f2d
--- /dev/null
+++ b/doc/todo/metadata_--batch/comment_4_c72eb16b630b200265e125ebaf7d0d36._comment
@@ -0,0 +1,36 @@
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 4"""
+ date="2016-07-25T17:39:37Z"
+ content="""
+--batch mode should be usable to get current metadata, set new
+metadata, and remove existing metadata. The non-batch metadata command has
+different syntaxes for all of these, but it would be good to have a single
+interface that handles all three in batch mode.
+
+It could read a line containing the file or key, with any metadata
+fields that should be changed:
+
+	{"file":"foo"}
+	{"file":"foo","author":["bar"]}
+	{"key":"SHA...","author":[]}
+
+And reply with *all* the metadata, in nearly the same format:
+
+	{"file":"foo","key":"SHA...","author":["bar"],lastchanged:["date"],"success":true}
+
+And that reply could in turn be edited and fed back in to change the
+metadata.
+
+----
+
+There's a DRY problem here because there's the current JSON generator code,
+and I'd have to add an Aeson parser to parse the JSON input. But, Aeson
+parsers also automatically have a matching generator, which is guaranteed
+to generate code that the parser can parse.
+
+So, it would be nice to use the Aeson JSON generator, instead of the
+current one, but that can only be done if the JSON is formatted the same,
+or close enough that nothing currently consuming `metadata --json` will
+break.
+"""]]

diff --git a/doc/bugs/gcrypt__58___WARNING__58___Remote_ID_has_changed__33__.mdwn b/doc/bugs/gcrypt__58___WARNING__58___Remote_ID_has_changed__33__.mdwn
new file mode 100644
index 0000000..556a468
--- /dev/null
+++ b/doc/bugs/gcrypt__58___WARNING__58___Remote_ID_has_changed__33__.mdwn
@@ -0,0 +1,45 @@
+### Please describe the problem.
+
+For some reason, after a while I can't sync to any remotes (removeable drives, servers, etc.)
+
+
+### What steps will reproduce the problem?
+
+git annex sync, git annex assistant doing its autosync, etc.
+
+
+### What version of git-annex are you using? On what operating system?
+
+Arch Linux, git annex 6.20160613-g1e4e6f4
+
+
+### Please provide any additional information below.
+
+[[!format sh """
+# If you can, paste a complete transcript of the problem occurring here.
+
+Typing git annex synx in a terminal gives me:
+
+commit  ok
+pull disk0_annexes_docs 
+gcrypt: Decrypting manifest
+gpg: Signature made Mon 25 Jul 2016 00:13:00 BST using RSA key ID XXXXXXXXXXXXXXX
+gpg: Good signature from "XXX <XXX@XXX.XXX>" [ultimate]
+gcrypt: WARNING:
+gcrypt: WARNING: Remote ID has changed!
+gcrypt: WARNING: from :id:lczpGq00kb1sF+cxgCNE
+gcrypt: WARNING: to   :id:2br4BOnJZkrGUsXTlQR8
+
+
+# If the problem is with the git-annex assistant, paste in .git/annex/daemon.log
+
+Not specific to assistant.
+
+
+# End of transcript or log.
+"""]]
+
+
+### Have you had any luck using git-annex before? (Sometimes we get tired of reading bug reports all day and a lil' positive end note does wonders)
+
+Yes, this worked for ages, a year or more, it's awesome! Haven't plugged the removeable drives in for a while, now when I do this happens...

cabal constraints for aws and esqueleto
closes https://github.com/joeyh/git-annex/pull/55
* git-annex.cabal: Temporarily limit to http-conduit <2.2.0
since aws 0.14.0 is not compatible with the newer version.
* git-annex.cabal: Temporarily limit to persistent <2.5
since esqueleto 2.4.3 is not compatible with the newer version.
diff --git a/CHANGELOG b/CHANGELOG
index efab17b..79e4dc1 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -3,6 +3,10 @@ git-annex (6.20160620) UNRELEASED; urgency=medium
   * Added --branch option to copy, drop, fsck, get, metadata, mirror, move,
     and whereis commands. This option makes git-annex operate on files that
     are included in a specified branch (or other treeish).
+  * git-annex.cabal: Temporarily limit to http-conduit <2.2.0
+    since aws 0.14.0 is not compatible with the newer version.
+  * git-annex.cabal: Temporarily limit to persistent <2.5
+    since esqueleto 2.4.3 is not compatible with the newer version.
 
  -- Joey Hess <id@joeyh.name>  Wed, 20 Jul 2016 12:03:15 -0400
 
diff --git a/doc/bugs/cabal_constraints_for_aws_and_esqueleto.mdwn b/doc/bugs/cabal_constraints_for_aws_and_esqueleto.mdwn
index 19daf83..4b47803 100644
--- a/doc/bugs/cabal_constraints_for_aws_and_esqueleto.mdwn
+++ b/doc/bugs/cabal_constraints_for_aws_and_esqueleto.mdwn
@@ -23,3 +23,6 @@ esqueleto 2.4.3 is incompatible with persistent 2.5
 https://github.com/prowdsponsor/esqueleto/issues/137
 https://github.com/prowdsponsor/esqueleto/pull/141
 https://github.com/prowdsponsor/esqueleto/pull/139
+
+> I assume this will be sorted out upstream, but I don't mind temporarily
+> adding the constraints. [[done]] --[[Joey]]

diff --git a/doc/bugs/cabal_constraints_for_aws_and_esqueleto.mdwn b/doc/bugs/cabal_constraints_for_aws_and_esqueleto.mdwn
new file mode 100644
index 0000000..19daf83
--- /dev/null
+++ b/doc/bugs/cabal_constraints_for_aws_and_esqueleto.mdwn
@@ -0,0 +1,25 @@
+See https://github.com/joeyh/git-annex/pull/55.
+
+### Please describe the problem.
+Solver needs some help when building with +S3 and +Webapp for Homebrew.
+
+### What steps will reproduce the problem?
+Build git-annex with GHC 8.0.1 and cabal install 1.24.0.0 with --flags=s3\ webapp
+
+### What version of git-annex are you using? On what operating system?
+6.20160719
+macOS 10.11.5
+
+### Please provide any additional information below.
+git-annex.cabal needs a couple of tweaks to reflect the following known issues:
+
+
+1.
+aws 0.14.0 is incompatible with http-conduit 2.2.0
+https://github.com/aristidb/aws/issues/206
+
+2.
+esqueleto 2.4.3 is incompatible with persistent 2.5
+https://github.com/prowdsponsor/esqueleto/issues/137
+https://github.com/prowdsponsor/esqueleto/pull/141
+https://github.com/prowdsponsor/esqueleto/pull/139

diff --git a/doc/forum/Stuck_in_a_bad_state.mdwn b/doc/forum/Stuck_in_a_bad_state.mdwn
new file mode 100644
index 0000000..9b83f26
--- /dev/null
+++ b/doc/forum/Stuck_in_a_bad_state.mdwn
@@ -0,0 +1,10 @@
+So I managed to muck stuff up pretty bad with git-annex assistant and wondering if there is a reasonable way to fix the situation without blowing everything away and starting over at this point.  So my setup is kind of laid out like this:
+I have the main annex folder in my home folder at this location: /home/<username>/annex  I have a full backup on a separate drive on the same system which is mounted to /mnt/store and there is a sym link to it in my home folder so ~/store and annex folder goes to ~/store/annex on that drive.  I sync with one other computer that comes and goes online on the local folder (I don't use a transfer repository).  Then I have an rsync.net account that is also set to full backup, I originally setup annex to use this with a self generated key that it would keep in git and it had synced and everything seemed good.  I later determined that I would rather use my own encryption key that I have backed up in a different way.  It seems the only way to change that is to delete the rsync.net remote and re-add it with the key that I want to use.  So I told it to delete it in the web-gui, it has been stuck cleaning out for about a month now.  A thread keeps dying and I keep restarting it according to the gui.  There is an error in the logs, but it looks like it is trying to connect to both the computer that isn't always up and rsync.net and dying with it:
+
+```
+[2016-07-20 09:40:26.563762726] NetWatcherFallback: Syncing with 192.168.1.118_annex, rsync.net_annex 
+ssh: connect to host 192.168.1.118 port 22: No route to host
+fatal: Could not read from remote repository.
+```
+
+So at this point, I am contemplating just copying all the files out of the annex folders and deleting all the annex stuff and configuration and all the stores and starting over basically unless there is another approach that I can kill the rsync.net annex remote, delete the stuff directly on rsync, setup a new rsync.net remote.

Update
diff --git a/doc/bugs/It__39__s_July_not_June.mdwn b/doc/bugs/It__39__s_July_not_June.mdwn
index 4c7674e..f2c9134 100644
--- a/doc/bugs/It__39__s_July_not_June.mdwn
+++ b/doc/bugs/It__39__s_July_not_June.mdwn
@@ -5,3 +5,6 @@ Off-by-one bug ...
 > I really need to automate generating those version numbers.
 > I'm not going to re-release it though, and the version number meets 
 > all other requirements other than matching the release date, so [[done]] --[[Joey]]
+
+>> JFTR, yesterday, I needed a tag to build the package against and pushed that to the
+>> main repo. If you object, feel free to nuke. -- RichiH

devblog
diff --git a/doc/devblog/day_409__--branch.mdwn b/doc/devblog/day_409__--branch.mdwn
new file mode 100644
index 0000000..6ede436
--- /dev/null
+++ b/doc/devblog/day_409__--branch.mdwn
@@ -0,0 +1,17 @@
+A common complaint is that `git annex fsck` in a bare repository complains
+about missing content of deleted files. That's because in a bare
+repository, git-annex operates on all versions of all files. Today I added
+a --branch option, so if you only want to check say, the master branch, you
+can: `git annex fsck --branch master`
+
+The new option has other uses too. Want to get all the files in the v1.0
+tag? `git annex get --branch v1.0`
+
+It might be worth revisiting the implicit --all behavior for bare
+repositories. It could instead default to --branch HEAD or something like
+that. But I'd only want to change that if there was a strong consensus in
+favor.
+
+Over 3/4th of the time spent implementing --branch was spent in
+adjusting the output of commands, to show "branch:file" is being
+operated on. How annoying.

--branch, stage 2
Show branch:file that is being operated on.
I had to make ActionItem a type and not a type class because
withKeyOptions' passed two different types of values when using the type
class, and I could not get the type checker to accept that.
diff --git a/Annex/Drop.hs b/Annex/Drop.hs
index 000e4f8..cd0168a 100644
--- a/Annex/Drop.hs
+++ b/Annex/Drop.hs
@@ -117,10 +117,10 @@ handleDropsFrom locs rs reason fromhere key afile preverified runner = do
 			)
 
 	dropl fs n = checkdrop fs n Nothing $ \numcopies ->
-		Command.Drop.startLocal afile numcopies key preverified
+		Command.Drop.startLocal afile (mkActionItem afile) numcopies key preverified
 
 	dropr fs r n  = checkdrop fs n (Just $ Remote.uuid r) $ \numcopies ->
-		Command.Drop.startRemote afile numcopies key r
+		Command.Drop.startRemote afile (mkActionItem afile) numcopies key r
 
 	slocs = S.fromList locs
 	
diff --git a/CmdLine/Seek.hs b/CmdLine/Seek.hs
index e7c52b6..5659234 100644
--- a/CmdLine/Seek.hs
+++ b/CmdLine/Seek.hs
@@ -4,7 +4,7 @@
  - the values a user passes to a command, and prepare actions operating
  - on them.
  -
- - Copyright 2010-2015 Joey Hess <id@joeyh.name>
+ - Copyright 2010-2016 Joey Hess <id@joeyh.name>
  -
  - Licensed under the GNU GPL version 3 or higher.
  -}
@@ -161,19 +161,29 @@ withNothing _ _ = error "This command takes no parameters."
  -
  - Otherwise falls back to a regular CommandSeek action on
  - whatever params were passed. -}
-withKeyOptions :: Maybe KeyOptions -> Bool -> (Key -> CommandStart) -> (CmdParams -> CommandSeek) -> CmdParams -> CommandSeek
+withKeyOptions 
+	:: Maybe KeyOptions
+	-> Bool
+	-> (Key -> ActionItem -> CommandStart)
+	-> (CmdParams -> CommandSeek)
+	-> CmdParams
+	-> CommandSeek
 withKeyOptions ko auto keyaction = withKeyOptions' ko auto mkkeyaction
   where
 	mkkeyaction = do
 		matcher <- Limit.getMatcher
-		return $ \getkeys ->
-			seekActions $ map (process matcher) <$> getkeys
-	process matcher k = ifM (matcher $ MatchingKey k)
-		( keyaction k
-		, return Nothing
-		)
-
-withKeyOptions' :: Maybe KeyOptions -> Bool -> Annex (Annex [Key] -> Annex ()) -> (CmdParams -> CommandSeek) -> CmdParams -> CommandSeek
+		return $ \k i ->
+			whenM (matcher $ MatchingKey k) $
+				commandAction $ keyaction k i
+
+withKeyOptions' 
+	:: Maybe KeyOptions
+	-> Bool
+	-> Annex (Key -> ActionItem -> Annex ())
+	-> (CmdParams
+	-> CommandSeek)
+	-> CmdParams
+	-> CommandSeek
 withKeyOptions' ko auto mkkeyaction fallbackaction params = do
 	bare <- fromRepo Git.repoIsLocalBare
 	when (auto && bare) $
@@ -194,15 +204,17 @@ withKeyOptions' ko auto mkkeyaction fallbackaction params = do
 		| auto = error "Cannot use --auto with --all or --branch or --unused or --key or --incomplete"
 		| otherwise = a
 	incompletekeys = staleKeysPrune gitAnnexTmpObjectDir True
-	runkeyaction ks = do
+	runkeyaction getks = do
 		keyaction <- mkkeyaction
-		keyaction ks
+		ks <- getks
+		forM_ ks $ \k -> keyaction k (mkActionItem k)
 	runbranchkeys bs = do
 		keyaction <- mkkeyaction
 		forM_ bs $ \b -> do
 			(l, cleanup) <- inRepo $ LsTree.lsTree b
-			forM_ l $ \i ->
-				maybe noop (\k -> keyaction (return [k]))
+			forM_ l $ \i -> do
+				let bfp = mkActionItem $ BranchFilePath b (LsTree.file i)
+				maybe noop (\k -> keyaction k bfp)
 					=<< catKey (LsTree.sha i)
 			unlessM (liftIO cleanup) $
 				error ("git ls-tree " ++ Git.fromRef b ++ " failed")
diff --git a/Command/Drop.hs b/Command/Drop.hs
index 16196f0..79797ab 100644
--- a/Command/Drop.hs
+++ b/Command/Drop.hs
@@ -63,36 +63,38 @@ seek o = allowConcurrentOutput $
 	go = whenAnnexed $ start o
 
 start :: DropOptions -> FilePath -> Key -> CommandStart
-start o file key = start' o key (Just file)
+start o file key = start' o key afile (mkActionItem afile)
+  where
+	afile = Just file
 
-start' :: DropOptions -> Key -> AssociatedFile -> CommandStart
-start' o key afile = do
+start' :: DropOptions -> Key -> AssociatedFile -> ActionItem -> CommandStart
+start' o key afile ai = do
 	from <- maybe (pure Nothing) (Just <$$> getParsed) (dropFrom o)
 	checkDropAuto (autoMode o) from afile key $ \numcopies ->
 		stopUnless (want from) $
 			case from of
-				Nothing -> startLocal afile numcopies key []
+				Nothing -> startLocal afile ai numcopies key []
 				Just remote -> do
 					u <- getUUID
 					if Remote.uuid remote == u
-						then startLocal afile numcopies key []
-						else startRemote afile numcopies key remote
+						then startLocal afile ai numcopies key []
+						else startRemote afile ai numcopies key remote
 	  where
 		want from
 			| autoMode o = wantDrop False (Remote.uuid <$> from) (Just key) afile
 			| otherwise = return True
 
-startKeys :: DropOptions -> Key -> CommandStart
+startKeys :: DropOptions -> Key -> ActionItem -> CommandStart
 startKeys o key = start' o key Nothing
 
-startLocal :: AssociatedFile -> NumCopies -> Key -> [VerifiedCopy] -> CommandStart
-startLocal afile numcopies key preverified = stopUnless (inAnnex key) $ do
-	showStart' "drop" key afile
+startLocal :: AssociatedFile -> ActionItem -> NumCopies -> Key -> [VerifiedCopy] -> CommandStart
+startLocal afile ai numcopies key preverified = stopUnless (inAnnex key) $ do
+	showStart' "drop" key ai
 	next $ performLocal key afile numcopies preverified
 
-startRemote :: AssociatedFile -> NumCopies -> Key -> Remote -> CommandStart
-startRemote afile numcopies key remote = do
-	showStart' ("drop " ++ Remote.name remote) key afile
+startRemote :: AssociatedFile -> ActionItem -> NumCopies -> Key -> Remote -> CommandStart
+startRemote afile ai numcopies key remote = do
+	showStart' ("drop " ++ Remote.name remote) key ai
 	next $ performRemote key afile numcopies remote
 
 performLocal :: Key -> AssociatedFile -> NumCopies -> [VerifiedCopy] -> CommandPerform
diff --git a/Command/DropKey.hs b/Command/DropKey.hs
index 9a9d513..42516f8 100644
--- a/Command/DropKey.hs
+++ b/Command/DropKey.hs
@@ -42,7 +42,7 @@ seek o = do
 
 start :: Key -> CommandStart
 start key = do
-	showStart' "dropkey" key key
+	showStart' "dropkey" key (mkActionItem key)
 	next $ perform key
 
 perform :: Key -> CommandPerform
diff --git a/Command/Fsck.hs b/Command/Fsck.hs
index 6bc91f0..4972be6 100644
--- a/Command/Fsck.hs
+++ b/Command/Fsck.hs
@@ -89,7 +89,7 @@ seek o = allowConcurrentOutput $ do
 	checkDeadRepo u
 	i <- prepIncremental u (incrementalOpt o)
 	withKeyOptions (keyOptions o) False
-		(\k -> startKey i k =<< getNumCopies)
+		(\k ai -> startKey i k ai =<< getNumCopies)
 		(withFilesInGit $ whenAnnexed $ start from i)
 		(fsckFiles o)
 	cleanupIncremental i
@@ -111,7 +111,7 @@ start from inc file key = do
 				Nothing -> go $ perform key file backend numcopies
 				Just r -> go $ performRemote key file backend numcopies r
   where
-	go = runFsck inc file key
+	go = runFsck inc (mkActionItem (Just file)) key
 
 perform :: Key -> FilePath -> Backend -> NumCopies -> Annex Bool
 perform key file backend numcopies = do
@@ -173,11 +173,11 @@ performRemote key file backend numcopies remote =
 		)
 	dummymeter _ = noop
 
-startKey :: Incremental -> Key -> NumCopies -> CommandStart
-startKey inc key numcopies =
+startKey :: Incremental -> Key -> ActionItem -> NumCopies -> CommandStart
+startKey inc key ai numcopies =
 	case Backend.maybeLookupBackendName (keyBackendName key) of
 		Nothing -> stop
-		Just backend -> runFsck inc (key2file key) key $
+		Just backend -> runFsck inc ai key $
 			performKey key backend numcopies
 
 performKey :: Key -> Backend -> NumCopies -> Annex Bool
@@ -504,10 +504,10 @@ badContentRemote remote localcopy key = do
 		(False, True) -> "dropped from " ++ Remote.name remote
 		(_, False) -> "failed to drop from" ++ Remote.name remote

(Diff truncated)
mention --branch
diff --git a/doc/bare_repositories.mdwn b/doc/bare_repositories.mdwn
index 975a638..f73f2f8 100644
--- a/doc/bare_repositories.mdwn
+++ b/doc/bare_repositories.mdwn
@@ -18,11 +18,13 @@ as non-bare repositories. Except for these caveats:
   branches that have been pushed to the bare repository. So use it with care..
 * Commands that need a work tree, like `git annex add` won't work in a bare
   repository, of course.
-* However, you can (with recent versions of git-annex) run `git annex copy`,
-  `git annex get`, and `git annex move` in a bare repository. These behave
-  as if the `--all` option were used, and just operate on every single
-  version of every single file that is present in the git repository
-  history.
+* However, you can run commands like `git annex copy`, `git annex get`, and
+  `git annex drop` in a bare repository. In a bare repository, these
+  behave as if the `--all` option were used, and so operate
+  on every single version of every single file that is present in the git
+  repository history. The `--branch` option can be used to make these
+  commands only operate on the files referenced by a specified branch.  
+  For example: `git annex get --branch master`
 
 ***
 
@@ -39,9 +41,12 @@ Now configure the remote and do the initial push:
     git remote add origin example.com:bare-annex.git
     git push origin master git-annex
 
-Now `git annex info` should show the configured bare remote. If it does not, you may have to pull from the remote first (older versions of `git-annex`)
+Now `git annex info` should show the configured bare remote. If it does
+not, you may have to pull from the remote first (older versions of
+`git-annex`).
 
-If you wish to configure git such that you can push/pull without arguments, set the upstream branch:
+If you wish to configure git such that you can push/pull without arguments,
+set the upstream branch:
 
     git branch master --set-upstream origin/master
 

--branch, stage 1
Added --branch option to copy, drop, fsck, get, metadata, mirror, move, and
whereis commands. This option makes git-annex operate on files that are
included in a specified branch (or other treeish).
The names of the files from the branch that are being operated on are not
displayed yet; only the keys. Displaying the filenames will need changes
to every affected command.
Also, note that --branch can be specified repeatedly. This is not really
documented, but seemed worth supporting, especially since we may later want
the ability to operate on all branches matching a refspec. However, when
operating on two branches that contain the same key, that key will be
operated on twice.
diff --git a/CHANGELOG b/CHANGELOG
index e700ecb..efab17b 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,11 @@
+git-annex (6.20160620) UNRELEASED; urgency=medium
+
+  * Added --branch option to copy, drop, fsck, get, metadata, mirror, move,
+    and whereis commands. This option makes git-annex operate on files that
+    are included in a specified branch (or other treeish).
+
+ -- Joey Hess <id@joeyh.name>  Wed, 20 Jul 2016 12:03:15 -0400
+
 git-annex (6.20160619) unstable; urgency=medium
 
   * get, drop: Add --batch and --json options.
diff --git a/CmdLine/GitAnnex/Options.hs b/CmdLine/GitAnnex/Options.hs
index 0147c21..d404b21 100644
--- a/CmdLine/GitAnnex/Options.hs
+++ b/CmdLine/GitAnnex/Options.hs
@@ -141,6 +141,7 @@ data KeyOptions
 	| WantUnusedKeys
 	| WantSpecificKey Key
 	| WantIncompleteKeys
+	| WantBranchKeys [Branch]
 
 parseKeyOptions :: Bool -> Parser KeyOptions
 parseKeyOptions allowincomplete = if allowincomplete
@@ -152,6 +153,10 @@ parseKeyOptions allowincomplete = if allowincomplete
 	else base
   where
 	base = parseAllOption
+		<|> WantBranchKeys <$> many (option (str >>= pure . Ref)
+			( long "branch" <> metavar paramRef
+			<> help "operate on files in the specified branch or treeish"
+			))
 		<|> flag' WantUnusedKeys
 			( long "unused" <> short 'U'
 			<> help "operate on files found by last run of git-annex unused"
diff --git a/CmdLine/Seek.hs b/CmdLine/Seek.hs
index 30d4759..fb30364 100644
--- a/CmdLine/Seek.hs
+++ b/CmdLine/Seek.hs
@@ -154,7 +154,7 @@ withNothing :: CommandStart -> CmdParams -> CommandSeek
 withNothing a [] = seekActions $ return [a]
 withNothing _ _ = error "This command takes no parameters."
 
-{- Handles the --all, --unused, --key, and --incomplete options,
+{- Handles the --all, --branch, --unused, --key, and --incomplete options,
  - which specify particular keys to run an action on.
  -
  - In a bare repo, --all is the default.
@@ -162,34 +162,49 @@ withNothing _ _ = error "This command takes no parameters."
  - Otherwise falls back to a regular CommandSeek action on
  - whatever params were passed. -}
 withKeyOptions :: Maybe KeyOptions -> Bool -> (Key -> CommandStart) -> (CmdParams -> CommandSeek) -> CmdParams -> CommandSeek
-withKeyOptions ko auto keyaction = withKeyOptions' ko auto $ \getkeys -> do
-	matcher <- Limit.getMatcher
-	seekActions $ map (process matcher) <$> getkeys
+withKeyOptions ko auto keyaction = withKeyOptions' ko auto mkkeyaction
   where
+	mkkeyaction = do
+		matcher <- Limit.getMatcher
+		return $ \getkeys ->
+			seekActions $ map (process matcher) <$> getkeys
 	process matcher k = ifM (matcher $ MatchingKey k)
 		( keyaction k
 		, return Nothing
 		)
 
-withKeyOptions' :: Maybe KeyOptions -> Bool -> (Annex [Key] -> Annex ()) -> (CmdParams -> CommandSeek) -> CmdParams -> CommandSeek
-withKeyOptions' ko auto keyaction fallbackaction params = do
+withKeyOptions' :: Maybe KeyOptions -> Bool -> Annex (Annex [Key] -> Annex ()) -> (CmdParams -> CommandSeek) -> CmdParams -> CommandSeek
+withKeyOptions' ko auto mkkeyaction fallbackaction params = do
 	bare <- fromRepo Git.repoIsLocalBare
 	when (auto && bare) $
 		error "Cannot use --auto in a bare repository"
 	case (null params, ko) of
 		(True, Nothing)
-			| bare -> go auto loggedKeys
+			| bare -> noauto $ runkeyaction loggedKeys
 			| otherwise -> fallbackaction params
 		(False, Nothing) -> fallbackaction params
-		(True, Just WantAllKeys) -> go auto loggedKeys
-		(True, Just WantUnusedKeys) -> go auto unusedKeys'
-		(True, Just (WantSpecificKey k)) -> go auto $ return [k]
-		(True, Just WantIncompleteKeys) -> go auto incompletekeys
-		(False, Just _) -> error "Can only specify one of file names, --all, --unused, --key, or --incomplete"
+		(True, Just WantAllKeys) -> noauto $ runkeyaction loggedKeys
+		(True, Just WantUnusedKeys) -> noauto $ runkeyaction unusedKeys'
+		(True, Just (WantSpecificKey k)) -> noauto $ runkeyaction (return [k])
+		(True, Just WantIncompleteKeys) -> noauto $ runkeyaction incompletekeys
+		(True, Just (WantBranchKeys bs)) -> noauto $ runbranchkeys bs
+		(False, Just _) -> error "Can only specify one of file names, --all, --branch, --unused, --key, or --incomplete"
   where
-	go True _ = error "Cannot use --auto with --all or --unused or --key or --incomplete"
-	go False getkeys = keyaction getkeys
+	noauto a
+		| auto = error "Cannot use --auto with --all or --branch or --unused or --key or --incomplete"
+		| otherwise = a
 	incompletekeys = staleKeysPrune gitAnnexTmpObjectDir True
+	runkeyaction ks = do
+		keyaction <- mkkeyaction
+		keyaction ks
+	runbranchkeys bs = do
+		keyaction <- mkkeyaction
+		forM_ bs $ \b -> do
+			(l, cleanup) <- inRepo $ LsTree.lsTree b
+			forM_ l $ \i ->
+				maybe noop (\k -> keyaction (return [k]))
+					=<< catKey (LsTree.sha i)
+			liftIO $ void cleanup
 
 prepFiltered :: (FilePath -> CommandStart) -> Annex [FilePath] -> Annex [CommandStart]
 prepFiltered a fs = do
@@ -200,9 +215,7 @@ prepFiltered a fs = do
 		( a f , return Nothing )
 
 seekActions :: Annex [CommandStart] -> Annex ()
-seekActions gen = do
-	as <- gen
-	mapM_ commandAction as
+seekActions gen = mapM_ commandAction =<< gen
 
 seekHelper :: ([FilePath] -> Git.Repo -> IO ([FilePath], IO Bool)) -> [FilePath] -> Annex [FilePath]
 seekHelper a params = do
diff --git a/Command/Sync.hs b/Command/Sync.hs
index c003aa4..4d8cdf2 100644
--- a/Command/Sync.hs
+++ b/Command/Sync.hs
@@ -441,7 +441,7 @@ seekSyncContent o rs = do
 		Just WantAllKeys -> Just <$> genBloomFilter (seekworktree mvar [])
 		_ -> seekworktree mvar [] (const noop) >> pure Nothing
 	withKeyOptions' (keyOptions o) False
-		(seekkeys mvar bloom) 
+		(return (seekkeys mvar bloom))
 		(const noop)
 		[]
 	finishCommandActions
diff --git a/doc/git-annex-copy.mdwn b/doc/git-annex-copy.mdwn
index 5361e97..1853334 100644
--- a/doc/git-annex-copy.mdwn
+++ b/doc/git-annex-copy.mdwn
@@ -51,6 +51,10 @@ Copies the content of files from or to another remote.
 
   This is the default behavior when running git-annex in a bare repository.
 
+* `--branch=ref`
+
+  Operate on files in the specified branch or treeish.
+
 * `--unused`
 
   Operate on files found by last run of git-annex unused.
diff --git a/doc/git-annex-drop.mdwn b/doc/git-annex-drop.mdwn
index 0bbbd78..7b052be 100644
--- a/doc/git-annex-drop.mdwn
+++ b/doc/git-annex-drop.mdwn
@@ -42,14 +42,30 @@ safe to do so.
 
   This is the default behavior when running git-annex drop in a bare repository.
 
+  Note that this bypasses checking the .gitattributes annex.numcopies
+  setting.
+
+* `--branch=ref`
+
+  Drop files in the specified branch or treeish.
+
+  Note that this bypasses checking the .gitattributes annex.numcopies
+  setting.
+
 * `--unused`
 
   Drop files found by last run of git-annex unused.
 
+  Note that this bypasses checking the .gitattributes annex.numcopies
+  setting.
+
 * `--key=keyname`
 
   Use this option to drop a specified key.
 
+  Note that this bypasses checking the .gitattributes annex.numcopies
+  setting.
+
 * file matching options
 
   The [[git-annex-matching-options]](1)
diff --git a/doc/git-annex-fsck.mdwn b/doc/git-annex-fsck.mdwn
index 4b3b510..2500ba9 100644
--- a/doc/git-annex-fsck.mdwn
+++ b/doc/git-annex-fsck.mdwn
@@ -72,6 +72,10 @@ With parameters, only the specified files are checked.
 
   This is the default behavior when running git-annex in a bare repository.
 
+* `--branch=ref`
+
+  Operate on files in the specified branch or treeish.

(Diff truncated)
Add comment
diff --git a/doc/bugs/It__39__s_July_not_June/comment_1_RichiH._comment b/doc/bugs/It__39__s_July_not_June/comment_1_RichiH._comment
new file mode 100644
index 0000000..98d9b44
--- /dev/null
+++ b/doc/bugs/It__39__s_July_not_June/comment_1_RichiH._comment
@@ -0,0 +1 @@
+Ah, saw this too late. Also see 2aa0841940d309b858eed5bc156262a7d90c949b

Add comment
diff --git a/doc/devblog/day_408__release_day/comment_1_RichiH._comment b/doc/devblog/day_408__release_day/comment_1_RichiH._comment
new file mode 100644
index 0000000..36f8272
--- /dev/null
+++ b/doc/devblog/day_408__release_day/comment_1_RichiH._comment
@@ -0,0 +1,3 @@
+You typo'ed the tag and the release date in debian/changelog: 6.20160619 instead of 6.20160719
+
+I will release 6.20160719-1 in Debian on the assumption that you will fix that tag :)

close
diff --git a/doc/bugs/It__39__s_July_not_June.mdwn b/doc/bugs/It__39__s_July_not_June.mdwn
index 886af46..4c7674e 100644
--- a/doc/bugs/It__39__s_July_not_June.mdwn
+++ b/doc/bugs/It__39__s_July_not_June.mdwn
@@ -1,3 +1,7 @@
 The new tag created today is named 6.20160619
 
 Off-by-one bug ...
+
+> I really need to automate generating those version numbers.
+> I'm not going to re-release it though, and the version number meets 
+> all other requirements other than matching the release date, so [[done]] --[[Joey]]

diff --git a/doc/bugs/It__39__s_July_not_June.mdwn b/doc/bugs/It__39__s_July_not_June.mdwn
new file mode 100644
index 0000000..886af46
--- /dev/null
+++ b/doc/bugs/It__39__s_July_not_June.mdwn
@@ -0,0 +1,3 @@
+The new tag created today is named 6.20160619
+
+Off-by-one bug ...

devblog
diff --git a/doc/devblog/day_408__release_day.mdwn b/doc/devblog/day_408__release_day.mdwn
new file mode 100644
index 0000000..647b64e
--- /dev/null
+++ b/doc/devblog/day_408__release_day.mdwn
@@ -0,0 +1,6 @@
+First release in over a month. Before making this release, a few last
+minute fixes, including a partial workaround for the problem that
+Sqlite databases don't work on Lustre filesystems.
+
+Backlog is now down to 140 messages, and only 3 of those are from this
+month. Still higher than I like.

response
diff --git a/doc/forum/git-annex__58___getUserEntryForID__58___does_not_exist___40__no_such_user__41___/comment_3_3a9e1cb8f36a44fd1917b5fc191776a3._comment b/doc/forum/git-annex__58___getUserEntryForID__58___does_not_exist___40__no_such_user__41___/comment_3_3a9e1cb8f36a44fd1917b5fc191776a3._comment
new file mode 100644
index 0000000..7071886
--- /dev/null
+++ b/doc/forum/git-annex__58___getUserEntryForID__58___does_not_exist___40__no_such_user__41___/comment_3_3a9e1cb8f36a44fd1917b5fc191776a3._comment
@@ -0,0 +1,10 @@
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 3"""
+ date="2016-07-19T19:09:07Z"
+ content="""
+The June 13th release of git-annex included the fix for this problem.
+
+The Windows autobuild is linked to from
+<http://git-annex.branchable.com/install/Windows/>
+"""]]

response
diff --git a/doc/forum/__96__git_annex_copy__96____44___estimate_how_much_data_to_copy/comment_1_785e4fe097ef2a2d51d84146fc91b2ca._comment b/doc/forum/__96__git_annex_copy__96____44___estimate_how_much_data_to_copy/comment_1_785e4fe097ef2a2d51d84146fc91b2ca._comment
new file mode 100644
index 0000000..93a391e
--- /dev/null
+++ b/doc/forum/__96__git_annex_copy__96____44___estimate_how_much_data_to_copy/comment_1_785e4fe097ef2a2d51d84146fc91b2ca._comment
@@ -0,0 +1,19 @@
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 1"""
+ date="2016-07-19T19:05:16Z"
+ content="""
+Using `git annex info .` in combination with the
+[[git-annex-matching-options]] is a good way to do such queries.
+
+The "size of annexed files in working tree" line gives the total size of
+the files that match that query.
+
+If you're copying files to a remote, run something like:
+
+	git annex info . --not --in $remote
+
+And if you're getting files, run something like:
+
+	git annex info . --not --in here
+"""]]

followup; open bug
diff --git a/doc/bugs/indeterminite_preferred_content_state_for_duplicated_file.mdwn b/doc/bugs/indeterminite_preferred_content_state_for_duplicated_file.mdwn
new file mode 100644
index 0000000..4f516a6
--- /dev/null
+++ b/doc/bugs/indeterminite_preferred_content_state_for_duplicated_file.mdwn
@@ -0,0 +1,15 @@
+Consider if file `foo` uses key K, and file `archive/bar` uses the same key K.
+Using standard client preferred content settings, `git annex drop --auto`
+will want to drop `archive/bar`, but `git annex get --auto` will want to get
+`foo`. `git annex sync --content` will do both operations, getting and then
+dropping the key. Running these commands repeatedly churns unncessarily.
+
+Fixing this needs a map from key to files using it. Then, when checking
+preferred content of `archive/bar`, it can see that `foo` also uses the
+key. Since `foo` is wanted, it should not drop the key, even though
+`archive/bar` is not wanted.
+
+Such a map exists, in the keys database, but only in v6 mode repositories.
+So, this seems solvable in v6 repositories, but not in v5.
+Also, the associated files map may not be accurate at all times, so that's
+a wrinkle to using it for this. --[[Joey]]
diff --git a/doc/design/caching_database.mdwn b/doc/design/caching_database.mdwn
index fe5d565..87efd98 100644
--- a/doc/design/caching_database.mdwn
+++ b/doc/design/caching_database.mdwn
@@ -3,6 +3,7 @@
 * [[bugs/incremental_fsck_should_not_use_sticky_bit]]
 * [[todo/wishlist:_pack_metadata_in_direct_mode]]
 * [[todo/cache_key_info]]
+* [[bugs/indeterminite_preferred_content_state_for_duplicated_file]]
 
 What do all these have in common? They could all be improved by
 using some kind of database to locally store the information in an
@@ -29,9 +30,11 @@ Store in the database the Ref of the branch that was used to construct it.
 2. Make sure that builds on all platforms, and works reliably. **done**
 3. Use sqlite db for associated files cache. **done** (only for v6 unlocked
    files)
-4. Also, use associated files db to construct views.
-5. Use sqlite db for metadata cache.
-6. Use sqlite db for list of keys present in local annex.
+4. Use associated files db when dropping files, to fix
+   [[bugs/indeterminite_preferred_content_state_for_duplicated_file]]
+5. Also, use associated files db to construct views.
+6. Use sqlite db for metadata cache.
+7. Use sqlite db for list of keys present in local annex.
 
 ## sqlite or not?
 
diff --git a/doc/forum/File_downloaded_again_and_again/comment_1_666b907935d467d5d7c0e57831d76631._comment b/doc/forum/File_downloaded_again_and_again/comment_1_666b907935d467d5d7c0e57831d76631._comment
new file mode 100644
index 0000000..f4beaf5
--- /dev/null
+++ b/doc/forum/File_downloaded_again_and_again/comment_1_666b907935d467d5d7c0e57831d76631._comment
@@ -0,0 +1,28 @@
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 1"""
+ date="2016-07-19T18:53:04Z"
+ content="""
+Notice that the file it gets is empty, and the file it drops also appears
+to be an empty file, at least based on its filename. So, there is a single
+key used for both empty files.
+
+(There's also the two .aux files, which probably also have the same 8 byte
+content.)
+
+Your preferred content settings make one of the pair of files be wanted,
+and the other one not be wanted. In this situation, `get --auto` will get
+the key used for both files, and `drop --auto` will drop it. `sync
+--content` does both things, so repeatedly gets and then drops the key.
+
+One way to deal with this is to delete one of the copies of the file.
+Then it won't be in this mixed up state. But you may not want to do that.
+
+Another way to deal with it is to unlock one of the files, and add it back
+using `git annex add --backend=WORM $file`. This will make git-annex
+allocate a new key, only for that copy of the file.
+
+I do think this is a bug in git-annex, but not one that can immediately be
+fixed. I've opened a bug report at
+[[bugs/indeterminite_preferred_content_state_for_duplicated_file]].
+"""]]

add news item for git-annex 6.20160619
diff --git a/doc/news/version_6.20160419.mdwn b/doc/news/version_6.20160419.mdwn
deleted file mode 100644
index 8979d82..0000000
--- a/doc/news/version_6.20160419.mdwn
+++ /dev/null
@@ -1,29 +0,0 @@
-git-annex 6.20160419 released with [[!toggle text="these changes"]]
-[[!toggleable text="""
-   * Fix bug that prevented resuming of uploads to encrypted special remotes
-     that used chunking.
-   * That bug could also expose the names of keys to such remotes when
-     attempting to resume an upload, so it is a minor security issue.
-   * Fix duplicate progress meter display when downloading from a git remote
-     over http with -J.
-   * reinject: When src file's content cannot be verified, leave it alone,
-     instead of deleting it.
-   * reinject: Added new mode which can reinject known files into the annex.
-     For example: git-annex reinject --known /mnt/backup/*
-   * calckey: New plumbing command, calculates the key that would be used
-     to refer to a file.
-   * Fix bug that prevented annex.sshcaching=false configuration from taking
-     effect when on a crippled filesystem. Thanks, divergentdave.
-   * git 2.9.0 is going to prevent git merge from merging in unrelated
-     branches. Since the webapp's pairing etc features often combine
-     together repositories with unrelated histories, work around
-     this behavior change when the assistant merges, by passing
-     --allow-unrelated-histories. Note though that this is not done
-     for git annex sync's merges, so it will follow git's default or
-     configured behavior.
-   * When git-annex is used with a git version older than 2.2.0, disable
-     support for adjusted branches, since GIT\_COMMON\_DIR is needed to update
-     them and was first added in that version of git.
-   * Avoid setting LOCPATH in linux standalone builds that are built with
-     a ghc that has been fixed to not hang when it cannot find locale files.
-   * Isolate test suite from global git config settings."""]]
\ No newline at end of file
diff --git a/doc/news/version_6.20160619.mdwn b/doc/news/version_6.20160619.mdwn
new file mode 100644
index 0000000..803ff62
--- /dev/null
+++ b/doc/news/version_6.20160619.mdwn
@@ -0,0 +1,32 @@
+git-annex 6.20160619 released with [[!toggle text="these changes"]]
+[[!toggleable text="""
+   * get, drop: Add --batch and --json options.
+   * testremote: Fix crash when testing a freshly made external special remote.
+   * Remove unnecessary rpaths in the git-annex binary, but only when
+     it's built using make, not cabal.
+     This speeds up git-annex startup time by around 50%.
+   * Speed up startup time by caching the refs that have been merged into
+     the git-annex branch.
+     This can speed up git-annex commands by as much as a second,
+     depending on the number of remotes.
+   * fsck: Fix a reversion in direct mode fsck of a file that is
+     present when the location log thinks it is not. Reversion introduced
+     in version 5.20151208.
+   * uninit: Fix crash due to trying to write to deleted keys db.
+     Reversion introduced by v6 mode support, affects v5 too.
+   * Fix a similar crash when the webapp is used to delete a repository.
+   * Support checking presence of content at a http url that redirects to
+     a ftp url.
+   * log: Added --all option.
+   * New url for git-remote-gcrypt, now maintained by spwhitton.
+   * webapp: Don't allow deleting a remote that has syncing disabled,
+     as such a deletion will never finish.
+     Thanks, Farhan Kathawala.
+   * webapp: Escape unusual characters in ssh hostnames when generating
+     mangled hostnames. This allows IPv6 addresses to be used on filesystems
+     not supporting : in filenames.
+   * Avoid any access to keys database in v5 mode repositories, which
+     are not supposed to use that database.
+   * Remove the EKG build flag, since Gentoo for some reason decided to
+     enable this flag, depsite it not being intended for production use and
+     so disabled by default."""]]
\ No newline at end of file

comment
diff --git a/doc/forum/Fsck_by_refs_or_keys__63__/comment_3_b00a9522bb6dd91fed5d1c790153a230._comment b/doc/forum/Fsck_by_refs_or_keys__63__/comment_3_b00a9522bb6dd91fed5d1c790153a230._comment
new file mode 100644
index 0000000..b2ee98f
--- /dev/null
+++ b/doc/forum/Fsck_by_refs_or_keys__63__/comment_3_b00a9522bb6dd91fed5d1c790153a230._comment
@@ -0,0 +1,9 @@
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 3"""
+ date="2016-07-19T17:01:03Z"
+ content="""
+It would be possible to add something like `git annex fsck --branch foo `
+which would operate on all files in the specified branch. I've opened
+[[todo/operate_on_branch_contents]] requesting that.
+"""]]

update instructions to work around https://github.com/commercialhaskell/stack/issues/2371
Also don't recommend using cabal unpack to get the source, since the git
clone has a more extensive source tree.
diff --git a/doc/install/fromsource.mdwn b/doc/install/fromsource.mdwn
index cfc58c4..c463210 100644
--- a/doc/install/fromsource.mdwn
+++ b/doc/install/fromsource.mdwn
@@ -14,14 +14,10 @@ In Debian, this is as simple as:
 
 ## downloading the source code
 
-The easiest way is using git; see [[download]] or just:
+The easiest way is using git; see [[download]] or just run:
 
 	git clone git://git-annex.branchable.com/ git-annex
 
-Or, you can use cabal to get the source code:
-
-	cabal update; cabal unpack git-annex
-
 ## building from source on Debian
 
 This is the method used by git-annex's author, and so it's the one most
@@ -44,20 +40,24 @@ It will be part of the Haskell Platform soon. On Debian unstable/testing:
 
 	sudo apt-get install haskell-stack zlib1g-dev libtinfo-dev
 
-Use stack to install all dependencies and git-annex:
+Get the git-annex source code, and inside the source tree run:
 
 	stack setup
-	stack install git-annex
+	stack install
 
 Move git-annex into some directory that is in your PATH:
 
 	mv ~/.local/bin/git-annex ~/bin # or /usr/local/bin/ or whatever
 
+(Why not run `stack install git-annex`? Because that causes stack to 
+[ignore git-annex's stack.yaml file](https://github.com/commercialhaskell/stack/issues/2371),
+yielding a less reliable build.)
+
 Note that this build produces a git-annex without the build flags
 XMPP, DBUS, and MagicMime.
 These optional features require installing additional C libraries.
 To try to build with these features 
-enabled, pass extra parameters when running stack: 
+enabled, pass extra parameters when running stack install: 
 `--flag git-annex:XMPP --flag git-annex:DBUS --flag git-annex:MagicMime`
 
 ## minimal build from source with cabal
@@ -71,7 +71,7 @@ Be warned that this involves building a lot of Haskell libraries from
 source, and so it has a lot of moving parts, and it's not uncommon for it
 to be broken from time to time.
 
-Inside the source tree, run:
+Get the git-annex source code, and inside the source tree, run:
 
 	cabal install -j -f"-assistant -webapp -webdav -pairing -xmpp -dns -dbus -magicmime" --only-dependencies
 	cabal configure -f"-assistant -webapp -webdav -pairing -xmpp -dns -dbus -magicmime"

further thoughts
diff --git a/doc/todo/operate_on_branch_contents.mdwn b/doc/todo/operate_on_branch_contents.mdwn
index ea715a0..f3ad942 100644
--- a/doc/todo/operate_on_branch_contents.mdwn
+++ b/doc/todo/operate_on_branch_contents.mdwn
@@ -7,4 +7,18 @@ For example, this would be useful in bare repos to fsck only the master
 branch, and not all versions of all keys.
 
 It might be worth allowing a full refspec, so that eg `refs/remotes/*/master`
-or `refs/tags/*` can be operated on.
+or `refs/tags/*` can be operated on. --[[Joey]]
+
+> This should be pretty easy to implement, using `git ls-tree`
+> to enumerate the contents of the ref.
+> 
+> The wrinkle is that for --all, the name of each key is shown as it's
+> operated on. But in this case, we want to instead display something like
+> "ref:filename".
+> 
+> So, every command that supports --branch (which probably
+> should be all the ones currently supporting --all) will need to be
+> modified, to be provided some new data type that is not FilePath to a
+> work tree file, but something to display while operating on an item.
+> 
+> Not a hard change to make, but an extensive one. --[[Joey]]

todo
diff --git a/doc/todo/operate_on_branch_contents.mdwn b/doc/todo/operate_on_branch_contents.mdwn
new file mode 100644
index 0000000..ea715a0
--- /dev/null
+++ b/doc/todo/operate_on_branch_contents.mdwn
@@ -0,0 +1,10 @@
+Currently, commands can operate on specific files in the working tree,
+or on all known keys, or on a specific key. It would be useful to have
+something like `--branch foo` which would operate on the files present in
+the specified branch.
+
+For example, this would be useful in bare repos to fsck only the master
+branch, and not all versions of all keys.
+
+It might be worth allowing a full refspec, so that eg `refs/remotes/*/master`
+or `refs/tags/*` can be operated on.

comment
diff --git a/doc/forum/copy_--auto_copies_already_synced_files/comment_2_3cfd11d8199a4d5e442d207a1edb38e0._comment b/doc/forum/copy_--auto_copies_already_synced_files/comment_2_3cfd11d8199a4d5e442d207a1edb38e0._comment
new file mode 100644
index 0000000..5fe0b21
--- /dev/null
+++ b/doc/forum/copy_--auto_copies_already_synced_files/comment_2_3cfd11d8199a4d5e442d207a1edb38e0._comment
@@ -0,0 +1,12 @@
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 2"""
+ date="2016-07-19T16:57:59Z"
+ content="""
+Right, it's checking if the file content is still present on the remote.
+Since that can take a while, or even lead to a ssh password prompt etc,
+it prints out the name of each file as it checks it. 
+
+--fast avoids that check, which is fine. I have gone back and forth on
+making --fast the default in this sitation.
+"""]]

Avoid any access to keys database in v5 mode repositories, which are not supposed to use that database.
diff --git a/Annex/Version.hs b/Annex/Version.hs
index cb637e1..af94878 100644
--- a/Annex/Version.hs
+++ b/Annex/Version.hs
@@ -55,6 +55,9 @@ versionSupportsUnlockedPointers = go <$> getVersion
 versionSupportsAdjustedBranch :: Annex Bool
 versionSupportsAdjustedBranch = versionSupportsUnlockedPointers
 
+versionUsesKeysDatabase :: Annex Bool
+versionUsesKeysDatabase = versionSupportsUnlockedPointers
+
 setVersion :: Version -> Annex ()
 setVersion = setConfig versionField
 
diff --git a/CHANGELOG b/CHANGELOG
index 9652378..72fcf02 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -28,6 +28,8 @@ git-annex (6.20160614) UNRELEASED; urgency=medium
   * webapp: Escape unusual characters in ssh hostnames when generating
     mangled hostnames. This allows IPv6 addresses to be used on filesystems
     not supporting : in filenames.
+  * Avoid any access to keys database in v5 mode repositories, which 
+    are not supposed to use that database.
 
  -- Joey Hess <id@joeyh.name>  Mon, 13 Jun 2016 21:52:24 -0400
 
diff --git a/Database/Keys.hs b/Database/Keys.hs
index 7785401..73c9a5b 100644
--- a/Database/Keys.hs
+++ b/Database/Keys.hs
@@ -27,6 +27,7 @@ import Database.Keys.Handle
 import qualified Database.Queue as H
 import Annex.Locations
 import Annex.Common hiding (delete)
+import Annex.Version (versionUsesKeysDatabase)
 import qualified Annex
 import Annex.Perms
 import Annex.LockFile
@@ -53,9 +54,12 @@ import Database.Esqueleto hiding (Key)
  - Any queued writes will be flushed before the read.
  -}
 runReader :: Monoid v => (SQL.ReadHandle -> Annex v) -> Annex v
-runReader a = do
-	h <- getDbHandle
-	withDbState h go
+runReader a = ifM versionUsesKeysDatabase
+	( do
+		h <- getDbHandle
+		withDbState h go
+	, return mempty
+	)
   where
 	go DbUnavailable = return (mempty, DbUnavailable)
 	go st@(DbOpen qh) = do
@@ -77,7 +81,7 @@ runReaderIO a = runReader (liftIO . a)
  -
  - The database is created if it doesn't exist yet. -}
 runWriter :: (SQL.WriteHandle -> Annex ()) -> Annex ()
-runWriter a = do
+runWriter a = whenM versionUsesKeysDatabase $ do
 	h <- getDbHandle
 	withDbState h go
   where
@@ -146,7 +150,8 @@ openDb createdb _ = catchPermissionDenied permerr $ withExclusiveLock gitAnnexKe
  - data to it.
  -}
 closeDb :: Annex ()
-closeDb = liftIO . closeDbHandle =<< getDbHandle
+closeDb = whenM versionUsesKeysDatabase $
+	liftIO . closeDbHandle =<< getDbHandle
 
 addAssociatedFile :: Key -> TopFilePath -> Annex ()
 addAssociatedFile k f = runWriterIO $ SQL.addAssociatedFile (toIKey k) f
diff --git a/doc/bugs/drop_blows_on_lustre__58___SQLite3_returned_ErrorIO/comment_1_49e8920ad09ae71874686f50f566b77c._comment b/doc/bugs/drop_blows_on_lustre__58___SQLite3_returned_ErrorIO/comment_1_49e8920ad09ae71874686f50f566b77c._comment
new file mode 100644
index 0000000..a9734a4
--- /dev/null
+++ b/doc/bugs/drop_blows_on_lustre__58___SQLite3_returned_ErrorIO/comment_1_49e8920ad09ae71874686f50f566b77c._comment
@@ -0,0 +1,32 @@
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 1"""
+ date="2016-07-19T15:38:21Z"
+ content="""
+The v6 changes added a sqlite database. Some code will try to query or
+write that database even in v5 mode, although it's meant to give up if the
+database is not available.
+
+So, the easy fix, at least for the drop problem, is to avoid using the keys
+database at all in v5 mode. I've made this change and it will probably fix
+the case you reported.
+
+But, that won't help with v6 repos which need to use that sqlite database.
+And, incremental fsck uses its own sqlite database too. And,
+[[design/caching_database]] plans are to use sqlite databases more broadly
+in the future.
+
+I'm sure that it's not a good idea for git-annex to catch "disk IO error"
+exceptions from the database layer. So, it seems that most any other fix than
+avoiding using the database would need to be made in sqlite or in lustre,
+which it seems don't get along. At a guess, sqlite is trying to use some
+POSIX filesystem functionality, likely related to locking, that lustre does
+not support.
+
+Hmm, what could be done to hack in support for lustre is to 
+move the sqlite databases to a different filesystem. But, accessing the
+same repo from different hosts which have different sqlite databases would
+lead to inconsistent and buggy behavior. And repo setup would need to
+decide where to put the sqlite databases and manually configure that
+location. So this would be very much a caveat empror configuration.
+"""]]

webapp: Escape unusual characters in ssh hostnames when generating mangled hostnames. This allows IPv6 addresses to be used on filesystems not supporting : in filenames.
diff --git a/Assistant/Ssh.hs b/Assistant/Ssh.hs
index fb82586..66ed542 100644
--- a/Assistant/Ssh.hs
+++ b/Assistant/Ssh.hs
@@ -341,15 +341,31 @@ setSshConfig sshdata config = do
 {- This hostname is specific to a given repository on the ssh host,
  - so it is based on the real hostname, the username, and the directory.
  -
- - The mangled hostname has the form "git-annex-realhostname-username-port_dir".
- - The only use of "-" is to separate the parts shown; this is necessary
- - to allow unMangleSshHostName to work. Any unusual characters in the
- - username or directory are url encoded, except using "." rather than "%"
+ - The mangled hostname has the form:
+ - "git-annex-realhostname-username_port_dir"
+ - Note that "-" is only used in the realhostname and as a separator;
+ - this is necessary to allow unMangleSshHostName to work.
+ -
+ - Unusual characters are url encoded, but using "." rather than "%"
  - (the latter has special meaning to ssh).
+ -
+ - In the username and directory, unusual characters are any
+ - non-alphanumerics, other than "_"
+ -
+ - The real hostname is not normally encoded at all. This is done for
+ - backwards compatability and to avoid unnecessary ugliness in the
+ - filename. However, when it contains special characters
+ - (notably ":" which cannot be used on some filesystems), it is url
+ - encoded. To indicate it was encoded, the mangled hostname
+ - has the form
+ - "git-annex-.encodedhostname-username_port_dir"
  -}
 mangleSshHostName :: SshData -> String
-mangleSshHostName sshdata = "git-annex-" ++ T.unpack (sshHostName sshdata)
-	++ "-" ++ escape extra
+mangleSshHostName sshdata = intercalate "-" 
+	[ "git-annex"
+	, escapehostname (T.unpack (sshHostName sshdata))
+	, escape extra
+	]
   where
 	extra = intercalate "_" $ map T.unpack $ catMaybes
 		[ sshUserName sshdata
@@ -361,12 +377,18 @@ mangleSshHostName sshdata = "git-annex-" ++ T.unpack (sshHostName sshdata)
 		| c == '_' = True
 		| otherwise = False
 	escape s = replace "%" "." $ escapeURIString safe s
+	escapehostname s
+		| all (\c -> c == '.' || safe c) s = s
+		| otherwise = '.' : escape s
 
 {- Extracts the real hostname from a mangled ssh hostname. -}
 unMangleSshHostName :: String -> String
 unMangleSshHostName h = case split "-" h of
-	("git":"annex":rest) -> intercalate "-" (beginning rest)
+	("git":"annex":rest) -> unescape (intercalate "-" (beginning rest))
 	_ -> h
+  where
+	unescape ('.':s) = unEscapeString (replace "." "%" s)
+	unescape s = s
 
 {- Does ssh have known_hosts data for a hostname? -}
 knownHost :: Text -> IO Bool
diff --git a/CHANGELOG b/CHANGELOG
index 35a3a2d..9652378 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -25,6 +25,9 @@ git-annex (6.20160614) UNRELEASED; urgency=medium
   * Support checking presence of content at a http url that redirects to
     a ftp url.
   * log: Added --all option.
+  * webapp: Escape unusual characters in ssh hostnames when generating
+    mangled hostnames. This allows IPv6 addresses to be used on filesystems
+    not supporting : in filenames.
 
  -- Joey Hess <id@joeyh.name>  Mon, 13 Jun 2016 21:52:24 -0400
 
diff --git a/doc/bugs/IPv6_literal_ssh_servers_break_git_annex_webapp.mdwn b/doc/bugs/IPv6_literal_ssh_servers_break_git_annex_webapp.mdwn
index f7ab78d..ae7809c 100644
--- a/doc/bugs/IPv6_literal_ssh_servers_break_git_annex_webapp.mdwn
+++ b/doc/bugs/IPv6_literal_ssh_servers_break_git_annex_webapp.mdwn
@@ -60,4 +60,5 @@ The key's randomart image is:
 
 Yeah, it works great on my Linux machines. I'm just getting started with the web app, though; I'm trying to set up limited-access key-based SSH, and the web app seems to be also trying to do that...
 
-
+> Fixed by escaping the hostname when it contains any unusual characters.
+> [[done]] --[[Joey]]

comment
diff --git a/doc/todo/wishlist__58___use_cp_--reflink__61__auto_for_git-annex-__123__copy__44__get__125__.mdwn b/doc/todo/wishlist__58___use_cp_--reflink__61__auto_for_git-annex-__123__copy__44__get__125__.mdwn
index 7abb689..425948e 100644
--- a/doc/todo/wishlist__58___use_cp_--reflink__61__auto_for_git-annex-__123__copy__44__get__125__.mdwn
+++ b/doc/todo/wishlist__58___use_cp_--reflink__61__auto_for_git-annex-__123__copy__44__get__125__.mdwn
@@ -1,3 +1,5 @@
 I believe cloning a repository on the same filesystem already makes use of cp --reflink=auto, but it appears that git-annex-{get,copy} use rsync even when both repositories involved in the copy/get are on the same filesystem.
 
 Would it be possible for git-annex-get and git-annex-copy to use cp --reflink=auto when the source and destination repositories are on the same filesystem?
+
+[[!meta title="allow remotes to do their own, smarter diskreserve checking"]]
diff --git a/doc/todo/wishlist__58___use_cp_--reflink__61__auto_for_git-annex-__123__copy__44__get__125__/comment_3_942c2decd6dda0730e2efe4ed6e6cd16._comment b/doc/todo/wishlist__58___use_cp_--reflink__61__auto_for_git-annex-__123__copy__44__get__125__/comment_3_942c2decd6dda0730e2efe4ed6e6cd16._comment
new file mode 100644
index 0000000..92766fc
--- /dev/null
+++ b/doc/todo/wishlist__58___use_cp_--reflink__61__auto_for_git-annex-__123__copy__44__get__125__/comment_3_942c2decd6dda0730e2efe4ed6e6cd16._comment
@@ -0,0 +1,22 @@
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 3"""
+ date="2016-07-19T14:57:14Z"
+ content="""
+Yes, reflink is used instead of rsync when it's able to determine it's the
+same filesystem.
+
+Not checking diskreserve for reflink (and also for hard link when
+annex.hardlink is set) would be nice. But, it's a layering problem
+since currently the diskreserve check is done separately from the transfer.
+
+The same layering problem also makes downloads from encrypted special
+remotes not check if there's space for both the encrypted and de-encrypted
+file content, in cases where both files are present on disk at the same
+time.
+
+So, there would be multiple benefits to improving the api somehow so more
+smart diskreserve checks can be done. Although I'd then worry that if
+remotes were responsible for doing diskreserve checks, they might be buggy
+and forget to check. 
+"""]]

Added a comment
diff --git a/doc/todo/wishlist__58___use_cp_--reflink__61__auto_for_git-annex-__123__copy__44__get__125__/comment_2_1eb09a234616cb0df7fed9016827dd0c._comment b/doc/todo/wishlist__58___use_cp_--reflink__61__auto_for_git-annex-__123__copy__44__get__125__/comment_2_1eb09a234616cb0df7fed9016827dd0c._comment
new file mode 100644
index 0000000..1669938
--- /dev/null
+++ b/doc/todo/wishlist__58___use_cp_--reflink__61__auto_for_git-annex-__123__copy__44__get__125__/comment_2_1eb09a234616cb0df7fed9016827dd0c._comment
@@ -0,0 +1,8 @@
+[[!comment format=mdwn
+ username="jscinoz@dc383eb6c5526eeb832a38ef5e5e626cf282ee6c"
+ nickname="jscinoz"
+ subject="comment 2"
+ date="2016-07-18T06:32:53Z"
+ content="""
+I suppose one enhancement could be to ignore annex.diskreserve when content is obtained by reflink copy, but I can imagine this would be difficult to achieve, since we don't know in advance whether or not --reflink=auto will actually result in a reflink copy. I imagine you could try reflink=always first, ignoring annex.diskreserve, then if it fails, fallback to reflink=auto where annex.diskreserve is checked, but perhaps this is too much filesystem-specific logic to be appropriate in git-annex.
+"""]]

Added a comment
diff --git a/doc/todo/wishlist__58___use_cp_--reflink__61__auto_for_git-annex-__123__copy__44__get__125__/comment_1_bbbb9c4c71b8c56eaf134b794d2345c3._comment b/doc/todo/wishlist__58___use_cp_--reflink__61__auto_for_git-annex-__123__copy__44__get__125__/comment_1_bbbb9c4c71b8c56eaf134b794d2345c3._comment
new file mode 100644
index 0000000..316e45a
--- /dev/null
+++ b/doc/todo/wishlist__58___use_cp_--reflink__61__auto_for_git-annex-__123__copy__44__get__125__/comment_1_bbbb9c4c71b8c56eaf134b794d2345c3._comment
@@ -0,0 +1,8 @@
+[[!comment format=mdwn
+ username="jscinoz@dc383eb6c5526eeb832a38ef5e5e626cf282ee6c"
+ nickname="jscinoz"
+ subject="comment 1"
+ date="2016-07-18T06:17:57Z"
+ content="""
+Oh, my mistake. It appears git-annex already does this - I mistakenly had one of the repositories in a different btrfs subvolume.
+"""]]

diff --git a/doc/todo/wishlist__58___use_cp_--reflink__61__auto_for_git-annex-__123__copy__44__get__125__.mdwn b/doc/todo/wishlist__58___use_cp_--reflink__61__auto_for_git-annex-__123__copy__44__get__125__.mdwn
new file mode 100644
index 0000000..7abb689
--- /dev/null
+++ b/doc/todo/wishlist__58___use_cp_--reflink__61__auto_for_git-annex-__123__copy__44__get__125__.mdwn
@@ -0,0 +1,3 @@
+I believe cloning a repository on the same filesystem already makes use of cp --reflink=auto, but it appears that git-annex-{get,copy} use rsync even when both repositories involved in the copy/get are on the same filesystem.
+
+Would it be possible for git-annex-get and git-annex-copy to use cp --reflink=auto when the source and destination repositories are on the same filesystem?

devblog
diff --git a/doc/devblog/day_407__lazy_sunday.mdwn b/doc/devblog/day_407__lazy_sunday.mdwn
new file mode 100644
index 0000000..7fe5e19
--- /dev/null
+++ b/doc/devblog/day_407__lazy_sunday.mdwn
@@ -0,0 +1,9 @@
+Noticed that in one of my git-annex repositories, git-annex was spending
+a full second at startup checking all the git-annex branches from remotes
+to see if they contained changes that needed to be merged in. So, I added a
+cache of recently merged branches to avoid that. I remember considering
+this optimisation years ago; don't know why I didn't do it then. Not every
+day that I can speed up git-annex so much!
+
+Also, made `git annex log --all` show location log changes for all keys.
+This was tricky to get right and fast.

log: Added --all option.
diff --git a/CHANGELOG b/CHANGELOG
index f80e856..35a3a2d 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -24,6 +24,7 @@ git-annex (6.20160614) UNRELEASED; urgency=medium
   * Fix a similar crash when the webapp is used to delete a repository.
   * Support checking presence of content at a http url that redirects to
     a ftp url.
+  * log: Added --all option.
 
  -- Joey Hess <id@joeyh.name>  Mon, 13 Jun 2016 21:52:24 -0400
 
diff --git a/Command/Log.hs b/Command/Log.hs
index 808b86b..3806d8f 100644
--- a/Command/Log.hs
+++ b/Command/Log.hs
@@ -1,6 +1,6 @@
 {- git-annex command
  -
- - Copyright 2012 Joey Hess <id@joeyh.name>
+ - Copyright 2012, 2016 Joey Hess <id@joeyh.name>
  -
  - Licensed under the GNU GPL version 3 or higher.
  -}
@@ -11,7 +11,6 @@ module Command.Log where
 
 import qualified Data.Set as S
 import qualified Data.Map as M
-import qualified Data.ByteString.Lazy.Char8 as L
 import Data.Char
 import Data.Time.Clock.POSIX
 import Data.Time
@@ -21,8 +20,7 @@ import System.Locale
 
 import Command
 import Logs
-import qualified Logs.Presence
-import Annex.CatFile
+import Logs.Location
 import qualified Annex.Branch
 import qualified Git
 import Git.Command
@@ -33,9 +31,13 @@ data RefChange = RefChange
 	{ changetime :: POSIXTime
 	, oldref :: Git.Ref
 	, newref :: Git.Ref
+	, changekey :: Key
 	}
+	deriving (Show)
 
-type Outputter = Bool -> POSIXTime -> [UUID] -> Annex ()
+data LogChange = Added | Removed
+
+type Outputter = LogChange -> POSIXTime -> [UUID] -> Annex ()
 
 cmd :: Command
 cmd = withGlobalOptions annexedMatchingOptions $
@@ -44,6 +46,7 @@ cmd = withGlobalOptions annexedMatchingOptions $
 
 data LogOptions = LogOptions
 	{ logFiles :: CmdParams
+	, allOption :: Bool
 	, rawDateOption :: Bool
 	, gourceOption :: Bool
 	, passthruOptions :: [CommandParam]
@@ -53,6 +56,11 @@ optParser :: CmdParamsDesc -> Parser LogOptions
 optParser desc = LogOptions
 	<$> cmdParams desc
 	<*> switch
+		( long "all"
+		<> short 'A'
+		<> help "display location log changes to all files"
+		)
+	<*> switch
 		( long "raw-date"
 		<> help "display seconds from unix epoch"
 		)
@@ -81,71 +89,106 @@ seek :: LogOptions -> CommandSeek
 seek o = do
 	m <- Remote.uuidDescriptions
 	zone <- liftIO getCurrentTimeZone
-	withFilesInGit (whenAnnexed $ start m zone o) (logFiles o)
-
-start
-	:: M.Map UUID String
-	-> TimeZone
-	-> LogOptions
-	-> FilePath
-	-> Key
-	-> CommandStart
-start m zone o file key = do
-	(ls, cleanup) <- getLog key (passthruOptions o)
-	showLog output (readLog ls)
+	let outputter = mkOutputter m zone o
+	case (logFiles o, allOption o) of
+		(fs, False) -> withFilesInGit (whenAnnexed $ start o outputter) fs
+		([], True) -> commandAction (startAll o outputter)
+		(_, True) -> error "Cannot specify both files and --all"
+
+start :: LogOptions -> (FilePath -> Outputter) -> FilePath -> Key -> CommandStart
+start o outputter file key = do
+	(changes, cleanup) <- getKeyLog key (passthruOptions o)
+	showLogIncremental (outputter file) changes
 	void $ liftIO cleanup
 	stop
-  where
-	output
-		| rawDateOption o = normalOutput lookupdescription file show
-		| gourceOption o = gourceOutput lookupdescription file
-		| otherwise = normalOutput lookupdescription file (showTimeStamp zone)
-	lookupdescription u = fromMaybe (fromUUID u) $ M.lookup u m
 
-showLog :: Outputter -> [RefChange] -> Annex ()
-showLog outputter ps = do
+startAll :: LogOptions -> (String -> Outputter) -> CommandStart
+startAll o outputter = do
+	(changes, cleanup) <- getAllLog (passthruOptions o)
+	showLog outputter changes
+	void $ liftIO cleanup
+	stop
+
+{- Displays changes made. Only works when all the RefChanges are for the
+ - same key. The method is to compare each value with the value
+ - after it in the list, which is the old version of the value.
+ -
+ - This ncessarily buffers the whole list, so does not stream.
+ - But, the number of location log changes for a single key tends to be
+ - fairly small.
+ -
+ - This minimizes the number of reads from git; each logged value is read
+ - only once.
+ -
+ - This also generates subtly better output when the git-annex branch
+ - got diverged.
+ -}
+showLogIncremental :: Outputter -> [RefChange] -> Annex ()
+showLogIncremental outputter ps = do
 	sets <- mapM (getset newref) ps
 	previous <- maybe (return genesis) (getset oldref) (lastMaybe ps)
-	sequence_ $ compareChanges outputter $ sets ++ [previous]
+	let l = sets ++ [previous]
+	let changes = map (\((t, new), (_, old)) -> (t, new, old))
+		(zip l (drop 1 l))
+	sequence_ $ compareChanges outputter changes
   where
 	genesis = (0, S.empty)
 	getset select change = do
-		s <- S.fromList <$> get (select change)
+		s <- S.fromList <$> loggedLocationsRef (select change)
 		return (changetime change, s)
-	get ref = map toUUID . Logs.Presence.getLog . L.unpack <$>
-		catObject ref
+
+{- Displays changes made. Streams, and can display changes affecting
+ - different keys, but does twice as much reading of logged values
+ - as showLogIncremental. -}
+showLog :: (String -> Outputter) -> [RefChange] -> Annex ()
+showLog outputter cs = forM_ cs $ \c -> do
+	let keyname = key2file (changekey c)
+	new <- S.fromList <$> loggedLocationsRef (newref c)
+	old <- S.fromList <$> loggedLocationsRef (oldref c)
+	sequence_ $ compareChanges (outputter keyname)
+		[(changetime c, new, old)]
+
+mkOutputter :: M.Map UUID String -> TimeZone -> LogOptions -> FilePath -> Outputter
+mkOutputter m zone o file
+	| rawDateOption o = normalOutput lookupdescription file show
+	| gourceOption o = gourceOutput lookupdescription file
+	| otherwise = normalOutput lookupdescription file (showTimeStamp zone)
+  where
+	lookupdescription u = fromMaybe (fromUUID u) $ M.lookup u m
 
 normalOutput :: (UUID -> String) -> FilePath -> (POSIXTime -> String) -> Outputter
-normalOutput lookupdescription file formattime present ts us =
+normalOutput lookupdescription file formattime logchange ts us =
 	liftIO $ mapM_ (putStrLn . format) us
   where
 	time = formattime ts
-	addel = if present then "+" else "-"
+	addel = case logchange of
+		Added -> "+"
+		Removed -> "-"
 	format u = unwords [ addel, time, file, "|", 
 		fromUUID u ++ " -- " ++ lookupdescription u ]
 
 gourceOutput :: (UUID -> String) -> FilePath -> Outputter
-gourceOutput lookupdescription file present ts us =
+gourceOutput lookupdescription file logchange ts us =
 	liftIO $ mapM_ (putStrLn . intercalate "|" . format) us
   where
 	time = takeWhile isDigit $ show ts
-	addel = if present then "A" else "M"
+	addel = case logchange of
+		Added -> "A" 
+		Removed -> "M"
 	format u = [ time, lookupdescription u, addel, file ]
 
-{- Generates a display of the changes (which are ordered with newest first),
- - by comparing each change with the previous change.
+{- Generates a display of the changes.

(Diff truncated)
diff --git a/doc/bugs/IPv6_literal_ssh_servers_break_git_annex_webapp.mdwn b/doc/bugs/IPv6_literal_ssh_servers_break_git_annex_webapp.mdwn
new file mode 100644
index 0000000..f7ab78d
--- /dev/null
+++ b/doc/bugs/IPv6_literal_ssh_servers_break_git_annex_webapp.mdwn
@@ -0,0 +1,63 @@
+### Please describe the problem.
+When trying to set up the Git Annex webapp to sync with an SSH server on Windows, specifying the remote server address ans an IPv6 literal address will result in an Internal Server Error like this:
+
+`C:\Users\anovak\.ssh\git-annex\key.git-annex-fc2e:f79e:da52:bd92:74f8:b045:e365:5e9d-anovak_22_.2Fhome.2Fanovak.2Fannex: openFile: invalid argument (Invalid argument)`
+
+I think the problem is that it's not escaping the colons, and you can't have colons in a filename on Windows.
+
+### What steps will reproduce the problem?
+
+1. Have Git Annex Webapp runnign on Windows.
+2. Go to the "Adding a remote server using ssh" page.
+3. Enter an IPv6 literal address (in brackets), like `[fc2e:f79e:da52:bd92:74f8:b045:e365:5e9d]`, under "Host name". I hyappen to be using cjdns addresses, but I bet you get the same issue with Internet addresses.
+4. Add the server, and elect to combine repositories if prompted.
+5. You should get the error.
+
+### What version of git-annex are you using? On what operating system?
+
+I have Git Annex: `Version: 6.20160613-g35dbe35` on Windows 7.
+
+### Please provide any additional information below.
+
+[[!format sh """
+# If you can, paste a complete transcript of the problem occurring here.
+# If the problem is with the git-annex assistant, paste in .git/annex/daemon.log
+
+[2016-07-17 11:11:09.3554208] main: starting assistant version 6.20160613-g35dbe35
+Warning: Couldn't open /dev/urandom
+Warning: using system clock for seed instead (quality will be lower)
+Launching web browser on file://C:\Users\anovak\annex\.git\annex\webapp.html
+[2016-07-17 11:11:09.482428] Cronner: You should enable consistency checking to protect your data. 
+(scanning...) [2016-07-17 11:11:09.7544436] Watcher: Performing startup scan
+(started...) 
+recv: failed (No error)
+recv: failed (No error)
+recv: failed (No error)
+(recording state in git...)
+Generating public/private rsa key pair.
+Your identification has been saved in C:\Users\anovak\AppData\Local\Temp\git-annex-keygen.0\key.
+Your public key has been saved in C:\Users\anovak\AppData\Local\Temp\git-annex-keygen.0\key.pub.
+The key fingerprint is:
+SHA256:sNwb2o1rp2ycVaMvEOxKZa2g6YlYVuOtbty8xybl3Uc anovak@Asteria
+The key's randomart image is:
++---[RSA 2048]----+
+|                 |
+|                 |
+|      .. .       |
+|    o..+= . o    |
+|   o =o=So o .   |
+|  o + oo==o   E  |
+| + + *.*+=.o .   |
+|. . * =.X.+ o .  |
+|   o. .B+o . .   |
++----[SHA256]-----+
+17/Jul/2016:11:15:48 -0700 [Error#yesod-core] C:\Users\anovak\.ssh\git-annex\key.git-annex-fc2e:f79e:da52:bd92:74f8:b045:e365:5e9d-anovak_22_.2Fhome.2Fanovak.2Fannex: openFile: invalid argument (Invalid argument) @(yesod_IAZWSEWTVsBHH7DfZiTwkc:Yesod.Core.Class.Yesod .\Yesod\Core\Class\Yesod.hs:628:5)
+
+# End of transcript or log.
+"""]]
+
+### Have you had any luck using git-annex before? (Sometimes we get tired of reading bug reports all day and a lil' positive end note does wonders)
+
+Yeah, it works great on my Linux machines. I'm just getting started with the web app, though; I'm trying to set up limited-access key-based SSH, and the web app seems to be also trying to do that...
+
+

removed
diff --git a/doc/tips/googledriveannex/comment_11_742bdd05b87902324e44ebebcfdb31b7._comment b/doc/tips/googledriveannex/comment_11_742bdd05b87902324e44ebebcfdb31b7._comment
deleted file mode 100644
index a23661b..0000000
--- a/doc/tips/googledriveannex/comment_11_742bdd05b87902324e44ebebcfdb31b7._comment
+++ /dev/null
@@ -1,19 +0,0 @@
-[[!comment format=mdwn
- username="emanuele.olivetti@47d88ed185b03191e25329caa6fabc2efb3118b2"
- nickname="emanuele.olivetti"
- subject="googledriveannex does not"
- date="2016-07-14T14:58:05Z"
- content="""
-Following the instructions above, when issuing:
-
-    git annex initremote googledrive type=external externaltype=googledrive encryption=shared folder=gitannex
-
-googleannexdrive fails and I get:
-
-    initremote googledrive (encryption setup) (encryption key stored in git repository) No handlers could be found for logger \"oauth2client.util\"
-    git-annex: You need to set OAUTH environment variables and folder and encryption parameters when running initremote.
-
-Am I making some obvious mistake?
-
-If not, I'd like to share my positive experience with git-annex-remote-rclone (<https://github.com/DanielDent/git-annex-remote-rclone>), which wraps rclone (<https://rclone.org>) that supports Google Drive: it worked for me.
-"""]]

Added a comment: googledriveannex fails: No handlers could be found for logger "oauth2client.util"
diff --git a/doc/tips/googledriveannex/comment_12_9f3e51a005255655346b2ae39891737f._comment b/doc/tips/googledriveannex/comment_12_9f3e51a005255655346b2ae39891737f._comment
new file mode 100644
index 0000000..1763cdd
--- /dev/null
+++ b/doc/tips/googledriveannex/comment_12_9f3e51a005255655346b2ae39891737f._comment
@@ -0,0 +1,19 @@
+[[!comment format=mdwn
+ username="emanuele.olivetti@47d88ed185b03191e25329caa6fabc2efb3118b2"
+ nickname="emanuele.olivetti"
+ subject="googledriveannex fails: No handlers could be found for logger &quot;oauth2client.util&quot;"
+ date="2016-07-14T14:58:29Z"
+ content="""
+Following the instructions above, when issuing:
+
+    git annex initremote googledrive type=external externaltype=googledrive encryption=shared folder=gitannex
+
+googleannexdrive fails and I get:
+
+    initremote googledrive (encryption setup) (encryption key stored in git repository) No handlers could be found for logger \"oauth2client.util\"
+    git-annex: You need to set OAUTH environment variables and folder and encryption parameters when running initremote.
+
+Am I making some obvious mistake?
+
+If not, I'd like to share my positive experience with git-annex-remote-rclone (<https://github.com/DanielDent/git-annex-remote-rclone>), which wraps rclone (<https://rclone.org>) that supports Google Drive: it worked for me.
+"""]]

Added a comment: googledriveannex does not
diff --git a/doc/tips/googledriveannex/comment_11_742bdd05b87902324e44ebebcfdb31b7._comment b/doc/tips/googledriveannex/comment_11_742bdd05b87902324e44ebebcfdb31b7._comment
new file mode 100644
index 0000000..a23661b
--- /dev/null
+++ b/doc/tips/googledriveannex/comment_11_742bdd05b87902324e44ebebcfdb31b7._comment
@@ -0,0 +1,19 @@
+[[!comment format=mdwn
+ username="emanuele.olivetti@47d88ed185b03191e25329caa6fabc2efb3118b2"
+ nickname="emanuele.olivetti"
+ subject="googledriveannex does not"
+ date="2016-07-14T14:58:05Z"
+ content="""
+Following the instructions above, when issuing:
+
+    git annex initremote googledrive type=external externaltype=googledrive encryption=shared folder=gitannex
+
+googleannexdrive fails and I get:
+
+    initremote googledrive (encryption setup) (encryption key stored in git repository) No handlers could be found for logger \"oauth2client.util\"
+    git-annex: You need to set OAUTH environment variables and folder and encryption parameters when running initremote.
+
+Am I making some obvious mistake?
+
+If not, I'd like to share my positive experience with git-annex-remote-rclone (<https://github.com/DanielDent/git-annex-remote-rclone>), which wraps rclone (<https://rclone.org>) that supports Google Drive: it worked for me.
+"""]]

diff --git a/doc/bugs/drop_blows_on_lustre__58___SQLite3_returned_ErrorIO.mdwn b/doc/bugs/drop_blows_on_lustre__58___SQLite3_returned_ErrorIO.mdwn
new file mode 100644
index 0000000..c90a9f2
--- /dev/null
+++ b/doc/bugs/drop_blows_on_lustre__58___SQLite3_returned_ErrorIO.mdwn
@@ -0,0 +1,51 @@
+[[!format sh """
+$> git clone http://data.pymvpa.org/datasets/tutorial_data/.git tutorial_data-2
+Cloning into 'tutorial_data-2'...
+Checking connectivity... done.
+cd 
+#35 !280 [0].....................................:Thu Jul 14 10:16:49:.
+anthill:/home/ironfs/scratch/yarik
+$> cd tutorial_data-2
+total 36
+ 4 freesurfer/   4 hyperalignment_tutorial_data.hdf5.gz@  20 suma_surfaces/
+ 4 haxby2001/    4 results/
+(git)/home/ironfs/scratch/yarik/tutorial_data-2:[master]
+#36 !281 [0].....................................:Thu Jul 14 10:16:50:.
+anthill:/home/ironfs/scratch/yarik/tutorial_data-2
+$> git annex get hyperalignment_tutorial_data.hdf5.gz 
+
+  Detected a filesystem without POSIX fcntl lock support.
+
+  Enabling annex.pidlock.
+(merging origin/git-annex into git-annex...)
+(recording state in git...)
+/home/ironfs/scratch 100%[===================>]  15.04M  68.9MB/s    in 0.2s    
+(checksum...) ok
+(recording state in git...)
+(git)/home/ironfs/scratch/yarik/tutorial_data-2:[master]
+#37 !282 [0].....................................:Thu Jul 14 10:16:54:.
+anthill:/home/ironfs/scratch/yarik/tutorial_data-2
+$> git annex drop hyperalignment_tutorial_data.hdf5.gz
+drop hyperalignment_tutorial_data.hdf5.gz (checking origin...) git-annex: SQLite3 returned ErrorIO while attempting to perform prepare "PRAGMA journal_mode=WAL;": disk I/O error
+(git)/home/ironfs/scratch/yarik/tutorial_data-2:[master]
+
+$> git annex fsck
+fsck freesurfer/anat_nii.nii sqlite worker thread crashed: SQLite3 returned ErrorIO while attempting to perform prepare "SELECT null from content limit 1": disk I/O error
+git-annex: sqlite query crashed
+
+$> git annex version
+git-annex version: 6.20160613-g35dbe35
+build flags: Assistant Webapp Pairing Testsuite S3(multipartupload)(storageclasses) WebDAV Inotify DBus DesktopNotify XMPP ConcurrentOutput TorrentParser MagicMime Feeds Quvi
+key/value backends: SHA256E SHA256 SHA512E SHA512 SHA224E SHA224 SHA384E SHA384 SHA3_256E SHA3_256 SHA3_512E SHA3_512 SHA3_224E SHA3_224 SHA3_384E SHA3_384 SKEIN256E SKEIN256 SKEIN512E SKEIN512 SHA1E SHA1 MD5E MD5 WORM URL
+remote types: git gcrypt S3 bup directory rsync web bittorrent webdav tahoe glacier ddar hook external
+local repository version: 5
+supported repository versions: 5 6
+upgrade supported from repository versions: 0 1 2 3 4 5
+operating system: linux x86_64
+(git)/home/ironfs/scratch/yarik/tutorial_data:[master]
+
+"""]]
+
+
+
+[[!meta author=yoh]]

Added a comment
diff --git a/doc/forum/copy_--auto_copies_already_synced_files/comment_1_cc5e2e7630a33b73d1eb92eebe254cea._comment b/doc/forum/copy_--auto_copies_already_synced_files/comment_1_cc5e2e7630a33b73d1eb92eebe254cea._comment
new file mode 100644
index 0000000..ae3b461
--- /dev/null
+++ b/doc/forum/copy_--auto_copies_already_synced_files/comment_1_cc5e2e7630a33b73d1eb92eebe254cea._comment
@@ -0,0 +1,7 @@
+[[!comment format=mdwn
+ username="Horus"
+ subject="comment 1"
+ date="2016-07-14T09:28:32Z"
+ content="""
+Addendum: It seems it is not really copying the files, but checking. The solution is probably using ```git annex copy --to=marduk.dynv6 --auto --fast``` which behaves like I expect it (copies nothing).
+"""]]

diff --git a/doc/forum/copy_--auto_copies_already_synced_files.mdwn b/doc/forum/copy_--auto_copies_already_synced_files.mdwn
new file mode 100644
index 0000000..13a497a
--- /dev/null
+++ b/doc/forum/copy_--auto_copies_already_synced_files.mdwn
@@ -0,0 +1,24 @@
+Hello,
+
+I have two repos, both are standard/client and they are in sync:
+
+```
+% git annex sync marduk.dynv6 --content
+commit  ok
+pull marduk.dynv6 
+ok
+git annex sync marduk.dynv6 --content  64,35s user 4,54s system 88% cpu 1:18,15 total
+```
+I would ```copy --auto``` except to copy no files, but still, ```git annex copy --to=marduk.dynv6 --auto``` seems to copy all files:
+
+```
+% git annex copy --to=marduk.dynv6 --auto
+copy .gitignore (checking marduk.dynv6...) ok
+copy Alben/2Raumwohnung - Es wird Morgen/2Raumwohnung - 01 - Wolken ziehen vorbei.mp3 (checking marduk.dynv6...) ok
+copy Alben/2Raumwohnung - Es wird Morgen/2Raumwohnung - 02 - Spiel mit.mp3 (checking marduk.dynv6...) ok
+[... canceled]
+```
+Why is copy --auto copying these (presumably all) files here=
+
+Thanks!
+Florian

Added a comment
diff --git a/doc/forum/Multiple_prefered_content_groups/comment_2_a91177f4f02500e8fa6594933e128ef0._comment b/doc/forum/Multiple_prefered_content_groups/comment_2_a91177f4f02500e8fa6594933e128ef0._comment
new file mode 100644
index 0000000..84aef30
--- /dev/null
+++ b/doc/forum/Multiple_prefered_content_groups/comment_2_a91177f4f02500e8fa6594933e128ef0._comment
@@ -0,0 +1,11 @@
+[[!comment format=mdwn
+ username="Horus"
+ subject="comment 2"
+ date="2016-07-14T08:32:11Z"
+ content="""
+Ah, ok, then it makes sense.
+
+Maybe it's an idea to expand the standard expression for client groups in a way that they drop a file if it has reached a backup repo (additionally to a archive repo)?
+
+Thanks!
+"""]]

devblog
diff --git a/doc/devblog/day_406__low_handing_fruit_continued.mdwn b/doc/devblog/day_406__low_handing_fruit_continued.mdwn
new file mode 100644
index 0000000..e417f18
--- /dev/null
+++ b/doc/devblog/day_406__low_handing_fruit_continued.mdwn
@@ -0,0 +1,3 @@
+Worked on recent bug reports. Two bugs fixed today were both reversions
+introduced when the v6 repository support was added. Backlog is down to
+153.

Support checking presence of content at a http url that redirects to a ftp url.
diff --git a/CHANGELOG b/CHANGELOG
index f1548c7..901d7a0 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -18,6 +18,8 @@ git-annex (6.20160614) UNRELEASED; urgency=medium
   * uninit: Fix crash due to trying to write to deleted keys db.
     Reversion introduced by v6 mode support, affects v5 too.
   * Fix a similar crash when the webapp is used to delete a repository.
+  * Support checking presence of content at a http url that redirects to
+    a ftp url.
 
  -- Joey Hess <id@joeyh.name>  Mon, 13 Jun 2016 21:52:24 -0400
 
diff --git a/Remote/WebDAV.hs b/Remote/WebDAV.hs
index dd0ff57..3de8b35 100644
--- a/Remote/WebDAV.hs
+++ b/Remote/WebDAV.hs
@@ -30,7 +30,7 @@ import Remote.Helper.Http
 import qualified Remote.Helper.Chunked.Legacy as Legacy
 import Creds
 import Utility.Metered
-import Utility.Url (URLString)
+import Utility.Url (URLString, matchStatusCodeException)
 import Annex.UUID
 import Remote.WebDAV.DavLocation
 
@@ -270,12 +270,6 @@ existsDAV l = inLocation l check `catchNonAsync` (\e -> return (Left $ show e))
 			(const $ ispresent False)
 	ispresent = return . Right
 
-matchStatusCodeException :: (Status -> Bool) -> HttpException -> Maybe HttpException
-matchStatusCodeException want e@(StatusCodeException s _ _)
-	| want s = Just e
-	| otherwise = Nothing
-matchStatusCodeException _ _ = Nothing
-
 -- Ignores any exceptions when performing a DAV action.
 safely :: DAVT IO a -> DAVT IO (Maybe a)
 safely = eitherToMaybe <$$> tryNonAsync
diff --git a/Utility/Url.hs b/Utility/Url.hs
index 1e1f14c..97536f7 100644
--- a/Utility/Url.hs
+++ b/Utility/Url.hs
@@ -25,7 +25,8 @@ module Utility.Url (
 	assumeUrlExists,
 	download,
 	downloadQuiet,
-	parseURIRelaxed
+	parseURIRelaxed,
+	matchStatusCodeException,
 ) where
 
 import Common
@@ -126,6 +127,7 @@ data UrlInfo = UrlInfo
 	, urlSize :: Maybe Integer
 	, urlSuggestedFile :: Maybe FilePath
 	}
+	deriving (Show)
 
 assumeUrlExists :: UrlInfo
 assumeUrlExists = UrlInfo True Nothing Nothing
@@ -135,7 +137,14 @@ assumeUrlExists = UrlInfo True Nothing Nothing
 getUrlInfo :: URLString -> UrlOptions -> IO UrlInfo
 getUrlInfo url uo = case parseURIRelaxed url of
 	Just u -> case parseUrl (show u) of
-		Just req -> existsconduit req `catchNonAsync` const dne
+		Just req -> catchJust
+			-- When http redirects to a protocol which 
+			-- conduit does not support, it will throw
+			-- a StatusCodeException with found302.
+			(matchStatusCodeException (== found302))
+			(existsconduit req)
+			(const (existscurl u))
+			`catchNonAsync` (const dne)
 		-- http-conduit does not support file:, ftp:, etc urls,
 		-- so fall back to reading files and using curl.
 		Nothing
@@ -147,18 +156,7 @@ getUrlInfo url uo = case parseURIRelaxed url of
 						sz <- getFileSize' f stat
 						found (Just sz) Nothing
 					Nothing -> dne
-			| Build.SysConfig.curl -> do
-				output <- catchDefaultIO "" $
-					readProcess "curl" $ toCommand curlparams
-				let len = extractlencurl output
-				let good = found len Nothing
-				case lastMaybe (lines output) of
-					Just ('2':_:_) -> good
-					-- don't try to parse ftp status
-					-- codes; if curl got a length,
-					-- it's good
-					_ | "ftp" `isInfixOf` uriScheme u && isJust len -> good
-					_ -> dne
+			| Build.SysConfig.curl -> existscurl u
 			| otherwise -> dne
 	Nothing -> dne
   where
@@ -201,6 +199,23 @@ getUrlInfo url uo = case parseURIRelaxed url of
 		liftIO $ closeManager mgr
 		return ret
 
+	existscurl u = do
+		output <- catchDefaultIO "" $
+			readProcess "curl" $ toCommand curlparams
+		let len = extractlencurl output
+		let good = found len Nothing
+		let isftp = or
+			[ "ftp" `isInfixOf` uriScheme u
+			-- Check to see if http redirected to ftp.
+			, "Location: ftp://" `isInfixOf` output
+			]
+		case lastMaybe (lines output) of
+			Just ('2':_:_) -> good
+			-- don't try to parse ftp status codes; if curl
+			-- got a length, it's good
+			_ | isftp && isJust len -> good
+			_ -> dne
+
 -- Parse eg: attachment; filename="fname.ext"
 -- per RFC 2616
 contentDispositionFilename :: String -> Maybe FilePath
@@ -324,3 +339,13 @@ hContentLength = "Content-Length"
 hUserAgent :: CI.CI B.ByteString
 hUserAgent = "User-Agent"
 #endif
+
+{- Use with eg:
+ -
+ - > catchJust (matchStatusCodeException (== notFound404))
+ -}
+matchStatusCodeException :: (Status -> Bool) -> HttpException -> Maybe HttpException
+matchStatusCodeException want e@(StatusCodeException s _ _)
+	| want s = Just e
+	| otherwise = Nothing
+matchStatusCodeException _ _ = Nothing
diff --git a/doc/bugs/annex_drop_fails_to_determine_availability_on_a_http_url_redirecting_to_ftp.mdwn b/doc/bugs/annex_drop_fails_to_determine_availability_on_a_http_url_redirecting_to_ftp.mdwn
index d25f016..9ecab38 100644
--- a/doc/bugs/annex_drop_fails_to_determine_availability_on_a_http_url_redirecting_to_ftp.mdwn
+++ b/doc/bugs/annex_drop_fails_to_determine_availability_on_a_http_url_redirecting_to_ftp.mdwn
@@ -127,3 +127,5 @@ Logging in as anonymous ...
 """]]
 
 [[!meta author=yoh]]
+
+> [[fixed|done]] --[[Joey]]
diff --git a/doc/bugs/annex_drop_fails_to_determine_availability_on_a_http_url_redirecting_to_ftp/comment_1_b16b58ac5180be6c7f61a1cf8de55663._comment b/doc/bugs/annex_drop_fails_to_determine_availability_on_a_http_url_redirecting_to_ftp/comment_1_b16b58ac5180be6c7f61a1cf8de55663._comment
new file mode 100644
index 0000000..54a670b
--- /dev/null
+++ b/doc/bugs/annex_drop_fails_to_determine_availability_on_a_http_url_redirecting_to_ftp/comment_1_b16b58ac5180be6c7f61a1cf8de55663._comment
@@ -0,0 +1,13 @@
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 1"""
+ date="2016-07-12T20:00:49Z"
+ content="""
+This only affects http to ftp redirects, because there's a special hack
+in place to use curl to check if a ftp url exists.
+
+Seems that http-conduit throws a StatusCodeException with statusCode = 302
+when it is redirected to a protocol that it does not support, such as ftp.
+
+So, it can catch that exception and fall back to curl.
+"""]]

Added a comment
diff --git a/doc/forum/Fsck_by_refs_or_keys__63__/comment_2_1d74ad47cf3bef9bcc0ccdff4ccb69b9._comment b/doc/forum/Fsck_by_refs_or_keys__63__/comment_2_1d74ad47cf3bef9bcc0ccdff4ccb69b9._comment
new file mode 100644
index 0000000..b5fba44
--- /dev/null
+++ b/doc/forum/Fsck_by_refs_or_keys__63__/comment_2_1d74ad47cf3bef9bcc0ccdff4ccb69b9._comment
@@ -0,0 +1,7 @@
+[[!comment format=mdwn
+ username="Rémi"
+ subject="comment 2"
+ date="2016-07-12T20:28:44Z"
+ content="""
+Thanks, I opted for the clone solution, as there are fare too many lost key in this repository to manually suppress them all.
+"""]]

comment
diff --git a/doc/news/version_6.20160613/comment_2_c30ce151490345ac5283e3900c26f173._comment b/doc/news/version_6.20160613/comment_2_c30ce151490345ac5283e3900c26f173._comment
new file mode 100644
index 0000000..0df9710
--- /dev/null
+++ b/doc/news/version_6.20160613/comment_2_c30ce151490345ac5283e3900c26f173._comment
@@ -0,0 +1,11 @@
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 2"""
+ date="2016-07-12T19:55:52Z"
+ content="""
+In this case, the change only makes eg, "foo.ba__________r" not be considered
+to have an extension of ".bar". So it's unlikely to affect many files.
+
+I do try to keep the extension guessing code fairly stable to prevent breaking
+re-adding. But sometimes a bug does warrant changing it.
+"""]]

Added a comment
diff --git a/doc/bugs/does_not_build_on_OpenBSD_5.9/comment_4_557f5a38ae78b21b18a63d3ba16bc099._comment b/doc/bugs/does_not_build_on_OpenBSD_5.9/comment_4_557f5a38ae78b21b18a63d3ba16bc099._comment
new file mode 100644
index 0000000..7ea3e42
--- /dev/null
+++ b/doc/bugs/does_not_build_on_OpenBSD_5.9/comment_4_557f5a38ae78b21b18a63d3ba16bc099._comment
@@ -0,0 +1,10 @@
+[[!comment format=mdwn
+ username="quisquous"
+ subject="comment 4"
+ date="2016-07-12T18:59:55Z"
+ content="""
+````
+~ ❯❯❯ stack --version
+Version 1.1.2 x86_64 hpack-0.14.0
+````
+"""]]

comment
diff --git a/doc/forum/Git_annex__44___bup__44___windows_and_remote_linux_issue./comment_1_c9239f9c67b2441ab0e1ac42c53db531._comment b/doc/forum/Git_annex__44___bup__44___windows_and_remote_linux_issue./comment_1_c9239f9c67b2441ab0e1ac42c53db531._comment
new file mode 100644
index 0000000..3a5bc1c
--- /dev/null
+++ b/doc/forum/Git_annex__44___bup__44___windows_and_remote_linux_issue./comment_1_c9239f9c67b2441ab0e1ac42c53db531._comment
@@ -0,0 +1,9 @@
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 1"""
+ date="2016-07-12T18:34:13Z"
+ content="""
+Well, you can ssh into the linux box and cd to R2 and run `git annex sync
+---content` and that should cause it to download any new files that it can
+(if it can contact R1), and send them along to R3.
+"""]]

comment
diff --git a/doc/bugs/does_not_build_on_OpenBSD_5.9/comment_3_8a563d9ccba5e912713812c77d34ea1f._comment b/doc/bugs/does_not_build_on_OpenBSD_5.9/comment_3_8a563d9ccba5e912713812c77d34ea1f._comment
new file mode 100644
index 0000000..87b1c4c
--- /dev/null
+++ b/doc/bugs/does_not_build_on_OpenBSD_5.9/comment_3_8a563d9ccba5e912713812c77d34ea1f._comment
@@ -0,0 +1,15 @@
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 3"""
+ date="2016-07-12T18:31:17Z"
+ content="""
+Not sure if that stack bug you linked to is quite a match for what it's
+doing, so I opened a new one:
+<https://github.com/commercialhaskell/stack/issues/2371>
+
+I don't currently see anything I could do in git-annex to avoid this
+problem.
+
+What version of stack are you using? It could be that a newer version of
+stack doesn't have the problem.
+"""]]

initial report
diff --git a/doc/bugs/annex_drop_fails_to_determine_availability_on_a_http_url_redirecting_to_ftp.mdwn b/doc/bugs/annex_drop_fails_to_determine_availability_on_a_http_url_redirecting_to_ftp.mdwn
new file mode 100644
index 0000000..d25f016
--- /dev/null
+++ b/doc/bugs/annex_drop_fails_to_determine_availability_on_a_http_url_redirecting_to_ftp.mdwn
@@ -0,0 +1,129 @@
+### Please describe the problem.
+
+Need to annex some files from a http link which forwards to ftp.  addurl works out fine (besides not carrying about redirected filename), but drop fails to verify presence of the file
+
+
+### What version of git-annex are you using? On what operating system?
+
+6.20160706+gitgc4229be-1~ndall+1
+
+### Please provide any additional information below.
+
+[[!format sh """
+smaug:/tmp
+$> mkdir /tmp/123; cd /tmp/123; git init; git annex init;
+Initialized empty Git repository in /tmp/123/.git/
+init  ok
+(recording state in git...)
+1 10080.....................................:Tue 12 Jul 2016 02:18:46 PM EDT:.
+(git)smaug:/tmp/123[master]
+$> git annex addurl --debug --pathdepth=-1 http://www.nitrc.org/frs/downloadlink.php/1637
+[2016-07-12 14:18:54.8195] read: git ["--git-dir=.git","--work-tree=.","--literal-pathspecs","show-ref","git-annex"]
+[2016-07-12 14:18:54.83021] process done ExitSuccess
+[2016-07-12 14:18:54.830357] read: git ["--git-dir=.git","--work-tree=.","--literal-pathspecs","show-ref","--hash","refs/heads/git-annex"]
+[2016-07-12 14:18:54.841375] process done ExitSuccess
+[2016-07-12 14:18:54.841694] read: git ["--git-dir=.git","--work-tree=.","--literal-pathspecs","log","refs/heads/git-annex..787586641a9027e772b91989eb649cb9303cd975","--pretty=%H","-n1"]
+[2016-07-12 14:18:54.851263] process done ExitSuccess
+[2016-07-12 14:18:54.852043] chat: git ["--git-dir=.git","--work-tree=.","--literal-pathspecs","cat-file","--batch"]
+[2016-07-12 14:18:54.862122] read: quvi ["--version"]
+[2016-07-12 14:18:54.869939] process done ExitSuccess
+[2016-07-12 14:18:54.870062] call: quvi ["--verbosity","mute","--support","http://www.nitrc.org/frs/downloadlink.php/1637"]
+[2016-07-12 14:18:54.891339] process done ExitFailure 65
+addurl 1637 (downloading http://www.nitrc.org/frs/downloadlink.php/1637 ...) 
+[2016-07-12 14:18:55.830611] call: wget ["-q","--show-progress","--clobber","-c","-O","/tmp/123/.git/annex/tmp/URL--http&c%%www.nitrc.org%frs%downloadlink.php%1637","http://www.nitrc.org/frs/downloadlink.php/1637","--user-agent","git-annex/6.20160706+gitgc4229be-1~ndall+1"]
+1637                                         100%[===========================================================================================>] 268.32M  12.9MB/s    in 27s     
+[2016-07-12 14:19:31.32811] process done ExitSuccess
+[2016-07-12 14:19:31.328909] chat: git ["--git-dir=.git","--work-tree=.","--literal-pathspecs","check-attr","-z","--stdin","annex.backend","annex.numcopies","annex.largefiles","--"]
+[2016-07-12 14:19:31.329444] read: git ["--version"]
+[2016-07-12 14:19:31.338195] process done ExitSuccess
+[2016-07-12 14:19:31.338947] read: sha256sum [".git/annex/tmp/URL--http&c%%www.nitrc.org%frs%downloadlink.php%1637"]
+[2016-07-12 14:19:32.860187] process done ExitSuccess
+ok
+(recording state in git...)
+[2016-07-12 14:19:32.872749] feed: xargs ["-0","git","--git-dir=.git","--work-tree=.","--literal-pathspecs","add","--"]
+[2016-07-12 14:19:32.890096] process done ExitSuccess
+[2016-07-12 14:19:32.890573] chat: git ["--git-dir=.git","--work-tree=.","--literal-pathspecs","hash-object","-w","--stdin-paths","--no-filters"]
+[2016-07-12 14:19:32.891376] feed: git ["--git-dir=.git","--work-tree=.","--literal-pathspecs","update-index","-z","--index-info"]
+[2016-07-12 14:19:32.901206] process done ExitSuccess
+[2016-07-12 14:19:32.901288] read: git ["--git-dir=.git","--work-tree=.","--literal-pathspecs","show-ref","--hash","refs/heads/git-annex"]
+[2016-07-12 14:19:32.909396] process done ExitSuccess
+[2016-07-12 14:19:32.909691] read: git ["--git-dir=.git","--work-tree=.","--literal-pathspecs","write-tree"]
+[2016-07-12 14:19:32.91827] process done ExitSuccess
+[2016-07-12 14:19:32.918324] chat: git ["--git-dir=.git","--work-tree=.","--literal-pathspecs","commit-tree","6c1ce1871151c12f6930733e7693eac2fd862677","--no-gpg-sign","-p","refs/heads/git-annex"]
+[2016-07-12 14:19:32.927217] process done ExitSuccess
+[2016-07-12 14:19:32.927281] call: git ["--git-dir=.git","--work-tree=.","--literal-pathspecs","update-ref","refs/heads/git-annex","2453a1c23977e4f17ac5fd9668cdc7bdb93e34e8"]
+[2016-07-12 14:19:32.936074] process done ExitSuccess
+cached/staged changes:                                                                                                                                                           
+ 1637 | 1 +
+1 10081.....................................:Tue 12 Jul 2016 02:19:32 PM EDT:.
+(git)smaug:/tmp/123[master]
+$> git commit -m 'added'                                                          
+[master (root-commit) b212851] added
+ 1 file changed, 1 insertion(+)
+ create mode 120000 1637
+1 10082.....................................:Tue 12 Jul 2016 02:19:38 PM EDT:.
+(git)smaug:/tmp/123[master]git
+$> git annex drop 1637                                                            
+drop 1637 (checking http://www.nitrc.org/frs/downloadlink.php/1637...) (unsafe) 
+  Could only verify the existence of 0 out of 1 necessary copies
+
+  Rather than dropping this file, try using: git annex move
+
+  (Use --force to override this check, or adjust numcopies.)
+failed
+git-annex: drop: 1 failed
+1 10083 ->1.....................................:Tue 12 Jul 2016 02:19:48 PM EDT:.
+(git)smaug:/tmp/123[master]git
+$> wget -S http://www.nitrc.org/frs/downloadlink.php/1637
+--2016-07-12 14:19:54--  http://www.nitrc.org/frs/downloadlink.php/1637
+Resolving www.nitrc.org (www.nitrc.org)... 132.239.16.23
+Connecting to www.nitrc.org (www.nitrc.org)|132.239.16.23|:80... connected.
+HTTP request sent, awaiting response... 
+  HTTP/1.1 302 Found
+  Date: Tue, 12 Jul 2016 18:19:54 GMT
+  Server: Apache/2.2.15 (CentOS)
+  X-Powered-By: PHP/5.3.3
+  Set-Cookie: PHPSESSID=vhcpo1fmi205cfv0h4jgbnn9a0; path=/
+  Expires: Thu, 19 Nov 1981 08:52:00 GMT
+  Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
+  Pragma: no-cache
+  Location: ftp://www.nitrc.org/fcon_1000/htdocs/Ontario.tar
+  Content-Length: 0
+  Keep-Alive: timeout=2, max=100
+  Connection: Keep-Alive
+  Content-Type: text/html; charset=UTF-8
+Location: ftp://www.nitrc.org/fcon_1000/htdocs/Ontario.tar [following]
+--2016-07-12 14:19:55--  ftp://www.nitrc.org/fcon_1000/htdocs/Ontario.tar
+           => ‘Ontario.tar’
+Connecting to www.nitrc.org (www.nitrc.org)|132.239.16.23|:21... connected.
+Logging in as anonymous ... 
+220 (vsFTPd 2.2.2)
+--> USER anonymous
+
+331 Please specify the password.
+--> PASS Turtle Power!
+
+230 Login successful.
+--> SYST
+
+215 UNIX Type: L8
+--> PWD
+
+257 "/"
+--> TYPE I
+
+200 Switching to Binary mode.
+--> CWD /fcon_1000/htdocs
+
+250 Directory successfully changed.
+--> SIZE Ontario.tar
+
+213 281354240
+--> PASV
+
+227 Entering Passive Mode (132,239,16,23,106,251).
+--> RETR Ontario.tar
+
+"""]]
+
+[[!meta author=yoh]]

uninit: Fix crash due to trying to write to deleted keys db.
Reversion introduced by v6 mode support, affects v5 too.
Also fix a similar crash when the webapp is used to delete a repository.
diff --git a/Assistant/WebApp/Configurators/Delete.hs b/Assistant/WebApp/Configurators/Delete.hs
index d3393d1..149b403 100644
--- a/Assistant/WebApp/Configurators/Delete.hs
+++ b/Assistant/WebApp/Configurators/Delete.hs
@@ -17,17 +17,15 @@ import Assistant.Sync
 import qualified Remote
 import qualified Git
 import Config.Files
-import Utility.FileMode
 import Logs.Trust
 import Logs.Remote
 import Logs.PreferredContent
 import Types.StandardGroups
 import Annex.UUID
+import Command.Uninit (prepareRemoveAnnexDir)
 
-import System.IO.HVFS (SystemFS(..))
 import qualified Data.Text as T
 import qualified Data.Map as M
-import System.Path
 
 notCurrentRepo :: UUID -> Handler Html -> Handler Html
 notCurrentRepo uuid a = do
@@ -99,12 +97,8 @@ deleteCurrentRepository = dangerPage $ do
 				rs <- syncRemotes <$> getDaemonStatus
 				mapM_ (\r -> changeSyncable (Just r) False) rs
 
-			{- Make all directories writable and files writable
-			 - so all annexed content can be deleted. -}
-			liftIO $ do
-				recurseDir SystemFS dir
-					>>= mapM_ (void . tryIO . allowWrite)
-				removeDirectoryRecursive =<< absPath dir
+			liftAnnex $ prepareRemoveAnnexDir dir
+			liftIO $ removeDirectoryRecursive =<< absPath dir
 			
 			redirect ShutdownConfirmedR
 		_ -> $(widgetFile "configurators/delete/currentrepository")
diff --git a/CHANGELOG b/CHANGELOG
index c7f6c4d..f1548c7 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -15,6 +15,9 @@ git-annex (6.20160614) UNRELEASED; urgency=medium
   * fsck: Fix a reversion in direct mode fsck of a file that is
     present when the location log thinks it is not. Reversion introduced
     in version 5.20151208.
+  * uninit: Fix crash due to trying to write to deleted keys db.
+    Reversion introduced by v6 mode support, affects v5 too.
+  * Fix a similar crash when the webapp is used to delete a repository.
 
  -- Joey Hess <id@joeyh.name>  Mon, 13 Jun 2016 21:52:24 -0400
 
diff --git a/Command/Uninit.hs b/Command/Uninit.hs
index 44f4b0d..fa7e130 100644
--- a/Command/Uninit.hs
+++ b/Command/Uninit.hs
@@ -13,6 +13,7 @@ import qualified Git
 import qualified Git.Command
 import qualified Command.Unannex
 import qualified Annex.Branch
+import qualified Database.Keys
 import Annex.Content
 import Annex.Init
 import Utility.FileMode
@@ -61,7 +62,7 @@ finish = do
 	annexdir <- fromRepo gitAnnexDir
 	annexobjectdir <- fromRepo gitAnnexObjectDir
 	leftovers <- removeUnannexed =<< getKeysPresent InAnnex
-	liftIO $ prepareRemoveAnnexDir annexdir
+	prepareRemoveAnnexDir annexdir
 	if null leftovers
 		then liftIO $ removeDirectoryRecursive annexdir
 		else error $ unlines
@@ -89,9 +90,17 @@ finish = do
 	liftIO exitSuccess
 
 {- Turn on write bits in all remaining files in the annex directory, in
- - preparation for removal. -}
-prepareRemoveAnnexDir :: FilePath -> IO ()
-prepareRemoveAnnexDir annexdir =
+ - preparation for removal. 
+ -
+ - Also closes sqlite databases that might be in the directory,
+ - to avoid later failure to write any cached changes to them. -}
+prepareRemoveAnnexDir :: FilePath -> Annex ()
+prepareRemoveAnnexDir annexdir = do
+	Database.Keys.closeDb
+	liftIO $ prepareRemoveAnnexDir' annexdir
+
+prepareRemoveAnnexDir' :: FilePath -> IO ()
+prepareRemoveAnnexDir' annexdir =
 	recurseDir SystemFS annexdir >>= mapM_ (void . tryIO . allowWrite)
 
 {- Keys that were moved out of the annex have a hard link still in the
diff --git a/Test.hs b/Test.hs
index f92d825..35d9dda 100644
--- a/Test.hs
+++ b/Test.hs
@@ -1837,7 +1837,7 @@ cleanup = cleanup' False
 
 cleanup' :: Bool -> FilePath -> IO ()
 cleanup' final dir = whenM (doesDirectoryExist dir) $ do
-	Command.Uninit.prepareRemoveAnnexDir dir
+	Command.Uninit.prepareRemoveAnnexDir' dir
 	-- This sometimes fails on Windows, due to some files
 	-- being still opened by a subprocess.
 	catchIO (removeDirectoryRecursive dir) $ \e ->
diff --git a/doc/bugs/git_uninit_on_OS_X_causes_SqlLite3_error.mdwn b/doc/bugs/git_uninit_on_OS_X_causes_SqlLite3_error.mdwn
index 1250061..cf779ab 100644
--- a/doc/bugs/git_uninit_on_OS_X_causes_SqlLite3_error.mdwn
+++ b/doc/bugs/git_uninit_on_OS_X_causes_SqlLite3_error.mdwn
@@ -1,3 +1,5 @@
+[[!meta title="git annex uninit causes SqlLite3 error"]]
+
 ### Please describe the problem.
 I am basically having issues with `git annex uninit`
 
@@ -74,3 +76,5 @@ Now if I add a local file I get a different error
 ### Have you had any luck using git-annex before? (Sometimes we get tired of reading bug reports all day and a lil' positive end note does wonders)
 
 I am super excited about what I can do with git-annex. I hope to setup and maintain encrypted repo(s) of some of my files, and access them by cloning a local copy of the encrypted repo and getting the files I want, using them, and then deleting the local copy.
+
+> [[fixed|done]] --[[Joey]]
diff --git a/doc/bugs/git_uninit_on_OS_X_causes_SqlLite3_error/comment_1_be3aaa58fd3adfa5eeb893c205aa871c._comment b/doc/bugs/git_uninit_on_OS_X_causes_SqlLite3_error/comment_1_be3aaa58fd3adfa5eeb893c205aa871c._comment
new file mode 100644
index 0000000..fed1699
--- /dev/null
+++ b/doc/bugs/git_uninit_on_OS_X_causes_SqlLite3_error/comment_1_be3aaa58fd3adfa5eeb893c205aa871c._comment
@@ -0,0 +1,18 @@
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 1"""
+ date="2016-07-12T17:48:50Z"
+ content="""
+Not OSX specific; reproduced on Linux.
+
+Instrumentation shows that removeInodeCaches is being called, when it
+unannexes the annexed file. This is why a file has to have been added to
+the repo to get the crash.
+
+It's actually not necessary for removeInodeCaches to be called in a v5
+repo, only in v6. If the code checked for v6 mode before writing to the
+database, such problems would be avoided except for in v6 mode.
+
+But, the actual fix is to make uninit close this and all other sqlite
+db's before deleting the .git/annex directory.
+"""]]

response
diff --git a/doc/forum/Fsck_by_refs_or_keys__63__/comment_1_345daa76cdd13538054e886a755bf29d._comment b/doc/forum/Fsck_by_refs_or_keys__63__/comment_1_345daa76cdd13538054e886a755bf29d._comment
new file mode 100644
index 0000000..bd5f3f7
--- /dev/null
+++ b/doc/forum/Fsck_by_refs_or_keys__63__/comment_1_345daa76cdd13538054e886a755bf29d._comment
@@ -0,0 +1,14 @@
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 1"""
+ date="2016-07-12T17:41:35Z"
+ content="""
+Currently the only way to do that is to make a clone of the bare repsitory
+that's not bare. Then run `git annex fsck --from origin` inside the clone.
+This is more efficient when the clone is on the same disk as the bare
+repository.
+
+Another way to deal with it is to use `git annex dead --key` to
+make fsk stop complaining about the specific keys that you don't mind are
+gone.
+"""]]

fsck: Fix a reversion in direct mode fsck of a file that is present when the location log thinks it is not. Reversion introduced in version 5.20151208.
diff --git a/CHANGELOG b/CHANGELOG
index 71358f7..c7f6c4d 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -12,6 +12,9 @@ git-annex (6.20160614) UNRELEASED; urgency=medium
   * Remove the EKG build flag, since Gentoo for some reason decided to
     enable this flag, depsite it not being intended for production use and
     so disabled by default.
+  * fsck: Fix a reversion in direct mode fsck of a file that is
+    present when the location log thinks it is not. Reversion introduced
+    in version 5.20151208.
 
  -- Joey Hess <id@joeyh.name>  Mon, 13 Jun 2016 21:52:24 -0400
 
diff --git a/Command/Fsck.hs b/Command/Fsck.hs
index 28ce775..6bc91f0 100644
--- a/Command/Fsck.hs
+++ b/Command/Fsck.hs
@@ -214,11 +214,11 @@ fixLink key file = do
  - in this repository only. -}
 verifyLocationLog :: Key -> KeyStatus -> String -> Annex Bool
 verifyLocationLog key keystatus desc = do
+	direct <- isDirect
 	obj <- calcRepo $ gitAnnexLocation key
-	present <- if isKeyUnlocked keystatus
+	present <- if not direct && isKeyUnlocked keystatus
 		then liftIO (doesFileExist obj)
 		else inAnnex key
-	direct <- isDirect
 	u <- getUUID
 	
 	{- Since we're checking that a key's object file is present, throw
diff --git a/doc/bugs/fsck__44___no_known_copies.mdwn b/doc/bugs/fsck__44___no_known_copies.mdwn
index 8d97be3..5899101 100644
--- a/doc/bugs/fsck__44___no_known_copies.mdwn
+++ b/doc/bugs/fsck__44___no_known_copies.mdwn
@@ -31,3 +31,5 @@ As for how such files happen in the first place, I've no idea myself. (For what
 ### What version of git-annex are you using? On what operating system?
 
 Arch's community/git-annex 6.20160511
+
+> [[fixed|done]] --[[Joey]]
diff --git a/doc/bugs/fsck__44___no_known_copies/comment_1_e13b4e3b9f1c836fe4ca69bcac2b8afb._comment b/doc/bugs/fsck__44___no_known_copies/comment_1_e13b4e3b9f1c836fe4ca69bcac2b8afb._comment
new file mode 100644
index 0000000..012c706
--- /dev/null
+++ b/doc/bugs/fsck__44___no_known_copies/comment_1_e13b4e3b9f1c836fe4ca69bcac2b8afb._comment
@@ -0,0 +1,20 @@
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 1"""
+ date="2016-07-12T17:29:55Z"
+ content="""
+Bug sumitter, it would be good if you could find a way to reproduce
+the location log getting out of sync with reality. While `git annex fsck`
+is there to fix such a diverenge, it should not happen in the first place
+in normal operation.
+
+Reproduced by using `setpresentkey` to make the log not think
+the file content is locally available. The file was available, and had
+the right content, but fsck complains as shown.
+
+Ok, found the bug, it was treating the file as an unlocked file,
+but that meant it looked for the object file. That's the wrong
+thing to do in direct mode. This reversion was introduced in
+[[!commit e7183d83d367bb52f502266b11b5b6dff683279e]], so versions
+before 5.20151208 were ok. Fixing..
+"""]]

tag moreinfo
diff --git a/doc/bugs/Assistant_only_watches_one_repo_on_startup.mdwn b/doc/bugs/Assistant_only_watches_one_repo_on_startup.mdwn
index 052ab4d..70ccf48 100644
--- a/doc/bugs/Assistant_only_watches_one_repo_on_startup.mdwn
+++ b/doc/bugs/Assistant_only_watches_one_repo_on_startup.mdwn
@@ -25,3 +25,5 @@ killall git-annex, and then restart
 ### Have you had any luck using git-annex before? (Sometimes we get tired of reading bug reports all day and a lil' positive end note does wonders)
 
 Really nice tool.  Thanks Joey!
+
+[[!tag moreinfo]]

comment
diff --git a/doc/bugs/silently_failing_when_attempting_to_add_ignored_files/comment_1_f1208fda822d17a3a9e5457324fdd1df._comment b/doc/bugs/silently_failing_when_attempting_to_add_ignored_files/comment_1_f1208fda822d17a3a9e5457324fdd1df._comment
new file mode 100644
index 0000000..10a9330
--- /dev/null
+++ b/doc/bugs/silently_failing_when_attempting_to_add_ignored_files/comment_1_f1208fda822d17a3a9e5457324fdd1df._comment
@@ -0,0 +1,39 @@
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 1"""
+ date="2016-07-12T17:13:37Z"
+ content="""
+This is due to git-annex using `git ls-files --others --exclude-standard`
+to find files to add. Since that silently skips ignored files, so does
+git-annex.
+
+Now that git has `git check-ignore --stdin`, it would be possible for
+git-annex to not run `git ls-files` with `--exclude-standard`, and
+instead check each file it returns to see if it's ignored, and print out 
+a warning message.
+
+But, that would mean a round-trip through the pipe for each filename.
+When operating on a directory containing a lot of new 
+files, it would probably slow down the processing somewhat.
+
+Hmm, but, `git add somedir` does not warn if there are gitignored files in
+somedir; it silently skips them while adding the rest of the directory.
+The warning comes only when explicitly listing an ignored file.
+
+So, git-annex could do the same, only passing the filename through
+checkingnore when it's a normal file and not a directory. This does
+entail statting every command-line parameter though, and passing through
+checkignore would still slow things down. Particularly when `git annex add`
+is run with a huge list of files to add.
+
+I don't know if it's super-important for `git annex add` to mirror every
+behavior of `git add` anyway. Other differences include `git annex add`
+with no parameters defaulting to adding ".", and `git annex add`
+skipping dotfiles by default.
+
+In v6 mode, you can use `git add` to do the same thing as `git annex add`,
+only more slowly. So it could be argued that `git annex add` will remain
+separate from `git add` only because its different behavior can be more
+useful, and for performance reasons. Which makes slowing `git annex add`
+down in order to make it behave more like `git add` seem counterproductive.
+"""]]

why this cannot be fixed in v5 mode
diff --git a/doc/bugs/unannex__58___Cannot_proceed_with_uncommitted_changes_staged_in_the_index/comment_1_1c0cad1076d5d4d908b8297e7c13ea33._comment b/doc/bugs/unannex__58___Cannot_proceed_with_uncommitted_changes_staged_in_the_index/comment_1_1c0cad1076d5d4d908b8297e7c13ea33._comment
new file mode 100644
index 0000000..4b54996
--- /dev/null
+++ b/doc/bugs/unannex__58___Cannot_proceed_with_uncommitted_changes_staged_in_the_index/comment_1_1c0cad1076d5d4d908b8297e7c13ea33._comment
@@ -0,0 +1,32 @@
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 1"""
+ date="2016-07-12T16:23:51Z"
+ content="""
+In v5 mode, there is a complex interaction between unannex and the
+pre-commit hook. An unannexed file looks quite a lot like an unlocked file,
+so the pre-commit hook is prone to want to lock it, and so add it back to
+the annex as an annexed file.
+
+To avoid that problem, unannex needs to commit the unannexing of the
+files.
+
+However, if you have other staged changes, they'll also be included in that
+commit. Which would be a bug if it were allowed to happen. This is why
+it checks for a clean index first.
+
+It would be possible to improve the behavior by explicitly committing only
+the files that got unannexed, rather than all staged changes. Why didn't I
+do that?
+
+Well, `git commit $file` stages any changes to the file's content before
+committing. When the file has been unannexed, this stages the entire large
+file content into git, and adds it back. Not the desired behavior!
+
+Git in fact has no interface to make it commit only staged changes to
+only specific files. I can't get there from here. It would certianly
+be nice if git got the ability to do that, if someone wants a project to
+improve git.
+
+It's very nice that v6 mode avoids this problem entirely!
+"""]]

close as merged
diff --git a/doc/todo/PATCH__58___Fixes_bug_where_webapp_allows_user_to_attempt_deleting_an_unsynced_repo.mdwn b/doc/todo/PATCH__58___Fixes_bug_where_webapp_allows_user_to_attempt_deleting_an_unsynced_repo.mdwn
index 61fb707..9a7ce26 100644
--- a/doc/todo/PATCH__58___Fixes_bug_where_webapp_allows_user_to_attempt_deleting_an_unsynced_repo.mdwn
+++ b/doc/todo/PATCH__58___Fixes_bug_where_webapp_allows_user_to_attempt_deleting_an_unsynced_repo.mdwn
@@ -7,3 +7,5 @@ My changes are in the following git repository
 [https://github.com/kathawala/git-annex.git](https://github.com/kathawala/git-annex.git)
 
 And the specific commit which fixes the bug is in a branch titled "unsync-nodelete". I have tested the change, it greys out and disables the "Delete" option in the "Actions" dropdown menu of the webapp for any repo in the "Repolist" view which has its syncing disabled. There is also some hover text which explains why the option is greyed out. Hope it is satisfactory! Thanks for your great work!!
+
+> I merged this patch, thank you! [[done]] --[[Joey]]

update
diff --git a/doc/todo/smudge.mdwn b/doc/todo/smudge.mdwn
index 32080fc..78a20fd 100644
--- a/doc/todo/smudge.mdwn
+++ b/doc/todo/smudge.mdwn
@@ -57,6 +57,8 @@ git-annex should use smudge/clean filters.
   be sorted out first; it would not do for git annex adjust to cause
   the whole work tree to be considered to be modified!
 
+  My enhanced smudge/clean patch set also fixes this problem.
+
 * When git runs the smudge filter, it buffers all its output in ram before
   writing it to a file. So, checking out a branch with a large v6 unlocked files
   can cause git to use a lot of memory.

devblog
diff --git a/doc/devblog/day_405__more_git_development.mdwn b/doc/devblog/day_405__more_git_development.mdwn
new file mode 100644
index 0000000..2a2485d
--- /dev/null
+++ b/doc/devblog/day_405__more_git_development.mdwn
@@ -0,0 +1,3 @@
+Revisited my enhanced smudge/clean patch set for git, updating it for code
+review and to deal with changes in git since I've been away. This took
+several hours unfortunately.

Added a comment
diff --git a/doc/todo/wishlist__58___optionally_print_key_in_output_of_checkpresentkey_batch_mode/comment_2_bb756ddf06c52ca52d73af319f0265b0._comment b/doc/todo/wishlist__58___optionally_print_key_in_output_of_checkpresentkey_batch_mode/comment_2_bb756ddf06c52ca52d73af319f0265b0._comment
new file mode 100644
index 0000000..b871a77
--- /dev/null
+++ b/doc/todo/wishlist__58___optionally_print_key_in_output_of_checkpresentkey_batch_mode/comment_2_bb756ddf06c52ca52d73af319f0265b0._comment
@@ -0,0 +1,14 @@
+[[!comment format=mdwn
+ username="magibney@908c3d4677b9e87e203538d4d5e8c296255749a0"
+ nickname="magibney"
+ subject="comment 2"
+ date="2016-07-11T18:45:10Z"
+ content="""
+Exactly: shell scripting, \"big list of keys and want to narrow it to only keys that are present or missing\". 
+
+My motivating use case is as a sanity check that all keys have been successfully transferred on a Ceph S3 instance internally (i.e., `s3cmd cp s3://sourcebucket/[annex-key] s3://destbucket/[annex-key]`, without being read back to the local machine and separately written back up to a different bucket on the same server and locally deleted).  Post-transfer, I want to check that all keys are present as expected, but in the event that a failed transfer is detected, I'd like to be able to report a specific key back to the operator/calling script. 
+
+I'm thinking that if one is running `checkpresentkey` in batch mode (with multiple keys at once), there are many useful things one might want to do with the output that would require associating output status indicators with input keys; and since the output of `checkpresentkey --batch` is so terse, it could optionally be extended without too much parsing/escaping/etc complication. 
+
+Thanks for considering this, and apologies that the initial request was a bit cryptic about the use case! 
+"""]]

Added a comment
diff --git a/doc/bugs/does_not_build_on_OpenBSD_5.9/comment_2_c6521306cbee2e398998cd2eec4e47ca._comment b/doc/bugs/does_not_build_on_OpenBSD_5.9/comment_2_c6521306cbee2e398998cd2eec4e47ca._comment
new file mode 100644
index 0000000..2466bd9
--- /dev/null
+++ b/doc/bugs/does_not_build_on_OpenBSD_5.9/comment_2_c6521306cbee2e398998cd2eec4e47ca._comment
@@ -0,0 +1,17 @@
+[[!comment format=mdwn
+ username="quisquous"
+ subject="comment 2"
+ date="2016-07-11T17:59:56Z"
+ content="""
+Perhaps running ````stack install git-annex```` (using the implicit global project) ignores the flags in stack.yaml, see [#1313](https://github.com/commercialhaskell/stack/issues/1313). Following your suggestion, I tried cloning the repo and building using `stack build` both with and without the XMPP flag. Without the flag works fine, it seems the default ````false```` setting form xmpp flag in stack.yaml is honored when building *this* way.
+
+In any case, this worked:
+
+````
+$ git clone git://git-annex.branchable.com/ git-annex
+$ cd git-annex
+$ git checkout 6.20160511
+$ stack build
+$ stack install
+````
+"""]]

Added a comment
diff --git a/doc/todo/git_annex_info_to_include_information_about_repo_version__63__/comment_4_5b3e45c746e6cfa7f511790bbd9f6c9f._comment b/doc/todo/git_annex_info_to_include_information_about_repo_version__63__/comment_4_5b3e45c746e6cfa7f511790bbd9f6c9f._comment
new file mode 100644
index 0000000..3d5860f
--- /dev/null
+++ b/doc/todo/git_annex_info_to_include_information_about_repo_version__63__/comment_4_5b3e45c746e6cfa7f511790bbd9f6c9f._comment
@@ -0,0 +1,10 @@
+[[!comment format=mdwn
+ username="https://me.yahoo.com/a/EbvxpTI_xP9Aod7Mg4cwGhgjrCrdM5s-#7c0f4"
+ subject="comment 4"
+ date="2016-07-11T17:25:28Z"
+ content="""
+> git doesn't provide any command that outputs the repo version AFAIK, so it's not a useful precedent.
+
+well -- exactly that -- `git version` DOES NOT output repos (its index or whatnot) version HERE. It only provides information about git's version
+Either there is some git command which outputs repo (index, ...) version is somewhat independent.  But ok -- I don't care much enough, can take version from git config I guess indeed, even though 'annex info' seems to be the most logical location for that information to be provided from as well IMHO ;-)
+"""]]

comment
diff --git a/doc/todo/git_annex_info_to_include_information_about_repo_version__63__/comment_3_d6e84551319439ba50bc10edbd25335c._comment b/doc/todo/git_annex_info_to_include_information_about_repo_version__63__/comment_3_d6e84551319439ba50bc10edbd25335c._comment
new file mode 100644
index 0000000..209f9bf
--- /dev/null
+++ b/doc/todo/git_annex_info_to_include_information_about_repo_version__63__/comment_3_d6e84551319439ba50bc10edbd25335c._comment
@@ -0,0 +1,11 @@
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 3"""
+ date="2016-07-11T16:52:33Z"
+ content="""
+git doesn't provide any command that outputs the repo version AFAIK, so
+it's not a useful precedent.
+
+Good point about --json. But, you can get the annex repo version 
+in machine parsable format using `git config annex.version`
+"""]]

response
diff --git a/doc/forum/Multiple_prefered_content_groups/comment_1_b401d234c0730412053f0f6a6f9cf2d6._comment b/doc/forum/Multiple_prefered_content_groups/comment_1_b401d234c0730412053f0f6a6f9cf2d6._comment
new file mode 100644
index 0000000..f47fe5e
--- /dev/null
+++ b/doc/forum/Multiple_prefered_content_groups/comment_1_b401d234c0730412053f0f6a6f9cf2d6._comment
@@ -0,0 +1,32 @@
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 1"""
+ date="2016-07-11T16:39:44Z"
+ content="""
+What git-annex actually does when a repository is in multiple groups
+is that the "standard" preferred content expression has no effect.
+Because this is an ambiguous configuration and it's not clear what you
+want.
+
+I don't think that you can combine preferred content expressions for
+multiple groups and always get behavior that makes sense. In particular,
+it seems likely that in some situations you'd want to combine them with AND
+but in other situations with OR.
+
+So, the best thing for you to do is probably to manually write a preferred
+content expression that clearly expresses what you want. Note that you
+can have a repository that's in the archive group, but instead of "standard"
+has its own custom preferred content expression. In your case, I think you
+want to do that; keeping the repository in the archive group will retain
+the behavior of other repositories dropping archived files once they reach
+it.
+
+Seems that for the preferred content setting for this repositry, you
+want the same one used for backup repositories, "anything".
+
+So:
+
+	git annex group . archive
+	git annex ungroup . backup
+	git anenx wanted . anything
+"""]]

comment
diff --git a/doc/todo/wishlist__58___optionally_print_key_in_output_of_checkpresentkey_batch_mode/comment_1_f95f2c92a46c1bd00c627aa19b08c875._comment b/doc/todo/wishlist__58___optionally_print_key_in_output_of_checkpresentkey_batch_mode/comment_1_f95f2c92a46c1bd00c627aa19b08c875._comment
new file mode 100644
index 0000000..db469b8
--- /dev/null
+++ b/doc/todo/wishlist__58___optionally_print_key_in_output_of_checkpresentkey_batch_mode/comment_1_f95f2c92a46c1bd00c627aa19b08c875._comment
@@ -0,0 +1,13 @@
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 1"""
+ date="2016-07-11T16:36:11Z"
+ content="""
+Hmm, my assumption is that use of checkpresentkey --batch is in some kind
+of loop, or function call, where you'd write a key to it, read a response
+back, and now you know whether that key is present.
+
+Does your use case involve something like shell scripting? I suppose if you
+have a big list of keys and want to narrow it to only keys that are present
+or missing, you could be trying to pipe it through checkpresentkey --batch.
+"""]]

followup
diff --git a/doc/bugs/v6_appears_to_not_thin.mdwn b/doc/bugs/v6_appears_to_not_thin.mdwn
index 2cadced..7ccf06d 100644
--- a/doc/bugs/v6_appears_to_not_thin.mdwn
+++ b/doc/bugs/v6_appears_to_not_thin.mdwn
@@ -1,3 +1,5 @@
+[[!meta title="v6 does not thin on hyperv"]]
+
 ### Please describe the problem.
 
 First of all, I don't really believe the following is a good bug report, from my own career in SW development. I know what to do. However, this is a start to test the waters; I received no response in the general forum (not a complaint), but I am not sure if this is simply one of those issues for which the solution is so simple, that no one can bring themselves to reply.
diff --git a/doc/bugs/v6_appears_to_not_thin/comment_4_bba7ba9c5b93fa33fc728daa0bb89497._comment b/doc/bugs/v6_appears_to_not_thin/comment_4_bba7ba9c5b93fa33fc728daa0bb89497._comment
new file mode 100644
index 0000000..c3d4833
--- /dev/null
+++ b/doc/bugs/v6_appears_to_not_thin/comment_4_bba7ba9c5b93fa33fc728daa0bb89497._comment
@@ -0,0 +1,31 @@
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 4"""
+ date="2016-07-11T16:23:57Z"
+ content="""
+Well, certinaly seems that hyperv is doing something to the environment
+that causes the problem. 
+
+I don't know anything about hyperv, so cannot venture an educated guess.
+But there are only three reasons that git-annex might not make hard links,
+assuming it's seeing the annex.thin setting:
+
+1. It thinks that the file already has a link count of more than 1.
+2. It tries to create a hard link, but that fails for some reason,
+   and so it falls back to a copy.
+3. It successfully creates a hard link, but code that tries to preserve
+   the mode of the file fails for some reason, and so it falls back to a
+   copy.
+
+Getting a `strace -v` might help narrow it down. Here for reference is a
+strace of the hard link successfully being made:
+
+	32624 stat(".git/annex/objects/P7/mF/SHA256E-s30--c5e0f3090f3658e908aa0a02bfc7eeb3e203c67c8ecd86c7acd501a32454ed6a/SHA256E-s30--c5e0f3090f3658e908aa0a02bfc7eeb3e203c67c8ecd86c7acd501a32454ed6a", {st_dev=makedev(8, 3), st_ino=3675012, st_mode=S_IFREG|0444, st_nlink=1, st_uid=1000, st_gid=1000, st_blksize=4096, st_blocks=8, st_size=30, st_atime=2016/07/11-12:30:25.203217806, st_mtime=2016/07/11-12:27:58.523091486, st_ctime=2016/07/11-12:30:25.207217809}) = 0
+	32624 link(".git/annex/objects/P7/mF/SHA256E-s30--c5e0f3090f3658e908aa0a02bfc7eeb3e203c67c8ecd86c7acd501a32454ed6a/SHA256E-s30--c5e0f3090f3658e908aa0a02bfc7eeb3e203c67c8ecd86c7acd501a32454ed6a", ".git/annex/misctmp/foo.0/foo") = 0
+	32624 stat(".git/annex/misctmp/foo.0/foo", {st_dev=makedev(8, 3), st_ino=3675012, st_mode=S_IFREG|0444, st_nlink=2, st_uid=1000, st_gid=1000, st_blksize=4096, st_blocks=8, st_size=30, st_atime=2016/07/11-12:30:25.203217806, st_mtime=2016/07/11-12:27:58.523091486, st_ctime=2016/07/11-12:30:49.819239094}) = 0
+	32624 stat(".git/annex/misctmp/foo.0/foo", {st_dev=makedev(8, 3), st_ino=3675012, st_mode=S_IFREG|0444, st_nlink=2, st_uid=1000, st_gid=1000, st_blksize=4096, st_blocks=8, st_size=30, st_atime=2016/07/11-12:30:25.203217806, st_mtime=2016/07/11-12:27:58.523091486, st_ctime=2016/07/11-12:30:49.819239094}) = 0
+	32624 chmod(".git/annex/misctmp/foo.0/foo", 0100644) = 0
+	32624 stat(".git/annex/objects/P7/mF/SHA256E-s30--c5e0f3090f3658e908aa0a02bfc7eeb3e203c67c8ecd86c7acd501a32454ed6a/SHA256E-s30--c5e0f3090f3658e908aa0a02bfc7eeb3e203c67c8ecd86c7acd501a32454ed6a", {st_dev=makedev(8, 3), st_ino=3675012, st_mode=S_IFREG|0644, st_nlink=2, st_uid=1000, st_gid=1000, st_blksize=4096, st_blocks=8, st_size=30, st_atime=2016/07/11-12:30:25.203217806, st_mtime=2016/07/11-12:27:58.523091486, st_ctime=2016/07/11-12:30:49.819239094}) = 0
+	32624 stat(".git/annex/misctmp/foo.0/foo", {st_dev=makedev(8, 3), st_ino=3675012, st_mode=S_IFREG|0644, st_nlink=2, st_uid=1000, st_gid=1000, st_blksize=4096, st_blocks=8, st_size=30, st_atime=2016/07/11-12:30:25.203217806, st_mtime=2016/07/11-12:27:58.523091486, st_ctime=2016/07/11-12:30:49.819239094}) = 0
+	32624 rename(".git/annex/misctmp/foo.0/foo", "foo") = 0
+"""]]

response
diff --git a/doc/bugs/does_not_build_on_OpenBSD_5.9/comment_1_e69ed5e0c9e474158da6764d27f67b67._comment b/doc/bugs/does_not_build_on_OpenBSD_5.9/comment_1_e69ed5e0c9e474158da6764d27f67b67._comment
new file mode 100644
index 0000000..5cac7c9
--- /dev/null
+++ b/doc/bugs/does_not_build_on_OpenBSD_5.9/comment_1_e69ed5e0c9e474158da6764d27f67b67._comment
@@ -0,0 +1,16 @@
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 1"""
+ date="2016-07-11T16:14:37Z"
+ content="""
+The build error suggests a problem with either the libidn.a library in
+openbsd, or the haskell bindings to it in gnuidn.
+
+A similar problem is discussed in [[More_build_oddities_under_OpenBSD]].
+
+Disabling XMPP support in git-annex makes it not need either library,
+so should avoid the problem. Eg: `stack build --flag git-annex:-XMPP`
+
+(Although AFAICS, XMPP support is disabled by default in stack.yaml anyway,
+so I am not sure why your stack build included it.)
+"""]]

diff --git a/doc/bugs/does_not_build_on_OpenBSD_5.9.mdwn b/doc/bugs/does_not_build_on_OpenBSD_5.9.mdwn
new file mode 100644
index 0000000..c1b8a46
--- /dev/null
+++ b/doc/bugs/does_not_build_on_OpenBSD_5.9.mdwn
@@ -0,0 +1,208 @@
+### Please describe the problem.
+
+git-annex will not build on OpenBSD 5.9-stable for amd64
+
+### What steps will reproduce the problem?
+
+$ stack install git-annex
+
+### What version of git-annex are you using? On what operating system?
+
+git-annex-6.20160511, the version from stack resolver lts-6.7
+
+### Please provide any additional information below.
+
+[[!format sh """
+$ stack install git-annex
+Run from outside a project, using implicit global project config
+git-annex-6.20160511: configure
+git-annex-6.20160511: build
+
+--  While building package git-annex-6.20160511 using:
+      /tmp/stack29275/git-annex-6.20160511/.stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/setup/setup --builddir=.stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0 build --ghc-options " -ddump-hi -ddump-to-file"
+    Process exited with code: ExitFailure 1
+    Logs have been written to: /home/scott/.stack/global-project/.stack-work/logs/git-annex-6.20160511.log
+
+    [ 1 of 32] Compiling Utility.FileSize ( Utility/FileSize.hs, /tmp/stack29275/git-annex-6.20160511/.stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/setup/Utility/FileSize.o )
+    [ 2 of 32] Compiling Utility.Process.Shim ( Utility/Process/Shim.hs, /tmp/stack29275/git-annex-6.20160511/.stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/setup/Utility/Process/Shim.o )
+    [ 3 of 32] Compiling Utility.Applicative ( Utility/Applicative.hs, /tmp/stack29275/git-annex-6.20160511/.stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/setup/Utility/Applicative.o )
+    [ 4 of 32] Compiling Utility.PosixFiles ( Utility/PosixFiles.hs, /tmp/stack29275/git-annex-6.20160511/.stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/setup/Utility/PosixFiles.o )
+    [ 5 of 32] Compiling Utility.Env      ( Utility/Env.hs, /tmp/stack29275/git-annex-6.20160511/.stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/setup/Utility/Env.o )
+    [ 6 of 32] Compiling Utility.UserInfo ( Utility/UserInfo.hs, /tmp/stack29275/git-annex-6.20160511/.stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/setup/Utility/UserInfo.o )
+    [ 7 of 32] Compiling Utility.OSX      ( Utility/OSX.hs, /tmp/stack29275/git-annex-6.20160511/.stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/setup/Utility/OSX.o )
+    [ 8 of 32] Compiling Utility.PartialPrelude ( Utility/PartialPrelude.hs, /tmp/stack29275/git-annex-6.20160511/.stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/setup/Utility/PartialPrelude.o )
+    [ 9 of 32] Compiling Utility.Data     ( Utility/Data.hs, /tmp/stack29275/git-annex-6.20160511/.stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/setup/Utility/Data.o )
+    [10 of 32] Compiling Utility.Exception ( Utility/Exception.hs, /tmp/stack29275/git-annex-6.20160511/.stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/setup/Utility/Exception.o )
+    [11 of 32] Compiling Utility.FileSystemEncoding ( Utility/FileSystemEncoding.hs, /tmp/stack29275/git-annex-6.20160511/.stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/setup/Utility/FileSystemEncoding.o )
+    [12 of 32] Compiling Utility.Tmp      ( Utility/Tmp.hs, /tmp/stack29275/git-annex-6.20160511/.stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/setup/Utility/Tmp.o )
+    [13 of 32] Compiling Utility.Monad    ( Utility/Monad.hs, /tmp/stack29275/git-annex-6.20160511/.stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/setup/Utility/Monad.o )
+    [14 of 32] Compiling Utility.Misc     ( Utility/Misc.hs, /tmp/stack29275/git-annex-6.20160511/.stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/setup/Utility/Misc.o )
+    [15 of 32] Compiling Utility.Process  ( Utility/Process.hs, /tmp/stack29275/git-annex-6.20160511/.stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/setup/Utility/Process.o )
+    [16 of 32] Compiling Utility.SafeCommand ( Utility/SafeCommand.hs, /tmp/stack29275/git-annex-6.20160511/.stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/setup/Utility/SafeCommand.o )
+    [17 of 32] Compiling Utility.Directory ( Utility/Directory.hs, /tmp/stack29275/git-annex-6.20160511/.stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/setup/Utility/Directory.o )
+    [18 of 32] Compiling Build.Version    ( Build/Version.hs, /tmp/stack29275/git-annex-6.20160511/.stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/setup/Build/Version.o )
+    [19 of 32] Compiling Utility.Network  ( Utility/Network.hs, /tmp/stack29275/git-annex-6.20160511/.stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/setup/Utility/Network.o )
+    [20 of 32] Compiling Utility.ExternalSHA ( Utility/ExternalSHA.hs, /tmp/stack29275/git-annex-6.20160511/.stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/setup/Utility/ExternalSHA.o )
+    [21 of 32] Compiling Utility.Path     ( Utility/Path.hs, /tmp/stack29275/git-annex-6.20160511/.stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/setup/Utility/Path.o )
+    [22 of 32] Compiling Build.TestConfig ( Build/TestConfig.hs, /tmp/stack29275/git-annex-6.20160511/.stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/setup/Build/TestConfig.o )
+    [23 of 32] Compiling Common           ( Common.hs, /tmp/stack29275/git-annex-6.20160511/.stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/setup/Common.o )
+    [24 of 32] Compiling Utility.DottedVersion ( Utility/DottedVersion.hs, /tmp/stack29275/git-annex-6.20160511/.stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/setup/Utility/DottedVersion.o )
+    [25 of 32] Compiling Git.Version      ( Git/Version.hs, /tmp/stack29275/git-annex-6.20160511/.stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/setup/Git/Version.o )
+    [26 of 32] Compiling Utility.FreeDesktop ( Utility/FreeDesktop.hs, /tmp/stack29275/git-annex-6.20160511/.stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/setup/Utility/FreeDesktop.o )
+    [27 of 32] Compiling Config.Files     ( Config/Files.hs, /tmp/stack29275/git-annex-6.20160511/.stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/setup/Config/Files.o )
+    [28 of 32] Compiling Assistant.Install.AutoStart ( Assistant/Install/AutoStart.hs, /tmp/stack29275/git-annex-6.20160511/.stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/setup/Assistant/Install/AutoStart.o )
+    [29 of 32] Compiling Assistant.Install.Menu ( Assistant/Install/Menu.hs, /tmp/stack29275/git-annex-6.20160511/.stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/setup/Assistant/Install/Menu.o )
+    [30 of 32] Compiling Build.Configure  ( Build/Configure.hs, /tmp/stack29275/git-annex-6.20160511/.stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/setup/Build/Configure.o )
+    [31 of 32] Compiling Build.DesktopFile ( Build/DesktopFile.hs, /tmp/stack29275/git-annex-6.20160511/.stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/setup/Build/DesktopFile.o )
+    [32 of 32] Compiling Main             ( /tmp/stack29275/git-annex-6.20160511/Setup.hs, /tmp/stack29275/git-annex-6.20160511/.stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/setup/Main.o )
+    Linking /tmp/stack29275/git-annex-6.20160511/.stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/setup/setup ...
+    /usr/local/lib/ghc/rts/libHSrts.a(RtsFlags.o): In function `copyArg':
+    
+    rts/RtsFlags.c:1685:0:
+         warning: warning: strcpy() is almost always misused, please use strlcpy()
+    /usr/local/lib/ghc/base_HQfYBxpPvuw8OunzQu6JGM/libHSbase-4.8.2.0-HQfYBxpPvuw8OunzQu6JGM.a(IO__1.o): In function `ghczuwrapperZC0ZCbaseZCSystemziIOZCrand':
+    (.text+0x1): warning: warning: rand() may return deterministic values, is that what you want?
+    /usr/local/lib/ghc/rts/libHSrts.a(RtsUtils.o): In function `showStgWord64':
+    
+    rts/RtsUtils.c:204:0:
+         warning: warning: sprintf() is often misused, please use snprintf()
+      checking version...fatal: Not a git repository (or any parent up to mount point /tmp)
+    Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
+     6.20160511
+      checking UPGRADE_LOCATION... not available
+      checking git... yes
+      checking git version... 2.7.0
+      checking cp -a... no
+      checking cp -p... yes
+      checking cp --preserve=timestamps... no
+      checking cp --reflink=auto... no
+      checking xargs -0... yes
+      checking rsync... yes
+      checking curl... yes
+      checking wget... yes
+      checking wget supports -q --show-progress... yes
+      checking bup... no
+      checking nice... yes
+      checking ionice... no
+      checking nocache... no
+      checking gpg... not available
+      checking lsof... not available
+      checking git-remote-gcrypt... not available
+      checking ssh connection caching... yes
+      checking sha1... not available
+      checking sha256... not available
+      checking sha512... not available
+      checking sha224... not available
+      checking sha384... not available
+    Configuring git-annex-6.20160511...
+    Linking /tmp/stack29275/git-annex-6.20160511/.stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/setup/setup ...
+    /usr/local/lib/ghc/rts/libHSrts.a(RtsFlags.o): In function `copyArg':
+    
+    rts/RtsFlags.c:1685:0:
+         warning: warning: strcpy() is almost always misused, please use strlcpy()
+    /usr/local/lib/ghc/base_HQfYBxpPvuw8OunzQu6JGM/libHSbase-4.8.2.0-HQfYBxpPvuw8OunzQu6JGM.a(IO__1.o): In function `ghczuwrapperZC0ZCbaseZCSystemziIOZCrand':
+    (.text+0x1): warning: warning: rand() may return deterministic values, is that what you want?
+    /usr/local/lib/ghc/rts/libHSrts.a(RtsUtils.o): In function `showStgWord64':
+    
+    rts/RtsUtils.c:204:0:
+         warning: warning: sprintf() is often misused, please use snprintf()
+    Building git-annex-6.20160511...
+    Preprocessing executable 'git-annex' for git-annex-6.20160511...
+    
+    /tmp/stack29275/git-annex-6.20160511/Assistant/Threads/MountWatcher.hs:35:0:
+         warning: #warning Building without dbus support; will use mtab polling
+    [  1 of 538] Compiling Utility.Dot      ( Utility/Dot.hs, .stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/build/git-annex/git-annex-tmp/Utility/Dot.o )
+    [  2 of 538] Compiling Utility.Mounts   ( Utility/Mounts.hs, .stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/build/git-annex/git-annex-tmp/Utility/Mounts.o )
+    [  3 of 538] Compiling Utility.SRV      ( Utility/SRV.hs, .stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/build/git-annex/git-annex-tmp/Utility/SRV.o )
+    [  4 of 538] Compiling BuildFlags       ( BuildFlags.hs, .stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/build/git-annex/git-annex-tmp/BuildFlags.o )
+    [  5 of 538] Compiling Utility.Yesod    ( Utility/Yesod.hs, .stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/build/git-annex/git-annex-tmp/Utility/Yesod.o )
+    [  6 of 538] Compiling Utility.Touch    ( Utility/Touch.hs, .stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/build/git-annex/git-annex-tmp/Utility/Touch.o )
+    [  7 of 538] Compiling Assistant.Types.BranchChange ( Assistant/Types/BranchChange.hs, .stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/build/git-annex/git-annex-tmp/Assistant/Types/BranchChange.o )
+    [  8 of 538] Compiling Assistant.Types.TransferSlots ( Assistant/Types/TransferSlots.hs, .stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/build/git-annex/git-annex-tmp/Assistant/Types/TransferSlots.o )
+    [  9 of 538] Compiling Assistant.Types.ThreadName ( Assistant/Types/ThreadName.hs, .stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/build/git-annex/git-annex-tmp/Assistant/Types/ThreadName.o )
+    [ 10 of 538] Compiling Utility.Tense    ( Utility/Tense.hs, .stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/build/git-annex/git-annex-tmp/Utility/Tense.o )
+    [ 11 of 538] Compiling Assistant.Types.Alert ( Assistant/Types/Alert.hs, .stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/build/git-annex/git-annex-tmp/Assistant/Types/Alert.o )
+    [ 12 of 538] Compiling Utility.OptParse ( Utility/OptParse.hs, .stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/build/git-annex/git-annex-tmp/Utility/OptParse.o )
+    [ 13 of 538] Compiling Utility.PID      ( Utility/PID.hs, .stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/build/git-annex/git-annex-tmp/Utility/PID.o )
+    [ 14 of 538] Compiling Utility.Shell    ( Utility/Shell.hs, .stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/build/git-annex/git-annex-tmp/Utility/Shell.o )
+    [ 15 of 538] Compiling Logs.TimeStamp   ( Logs/TimeStamp.hs, .stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/build/git-annex/git-annex-tmp/Logs/TimeStamp.o )
+    [ 16 of 538] Compiling Utility.JSONStream ( Utility/JSONStream.hs, .stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/build/git-annex/git-annex-tmp/Utility/JSONStream.o )
+    [ 17 of 538] Compiling Utility.HumanNumber ( Utility/HumanNumber.hs, .stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/build/git-annex/git-annex-tmp/Utility/HumanNumber.o )
+    [ 18 of 538] Compiling Utility.Percentage ( Utility/Percentage.hs, .stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/build/git-annex/git-annex-tmp/Utility/Percentage.o )
+    [ 19 of 538] Compiling Utility.Glob     ( Utility/Glob.hs, .stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/build/git-annex/git-annex-tmp/Utility/Glob.o )
+    [ 20 of 538] Compiling Utility.DataUnits ( Utility/DataUnits.hs, .stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/build/git-annex/git-annex-tmp/Utility/DataUnits.o )
+    [ 21 of 538] Compiling Types.Creds      ( Types/Creds.hs, .stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/build/git-annex/git-annex-tmp/Types/Creds.o )
+    [ 22 of 538] Compiling Assistant.Types.CredPairCache ( Assistant/Types/CredPairCache.hs, .stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/build/git-annex/git-annex-tmp/Assistant/Types/CredPairCache.o )
+    [ 23 of 538] Compiling Types.Availability ( Types/Availability.hs, .stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/build/git-annex/git-annex-tmp/Types/Availability.o )
+    [ 24 of 538] Compiling Utility.Bloom    ( Utility/Bloom.hs, .stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/build/git-annex/git-annex-tmp/Utility/Bloom.o )
+    [ 25 of 538] Compiling Utility.LockFile.LockStatus ( Utility/LockFile/LockStatus.hs, .stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/build/git-annex/git-annex-tmp/Utility/LockFile/LockStatus.o )
+    [ 26 of 538] Compiling Utility.QuickCheck ( Utility/QuickCheck.hs, .stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/build/git-annex/git-annex-tmp/Utility/QuickCheck.o )
+    
+    /tmp/stack29275/git-annex-6.20160511/Utility/QuickCheck.hs:19:1: Warning:
+        The qualified import of `Data.Map' is redundant
+          except perhaps to import instances from `Data.Map'
+        To import instances alone, use: import Data.Map()
+    
+    /tmp/stack29275/git-annex-6.20160511/Utility/QuickCheck.hs:20:1: Warning:
+        The qualified import of `Data.Set' is redundant
+          except perhaps to import instances from `Data.Set'
+        To import instances alone, use: import Data.Set()
+    [ 27 of 538] Compiling Types.DesktopNotify ( Types/DesktopNotify.hs, .stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/build/git-annex/git-annex-tmp/Types/DesktopNotify.o )
+    [ 28 of 538] Compiling Types.UUID       ( Types/UUID.hs, .stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/build/git-annex/git-annex-tmp/Types/UUID.o )
+    [ 29 of 538] Compiling Types.Group      ( Types/Group.hs, .stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/build/git-annex/git-annex-tmp/Types/Group.o )
+    [ 30 of 538] Compiling Types.BranchState ( Types/BranchState.hs, .stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/build/git-annex/git-annex-tmp/Types/BranchState.o )
+    [ 31 of 538] Compiling Utility.Process.Shim ( Utility/Process/Shim.hs, .stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/build/git-annex/git-annex-tmp/Utility/Process/Shim.o )
+    [ 32 of 538] Compiling Utility.FileSize ( Utility/FileSize.hs, .stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/build/git-annex/git-annex-tmp/Utility/FileSize.o )
+    [ 33 of 538] Compiling Utility.PosixFiles ( Utility/PosixFiles.hs, .stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/build/git-annex/git-annex-tmp/Utility/PosixFiles.o )
+    [ 34 of 538] Compiling Utility.Applicative ( Utility/Applicative.hs, .stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/build/git-annex/git-annex-tmp/Utility/Applicative.o )
+    [ 35 of 538] Compiling Utility.PartialPrelude ( Utility/PartialPrelude.hs, .stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/build/git-annex/git-annex-tmp/Utility/PartialPrelude.o )
+    [ 36 of 538] Compiling Utility.ThreadScheduler ( Utility/ThreadScheduler.hs, .stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/build/git-annex/git-annex-tmp/Utility/ThreadScheduler.o )
+    [ 37 of 538] Compiling Utility.HumanTime ( Utility/HumanTime.hs, .stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/build/git-annex/git-annex-tmp/Utility/HumanTime.o )
+    [ 38 of 538] Compiling Utility.Hash     ( Utility/Hash.hs, .stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/build/git-annex/git-annex-tmp/Utility/Hash.o )
+    [ 39 of 538] Compiling Utility.Env      ( Utility/Env.hs, .stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/build/git-annex/git-annex-tmp/Utility/Env.o )
+    [ 40 of 538] Compiling Utility.UserInfo ( Utility/UserInfo.hs, .stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/build/git-annex/git-annex-tmp/Utility/UserInfo.o )
+    [ 41 of 538] Compiling Utility.Verifiable ( Utility/Verifiable.hs, .stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/build/git-annex/git-annex-tmp/Utility/Verifiable.o )
+    [ 42 of 538] Compiling Utility.Format   ( Utility/Format.hs, .stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/build/git-annex/git-annex-tmp/Utility/Format.o )
+    [ 43 of 538] Compiling Build.SysConfig  ( Build/SysConfig.hs, .stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/build/git-annex/git-annex-tmp/Build/SysConfig.o )
+    [ 44 of 538] Compiling Config.Cost      ( Config/Cost.hs, .stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/build/git-annex/git-annex-tmp/Config/Cost.o )
+    [ 45 of 538] Compiling Types.Messages   ( Types/Messages.hs, .stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/build/git-annex/git-annex-tmp/Types/Messages.o )
+    [ 46 of 538] Compiling Types.TrustLevel ( Types/TrustLevel.hs, .stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/build/git-annex/git-annex-tmp/Types/TrustLevel.o )
+    [ 47 of 538] Compiling Types.Test       ( Types/Test.hs, .stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/build/git-annex/git-annex-tmp/Types/Test.o )
+    [ 48 of 538] Compiling Utility.Data     ( Utility/Data.hs, .stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/build/git-annex/git-annex-tmp/Utility/Data.o )
+    [ 49 of 538] Compiling Utility.Exception ( Utility/Exception.hs, .stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/build/git-annex/git-annex-tmp/Utility/Exception.o )
+    [ 50 of 538] Compiling Utility.FileMode ( Utility/FileMode.hs, .stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/build/git-annex/git-annex-tmp/Utility/FileMode.o )
+    [ 51 of 538] Compiling Git.FileMode     ( Git/FileMode.hs, .stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/build/git-annex/git-annex-tmp/Git/FileMode.o )
+    [ 52 of 538] Compiling Utility.FileSystemEncoding ( Utility/FileSystemEncoding.hs, .stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/build/git-annex/git-annex-tmp/Utility/FileSystemEncoding.o )
+    [ 53 of 538] Compiling Utility.Base64   ( Utility/Base64.hs, .stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/build/git-annex/git-annex-tmp/Utility/Base64.o )
+    [ 54 of 538] Compiling Utility.Tmp      ( Utility/Tmp.hs, .stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/build/git-annex/git-annex-tmp/Utility/Tmp.o )
+    [ 55 of 538] Compiling Database.Handle  ( Database/Handle.hs, .stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/build/git-annex/git-annex-tmp/Database/Handle.o )
+    [ 56 of 538] Compiling Utility.LockFile.Posix ( Utility/LockFile/Posix.hs, .stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/build/git-annex/git-annex-tmp/Utility/LockFile/Posix.o )
+    [ 57 of 538] Compiling Utility.DiskFree ( Utility/DiskFree.hs, .stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/build/git-annex/git-annex-tmp/Utility/DiskFree.o )
+    [ 58 of 538] Compiling Utility.Monad    ( Utility/Monad.hs, .stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/build/git-annex/git-annex-tmp/Utility/Monad.o )
+    [ 59 of 538] Compiling Utility.Misc     ( Utility/Misc.hs, .stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/build/git-annex/git-annex-tmp/Utility/Misc.o )
+    [ 60 of 538] Compiling Utility.Process  ( Utility/Process.hs, .stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/build/git-annex/git-annex-tmp/Utility/Process.o )
+    [ 61 of 538] Compiling Utility.SafeCommand ( Utility/SafeCommand.hs, .stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/build/git-annex/git-annex-tmp/Utility/SafeCommand.o )
+    [ 62 of 538] Compiling Git.Types        ( Git/Types.hs, .stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/build/git-annex/git-annex-tmp/Git/Types.o )
+    [ 63 of 538] Compiling Utility.Network  ( Utility/Network.hs, .stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/build/git-annex/git-annex-tmp/Utility/Network.o )
+    [ 64 of 538] Compiling Utility.Scheduled ( Utility/Scheduled.hs, .stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/build/git-annex/git-annex-tmp/Utility/Scheduled.o )
+    [ 65 of 538] Compiling Utility.Scheduled.QuickCheck ( Utility/Scheduled/QuickCheck.hs, .stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/build/git-annex/git-annex-tmp/Utility/Scheduled/QuickCheck.o )
+    [ 66 of 538] Compiling Utility.ExternalSHA ( Utility/ExternalSHA.hs, .stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/build/git-annex/git-annex-tmp/Utility/ExternalSHA.o )
+    [ 67 of 538] Compiling Utility.Directory ( Utility/Directory.hs, .stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/build/git-annex/git-annex-tmp/Utility/Directory.o )
+    [ 68 of 538] Compiling Utility.Path     ( Utility/Path.hs, .stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/build/git-annex/git-annex-tmp/Utility/Path.o )
+    [ 69 of 538] Compiling Common           ( Common.hs, .stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/build/git-annex/git-annex-tmp/Common.o )
+    [ 70 of 538] Compiling Git              ( Git.hs, .stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/build/git-annex/git-annex-tmp/Git.o )
+    [ 71 of 538] Compiling Git.Filename     ( Git/Filename.hs, .stack-work/dist/x86_64-openbsd/Cabal-1.22.5.0/build/git-annex/git-annex-tmp/Git/Filename.o )

(Diff truncated)
diff --git a/doc/forum/Multiple_prefered_content_groups.mdwn b/doc/forum/Multiple_prefered_content_groups.mdwn
new file mode 100644
index 0000000..f3b00fe
--- /dev/null
+++ b/doc/forum/Multiple_prefered_content_groups.mdwn
@@ -0,0 +1,66 @@
+Hello,
+
+I have a repo alpha
+
+```
+florian@asaru ~/git-annex % tree
+.
+└── alpha
+    ├── archive
+    │   └── some_archived_file
+    └── some_file
+```
+
+which is standard/client.
+
+Another repo beta, cloned from alpha is also standard/client. ```git annex sync --content``` makes beta get all the content. Perfect!
+
+Another repo delta, also cloned from alpha is:
+
+```
+% git annex wanted . && git annex group .
+standard
+archive backup
+```
+Manpage of git-annex-group says a repo could be in multiple groups.
+
+I expect the groups to be combined. archive makes the other repos drop content in archive/ when it has reached this repo, backup to also retain deleted files.
+
+But ```git annex sync --content``` gets no files:
+
+```
+florian@asaru ~/git-annex/delta (git)-[master] % git annex sync --content
+commit  
+Auf Branch master
+Ihr Branch ist auf dem selben Stand wie 'origin/master'.
+nichts zu committen, Arbeitsverzeichnis unverändert
+ok
+pull origin 
+ok
+```
+```
+florian@asaru ~/git-annex/delta (git)-[master] % git annex info          
+repository mode: indirect
+trusted repositories: 0
+semitrusted repositories: 5
+        00000000-0000-0000-0000-000000000001 -- web
+        00000000-0000-0000-0000-000000000002 -- bittorrent
+        19d4aafe-0d6d-4bb8-913d-6f0541a6ee11 -- Alpha [origin]
+        6da720cc-4583-429d-bde0-724b7f9e494a -- Delta [here]
+        8523418a-0c1b-4987-a048-c967fc5ec1e7 -- Beta
+untrusted repositories: 0
+transfers in progress: none
+available local disk space: 123.11 gigabytes (+1 megabyte reserved)
+local annex keys: 0
+local annex size: 0 bytes
+annexed files in working tree: 2
+size of annexed files in working tree: 2.59 megabytes
+bloom filter size: 32 mebibytes (0% full)
+backend usage: 
+        SHA256E: 2
+```
+
+What is wrong there? My mental model or some git-annex issue?
+
+Thanks,
+Florian

Added a comment: Hardlinks on hyperv VM
diff --git a/doc/bugs/v6_appears_to_not_thin/comment_3_69afd9bc3f250418ba33cb1abeb2078d._comment b/doc/bugs/v6_appears_to_not_thin/comment_3_69afd9bc3f250418ba33cb1abeb2078d._comment
new file mode 100644
index 0000000..2c95022
--- /dev/null
+++ b/doc/bugs/v6_appears_to_not_thin/comment_3_69afd9bc3f250418ba33cb1abeb2078d._comment
@@ -0,0 +1,8 @@
+[[!comment format=mdwn
+ username="Stan"
+ subject="Hardlinks on hyperv VM"
+ date="2016-07-08T00:27:11Z"
+ content="""
+I am actually able to manually create hardlinks on all of the VMs in the tests.
+I did so with files I created outside any git dirs.
+"""]]

Added a comment: Success / failure scenarios
diff --git a/doc/bugs/v6_appears_to_not_thin/comment_2_82ff17c4063791d91a4fbe4e31802595._comment b/doc/bugs/v6_appears_to_not_thin/comment_2_82ff17c4063791d91a4fbe4e31802595._comment
new file mode 100644
index 0000000..e6093c2
--- /dev/null
+++ b/doc/bugs/v6_appears_to_not_thin/comment_2_82ff17c4063791d91a4fbe4e31802595._comment
@@ -0,0 +1,82 @@
+[[!comment format=mdwn
+ username="Stan"
+ subject="Success / failure scenarios"
+ date="2016-07-07T23:29:19Z"
+ content="""
+Thanks again Joey. My progress is detailed below. I can run/collect more detailed scenarios if it will help.
+
+Summary:
+
+Success with a VM on qemu.
+Failure with VMs on hyperv.
+
+* Hardlinks are not created for the VMs on hyperv, in spite of the VM filesystems being ext4.
+* This may only be associative, and not causal, but it is somewhat surprising. Yet, I am no hardlink expert.
+* I can however make it work if I use a VM on qemu, so far; so that is very good.
+
+Setup:
+
+* mkdir gitx1
+* git init
+* git annex init --version=6
+* git config annex.thin true
+* git annex fix
+* copy bigfile to gitx1
+* git annex add bigfile
+* git commit -m add
+* ls -li
+
+Test Procedure:
+
+* unlock bigfile
+* ls -li
+
+Pass criteria:
+
+* ls -li shows 2 links and the inode matches the SHA file inode in annex/objects/
+* gitx1 dir size is equal to one bigfile
+
+
+Fail criteria:
+
+* ls -li shows 1 link and the inode numbers are different: working dir compared to annex/objects
+* gitx1 dir size is equal to 2 bigfiles.
+
+
+Scenario 1:
+
+* VM arch linux
+* git-annex: 6.20160613-g1e4e6f4
+* Host: Centos, qemu
+* gnome-disk-utility: QEMU HARDDISK (1.5.3)
+* partition: MBR
+* file system: ext4
+* Result: Pass
+
+
+Scenario 2:
+
+* VM arch linux
+* git-annex: 6.20160613-g1e4e6f4
+* Host: Win10, hyperv
+* gnome-disk-utility: Msft Virtual Disk (1.0)
+* partition: MBR
+* file system: ext4
+* Result: Fail
+
+
+Scenario 3:
+
+* VM Debian 8.5
+* git-annex: 6.20160524+gitg2b7b2c4-1~ndall+1
+* Host: Win10, hyperv
+* gnome-disk-utility: /dev/...vg/root
+* partition: lvm
+* file system: ext4
+* Result: Fail
+
+
+
+
+
+"""]]

removed
diff --git a/doc/bugs/v6_appears_to_not_thin/comment_2_439c4397c1f13ae00b7d815fd3c41b3c._comment b/doc/bugs/v6_appears_to_not_thin/comment_2_439c4397c1f13ae00b7d815fd3c41b3c._comment
deleted file mode 100644
index fac26be..0000000
--- a/doc/bugs/v6_appears_to_not_thin/comment_2_439c4397c1f13ae00b7d815fd3c41b3c._comment
+++ /dev/null
@@ -1,95 +0,0 @@
-[[!comment format=mdwn
- username="Stan"
- subject="Success / failure"
- date="2016-07-07T23:02:36Z"
- content="""
-Thanks again Joey. My progress is detailed below:
-
-Summary:
-
-Success with a VM on qemu.
-Failure with VMs on hyperv.
-
-Hardlinks are not created for the VMs on hyperv, in spite of the VM filesystems being ext4.
-This may only be associative, and not causal, but it is somewhat surprising. Yet, I am no hardlink expert.
-
-I can however make it work if I use a VM on qemu, so far; so that is very good.
-
-
-
-Setup:
-
-mkdir gitx1
-git init
-git annex init --version=6
-git config annex.thin true
-git annex fix
-
-copy bigfile to gitx1
-git annex add bigfile
-git commit -m add
-
-ls -li
-view results
-
-
-Test Procedure:
-
-unlock bigfile
-
-ls -li
-view results
-
-
-Pass criteria:
-
-ls -li shows 2 links and the inode matches the SHA file inode in annex/objects/
-gitx1 dir size is equal to one bigfile
-
-
-Fail criteria:
-
-ls -li shows 1 link and the inode numbers are different: working dir to annex/objects
-gitx1 dir size is equal to 2 bigfiles.
-
-
-Scenario 1:
-
-VM arch linux
-git-annex: 6.20160613-g1e4e6f4
-Host: Centos, qemu
-gnome-disk-utility: QEMU HARDDISK (1.5.3)
-partition: MBR
-filesystem: ext4
-
-Result: Pass
-
-
-Scenario 2:
-
-VM arch linux
-git-annex: 6.20160613-g1e4e6f4
-Host: Win10, hyperv
-gnome-disk-utility: Msft Virtual Disk (1.0)
-partition: MBR
-filesystem: ext4
-
-Result: Fail
-
-
-Scenario 3:
-
-VM Debian 8.5
-git-annex: 6.20160524+gitg2b7b2c4-1~ndall+1
-Host: Win10, hyperv
-gnome-disk-utility: /dev/...vg/root
-partition: lvm
-filesystem: ext4
-
-Result: Fail
-
-
-
-
-
-"""]]

Added a comment: Success / failure
diff --git a/doc/bugs/v6_appears_to_not_thin/comment_2_439c4397c1f13ae00b7d815fd3c41b3c._comment b/doc/bugs/v6_appears_to_not_thin/comment_2_439c4397c1f13ae00b7d815fd3c41b3c._comment
new file mode 100644
index 0000000..fac26be
--- /dev/null
+++ b/doc/bugs/v6_appears_to_not_thin/comment_2_439c4397c1f13ae00b7d815fd3c41b3c._comment
@@ -0,0 +1,95 @@
+[[!comment format=mdwn
+ username="Stan"
+ subject="Success / failure"
+ date="2016-07-07T23:02:36Z"
+ content="""
+Thanks again Joey. My progress is detailed below:
+
+Summary:
+
+Success with a VM on qemu.
+Failure with VMs on hyperv.
+
+Hardlinks are not created for the VMs on hyperv, in spite of the VM filesystems being ext4.
+This may only be associative, and not causal, but it is somewhat surprising. Yet, I am no hardlink expert.
+
+I can however make it work if I use a VM on qemu, so far; so that is very good.
+
+
+
+Setup:
+
+mkdir gitx1
+git init
+git annex init --version=6
+git config annex.thin true
+git annex fix
+
+copy bigfile to gitx1
+git annex add bigfile
+git commit -m add
+
+ls -li
+view results
+
+
+Test Procedure:
+
+unlock bigfile
+
+ls -li
+view results
+
+
+Pass criteria:
+
+ls -li shows 2 links and the inode matches the SHA file inode in annex/objects/
+gitx1 dir size is equal to one bigfile
+
+
+Fail criteria:
+
+ls -li shows 1 link and the inode numbers are different: working dir to annex/objects
+gitx1 dir size is equal to 2 bigfiles.
+
+
+Scenario 1:
+
+VM arch linux
+git-annex: 6.20160613-g1e4e6f4
+Host: Centos, qemu
+gnome-disk-utility: QEMU HARDDISK (1.5.3)
+partition: MBR
+filesystem: ext4
+
+Result: Pass
+
+
+Scenario 2:
+
+VM arch linux
+git-annex: 6.20160613-g1e4e6f4
+Host: Win10, hyperv
+gnome-disk-utility: Msft Virtual Disk (1.0)
+partition: MBR
+filesystem: ext4
+
+Result: Fail
+
+
+Scenario 3:
+
+VM Debian 8.5
+git-annex: 6.20160524+gitg2b7b2c4-1~ndall+1
+Host: Win10, hyperv
+gnome-disk-utility: /dev/...vg/root
+partition: lvm
+filesystem: ext4
+
+Result: Fail
+
+
+
+
+
+"""]]

diff --git a/doc/todo/wishlist__58___optionally_print_key_in_output_of_checkpresentkey_batch_mode.mdwn b/doc/todo/wishlist__58___optionally_print_key_in_output_of_checkpresentkey_batch_mode.mdwn
new file mode 100644
index 0000000..b1e63f1
--- /dev/null
+++ b/doc/todo/wishlist__58___optionally_print_key_in_output_of_checkpresentkey_batch_mode.mdwn
@@ -0,0 +1,3 @@
+For batch mode of `checkpresentkey`, it could be useful to have the option of outputting the key in a second (space- or tab-delimited?) column in addition to the `0/1` status indicator for that key; this could be useful for reporting, error recovery, or further key-specific action based on output. Presently it seems the only way to accomplish this would be to independently track corresponding input and output line indices, or externally join input and output (e.g., via the *nix `paste` command). 
+
+Thank you!

diff --git a/doc/forum/File_downloaded_again_and_again.mdwn b/doc/forum/File_downloaded_again_and_again.mdwn
new file mode 100644
index 0000000..c4e06be
--- /dev/null
+++ b/doc/forum/File_downloaded_again_and_again.mdwn
@@ -0,0 +1,53 @@
+Hello,
+
+I have two repos, asaru in group client, marduk in groups archive and backup. Both are wanted=standard.
+
+Doing a ```git annex sync --content``` at asaru takes a long time and does the same action every time I run it (even if ran consecutively):
+
+```
+florian@asaru ~/Documents (git)-[master] % git annex sync --content
+commit  
+Auf Branch master
+Ihr Branch ist auf dem selben Stand wie 'marduk/master'.
+nichts zu committen, Arbeitsverzeichnis unverändert
+ok
+pull marduk 
+ok
+pull marduk.dynv6 
+ok
+get .localized (from marduk...) 
+SHA256E-s0--e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
+              0 100%    0.00kB/s    0:00:00 (xfr#1, to-chk=0/1)
+(checksum...) ok
+get Bewerbung/bmw.aux (from marduk...) 
+SHA256E-s8--3345a075a22fb3bbc04567a1e5660ed0240d53f5881f458a2234dcd42a78d335.aux
+              8 100%    7.81kB/s    0:00:00 (xfr#1, to-chk=0/1)
+(checksum...) ok
+drop archive/Programmierung/zope/lib/python/Homefolder/.svn/empty-file (locking marduk.dynv6...) ok
+drop archive/Schule/Geschichte/Biographie 3/biographie.aux (locking marduk.dynv6...) ok
+pull marduk 
+ok
+pull marduk.dynv6 
+ok
+(recording state in git...)
+push marduk 
+Zähle Objekte: 8, Fertig.
+Delta compression using up to 4 threads.
+Komprimiere Objekte: 100% (8/8), Fertig.
+Schreibe Objekte: 100% (8/8), 679 bytes | 0 bytes/s, Fertig.
+Total 8 (delta 6), reused 0 (delta 0)
+To ssh://marduk.local/home/florian/Documents
+   bb9e640..b0fa6a1  git-annex -> synced/git-annex
+ok
+push marduk.dynv6 
+Everything up-to-date
+ok
+git annex sync --content  50,98s user 3,60s system 40% cpu 2:16,17 total
+```
+
+Taking a long time, as you can see in the last line. marduk.dynv6 and marduk are both (internet and local) remotes to Marduk.
+
+What is wrong here?
+
+Thanks,
+Florian

Added a comment
diff --git a/doc/todo/git_annex_info_to_include_information_about_repo_version__63__/comment_2_60d3b088de83c86243b19c3d0d050080._comment b/doc/todo/git_annex_info_to_include_information_about_repo_version__63__/comment_2_60d3b088de83c86243b19c3d0d050080._comment
new file mode 100644
index 0000000..4cf5c5f
--- /dev/null
+++ b/doc/todo/git_annex_info_to_include_information_about_repo_version__63__/comment_2_60d3b088de83c86243b19c3d0d050080._comment
@@ -0,0 +1,7 @@
+[[!comment format=mdwn
+ username="https://me.yahoo.com/a/EbvxpTI_xP9Aod7Mg4cwGhgjrCrdM5s-#7c0f4"
+ subject="comment 2"
+ date="2016-07-06T19:27:24Z"
+ content="""
+yikes, I never thought that 'git annex version', which works outside of repos as well, shows any information about the repository itself.  IMHO any such information should be within 'git annex info', not 'git annex version'  (does 'git version' show any repo specific version information? ;) )  Moreover there is no --json for 'annex version' ;)
+"""]]

devblog
diff --git a/doc/devblog/day_404__low_hanging_fruit.mdwn b/doc/devblog/day_404__low_hanging_fruit.mdwn
new file mode 100644
index 0000000..73f8ee7
--- /dev/null
+++ b/doc/devblog/day_404__low_hanging_fruit.mdwn
@@ -0,0 +1,15 @@
+Back from vacation, with a message backlog of 181. I'm concentrating first on
+low-hanging fruit of easily implemented todos, and well reproducible bugs,
+to get started again.
+
+Implemented --batch mode for `git annex get` and `git annex drop`, and also
+enabled --json for those.
+
+Investigated git-annex startup time; see
+<http://git-annex.branchable.com/todo/could_standalone___39__fixed__39___git-annex_binaries_be_prelinked__63__/>.
+Turns out that cabal has a bug that causes many thousands of unnecessary
+syscalls when linking in the shared libraries. Working around it halved
+git-annex's startup time.
+
+Fixed a bug that caused `git annex testremote` to crash when testing a
+freshly made external special remote.

cloe
diff --git a/doc/bugs/bind__58___resource_busy___40__Address_already_in_use__41__.mdwn b/doc/bugs/bind__58___resource_busy___40__Address_already_in_use__41__.mdwn
index 61f7cd8..c25e6c5 100644
--- a/doc/bugs/bind__58___resource_busy___40__Address_already_in_use__41__.mdwn
+++ b/doc/bugs/bind__58___resource_busy___40__Address_already_in_use__41__.mdwn
@@ -40,3 +40,4 @@ RemoteControl crashed: user error (nice ["ionice","-c3","/usr/bin/git-annex","re
 
 Yeah, for years! Thank you so much for it :-)
 
+> [[done]] --[[Joey]]

Remove the EKG build flag, since Gentoo for some reason decided to enable this flag, depsite it not being intended for production use and so enabled by default.
diff --git a/BuildFlags.hs b/BuildFlags.hs
index 769e8f3..3a73758 100644
--- a/BuildFlags.hs
+++ b/BuildFlags.hs
@@ -79,10 +79,6 @@ buildFlags = filter (not . null)
 #ifdef WITH_MAGICMIME
 	, "MagicMime"
 #endif
-#ifdef WITH_EKG
-#warning Building with EKG. This build of git-annex should only be used for performance debugging, not for production use..
-	, "EKG"
-#endif
 	-- Always enabled now, but users may be used to seeing these flags
 	-- listed.
 	, "Feeds"
diff --git a/CHANGELOG b/CHANGELOG
index 7eaf79b..d1f8cd0 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -9,6 +9,9 @@ git-annex (6.20160614) UNRELEASED; urgency=medium
   * Remove unnecessary rpaths in the git-annex binary, but only when
     it's built using make, not cabal. 
     This speeds up git-annex statup time by around 50%.
+  * Remove the EKG build flag, since Gentoo for some reason decided to
+    enable this flag, depsite it not being intended for production use and
+    so enabled by default.
 
  -- Joey Hess <id@joeyh.name>  Mon, 13 Jun 2016 21:52:24 -0400
 
diff --git a/CmdLine/GitAnnex.hs b/CmdLine/GitAnnex.hs
index c3049cf..e989f3f 100644
--- a/CmdLine/GitAnnex.hs
+++ b/CmdLine/GitAnnex.hs
@@ -119,9 +119,6 @@ import qualified Command.TestRemote
 #ifdef WITH_BENCHMARK
 import qualified Command.Benchmark
 #endif
-#ifdef WITH_EKG
-import System.Remote.Monitoring
-#endif
 
 cmds :: Parser TestOptions -> Maybe TestRunner -> [Command]
 cmds testoptparser testrunner = 
@@ -232,11 +229,7 @@ cmds testoptparser testrunner =
 	]
 
 run :: Parser TestOptions -> Maybe TestRunner -> [String] -> IO ()
-run testoptparser testrunner args = do
-#ifdef WITH_EKG
-	_ <- forkServer "localhost" 4242
-#endif
-	go envmodes
+run testoptparser testrunner args = go envmodes
   where
 	go [] = dispatch True args 
 		(cmds testoptparser testrunner)
diff --git a/doc/bugs/bind__58___resource_busy___40__Address_already_in_use__41__/comment_3_65488c9eacd5c007151e35504aab92c9._comment b/doc/bugs/bind__58___resource_busy___40__Address_already_in_use__41__/comment_3_65488c9eacd5c007151e35504aab92c9._comment
new file mode 100644
index 0000000..51181ad
--- /dev/null
+++ b/doc/bugs/bind__58___resource_busy___40__Address_already_in_use__41__/comment_3_65488c9eacd5c007151e35504aab92c9._comment
@@ -0,0 +1,11 @@
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 3"""
+ date="2016-07-06T19:08:10Z"
+ content="""
+Good greif, gentoo really does enable the ekg build flag.
+
+Well, I removed the flag, I guess I need to be careful with exposing build
+flags that are not for production use if there are distributions that
+enable every possible flag willy-nilly.
+"""]]
diff --git a/git-annex.cabal b/git-annex.cabal
index 82eeb68..872634c 100644
--- a/git-annex.cabal
+++ b/git-annex.cabal
@@ -292,10 +292,6 @@ Flag MagicMime
 Flag ConcurrentOutput
   Description: Use concurrent-output library
 
-Flag EKG
-  Description: Enable use of EKG to monitor git-annex as it runs (at http://localhost:4242/)
-  Default: False
-
 Flag Benchmark
   Description: Enable benchmarking
   Default: False
@@ -470,11 +466,6 @@ Executable git-annex
     Build-Depends: concurrent-output (>= 1.6)
     CPP-Options: -DWITH_CONCURRENTOUTPUT
 
-  if flag(EKG)
-    Build-Depends: ekg
-    GHC-Options: -with-rtsopts=-T
-    CPP-Options: -DWITH_EKG
-  
   if flag(Benchmark)
     Build-Depends: criterion, deepseq
     CPP-Options: -DWITH_BENCHMARK

EKG enabled on gentoo build??
diff --git a/BuildFlags.hs b/BuildFlags.hs
index db19372..769e8f3 100644
--- a/BuildFlags.hs
+++ b/BuildFlags.hs
@@ -80,6 +80,7 @@ buildFlags = filter (not . null)
 	, "MagicMime"
 #endif
 #ifdef WITH_EKG
+#warning Building with EKG. This build of git-annex should only be used for performance debugging, not for production use..
 	, "EKG"
 #endif
 	-- Always enabled now, but users may be used to seeing these flags
diff --git a/doc/bugs/bind__58___resource_busy___40__Address_already_in_use__41__/comment_2_69ae22ef702c1904124fe840cb531b47._comment b/doc/bugs/bind__58___resource_busy___40__Address_already_in_use__41__/comment_2_69ae22ef702c1904124fe840cb531b47._comment
new file mode 100644
index 0000000..65edc35
--- /dev/null
+++ b/doc/bugs/bind__58___resource_busy___40__Address_already_in_use__41__/comment_2_69ae22ef702c1904124fe840cb531b47._comment
@@ -0,0 +1,17 @@
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 2"""
+ date="2016-07-06T18:58:47Z"
+ content="""
+This looks suspiciously like git-annex has been built with the EKG flag
+enabled. That is disabled by default and only useful for debugging
+performace problems. When enabled, git-annex includes a EKG web server,
+so only one git-annex program can be run at once.
+
+Please file a bug on the gentoo package to get EKG turned off, if it is in
+fact enabled.
+
+You can check if it is by going to http://localhost:4242/ 
+while a git-annex command is running. Or, look at "git annex version"
+and see if EKG is included in the list of flags.
+"""]]

comment
diff --git a/doc/bugs/v6__58___git_status__47__add_after_unlock_is_linear_to_the_file_size/comment_2_7efc9b056b88fc7a75309a80445b5102._comment b/doc/bugs/v6__58___git_status__47__add_after_unlock_is_linear_to_the_file_size/comment_2_7efc9b056b88fc7a75309a80445b5102._comment
new file mode 100644
index 0000000..43f9b37
--- /dev/null
+++ b/doc/bugs/v6__58___git_status__47__add_after_unlock_is_linear_to_the_file_size/comment_2_7efc9b056b88fc7a75309a80445b5102._comment
@@ -0,0 +1,10 @@
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 2"""
+ date="2016-07-06T18:56:04Z"
+ content="""
+This problem is dicussed in detail in [[todo/smudge]] and is the main
+reason that v6 mode is not production ready.
+
+I have patches to git that avoid this problem.
+"""]]
diff --git a/doc/forum/How_to_improve_performance_with_v6_repos__63__/comment_2_93a6a0779f52bdd3de6e4d2500cfd223._comment b/doc/forum/How_to_improve_performance_with_v6_repos__63__/comment_2_93a6a0779f52bdd3de6e4d2500cfd223._comment
new file mode 100644
index 0000000..7e7d550
--- /dev/null
+++ b/doc/forum/How_to_improve_performance_with_v6_repos__63__/comment_2_93a6a0779f52bdd3de6e4d2500cfd223._comment
@@ -0,0 +1,10 @@
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 2"""
+ date="2016-07-06T18:57:15Z"
+ content="""
+This problem is dicussed in detail in [[todo/smudge]] and is the main
+reason that v6 mode is not production ready.
+
+I have patches to git that avoid this problem.
+"""]]

response
diff --git a/doc/forum/v5_to_v6_upgrade_strategy/comment_3_46fb3f5b0a7fa13b6f16ccb9832dac7e._comment b/doc/forum/v5_to_v6_upgrade_strategy/comment_3_46fb3f5b0a7fa13b6f16ccb9832dac7e._comment
new file mode 100644
index 0000000..189b50a
--- /dev/null
+++ b/doc/forum/v5_to_v6_upgrade_strategy/comment_3_46fb3f5b0a7fa13b6f16ccb9832dac7e._comment
@@ -0,0 +1,22 @@
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 3"""
+ date="2016-07-06T18:50:34Z"
+ content="""
+I'd encourage you to not upgrade any production repositories to v6 yet.
+It's still in beta state and has known problems. Currently all known
+problems are only innefficiencies, but there could also still be bugs.
+
+When you do upgrade, you can upgrade your distibuted set of repos
+peicemeal. v5 and v6 fully interoperate, until you start unlocking files in
+the v6 clones of the repo. Once those unlocks get committed, the v5 clones
+of the repo won't be able to access the unlocked file contents, and you'll
+need to upgrade the clones then.
+
+At some point in the future, I expect v6 mode to be done and then git-annex
+will automatically upgrade for you. So the easist approach is to just wait
+for that.
+
+(Not addressing your problems with annex.thin here as you filed a separate
+forum post and bug report about that.)
+"""]]