remove the older move --force, which never behaved as documented and seems useless

* 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.

This commit was sponsored by Øyvind Andersen Holm.
This commit is contained in:
Joey Hess 2018-05-21 13:20:40 -04:00
parent ca6f5be284
commit 2fabd7cdb5
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
5 changed files with 41 additions and 19 deletions

View file

@ -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 <id@joeyh.name> Mon, 14 May 2018 13:42:41 -0400

View file

@ -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

View file

@ -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..
"""]]

View file

@ -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

View file

@ -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)