diff --git a/CHANGELOG b/CHANGELOG index 26cf448afb..25d9480e8f 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -4,6 +4,10 @@ git-annex (6.20180510) UNRELEASED; urgency=medium * Don't allow entering a view with staged or unstaged changes. * Workaround for bug in an old version of cryptonite that broke https downloads, by using curl for downloads when git-annex is built with it. + * move: --force was accidentially enabling two unrelated behaviors + since 6.20180427. The older behavior, which has never been well + documented and seems almost entirely useless, has been removed. + * copy: --force no longer does anything. -- Joey Hess Mon, 14 May 2018 13:42:41 -0400 diff --git a/Command/Move.hs b/Command/Move.hs index 529dbb0e68..2f3079207e 100644 --- a/Command/Move.hs +++ b/Command/Move.hs @@ -186,15 +186,13 @@ fromStart removewhen afile key ai src = case removewhen of next $ fromPerform src removewhen key afile fromOk :: Remote -> Key -> Annex Bool -fromOk src key = go =<< Annex.getState Annex.force +fromOk src key + | Remote.hasKeyCheap src = + either (const checklog) return =<< haskey + | otherwise = checklog where - go True = either (const $ return True) return =<< haskey - go False - | Remote.hasKeyCheap src = - either (const expensive) return =<< haskey - | otherwise = expensive haskey = Remote.hasKey src key - expensive = do + checklog = do u <- getUUID remotes <- Remote.keyPossibilities key return $ u /= Remote.uuid src && elem src remotes diff --git a/doc/bugs/g-a_move_has_force_option_described_twice/comment_2_71eed2cf7fd21634a2b60ef5cd9ccb93._comment b/doc/bugs/g-a_move_has_force_option_described_twice/comment_2_71eed2cf7fd21634a2b60ef5cd9ccb93._comment new file mode 100644 index 0000000000..daa49e540c --- /dev/null +++ b/doc/bugs/g-a_move_has_force_option_described_twice/comment_2_71eed2cf7fd21634a2b60ef5cd9ccb93._comment @@ -0,0 +1,32 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 2""" + date="2018-05-21T17:04:56Z" + content=""" +Actually the --force documentation re location tracking is not a good +description of the behavior. It only affects --from, and with --force +it still contacts the remote to check if it has the content. Only +if that check fails to return a result (ie, the remote can't be contacted), +does it assume that the remote has the content, rather than the default +behavior of falling back to looking at the location tracking information. + +It's hard to see how that could be useful at all; if it fails in +communication with the remote, presumably the content transfer will later +fail as well. + +The only actual behavior change would be when the remote cannot be +contacted, and the location tracking information says it does not contain a +file. Then `move --force --from remote` will fail, because it tries +to perform the move and can't contact the remote, while `move --from +remote` will succeed, because it assumes the location tracking is right. + +That does not seem a useful distinction. And that was the behavior all the +way back to the first commit of this "feature" in 2013. + +So, removing that. + +---- + +There may be room for a new option that actually does whatever you were +hoping --force did. So let's talk about that.. +"""]] diff --git a/doc/git-annex-copy.mdwn b/doc/git-annex-copy.mdwn index be082ffa01..fedeaa067e 100644 --- a/doc/git-annex-copy.mdwn +++ b/doc/git-annex-copy.mdwn @@ -46,12 +46,6 @@ Copies the content of files from or to another remote. already has content. This can be faster, but might skip copying content to the remote in some cases. -* `--force` - - When copying content from a remote, ignore location tracking information - and always check if the remote has content. Can be useful if the location - tracking information is out of date. - * `--all` `-A` Rather than specifying a filename or path to copy, this option can be diff --git a/doc/git-annex-move.mdwn b/doc/git-annex-move.mdwn index 1a5aa7aaa3..661edba1d9 100644 --- a/doc/git-annex-move.mdwn +++ b/doc/git-annex-move.mdwn @@ -69,12 +69,6 @@ Moves the content of files from or to another remote. already has content. This can be faster, but might skip moving content to the remote in some cases. -* `--force` - - When moving content from a remote, ignore location tracking information - and always check if the remote has content. Can be useful if the location - tracking information is out of date. - * file matching options The [[git-annex-matching-options]](1)