fix bug involving local git remote and out of date location log
authorJoey Hess <joeyh@joeyh.name>
Tue, 21 Apr 2020 16:36:58 +0000 (12:36 -0400)
committerJoey Hess <joeyh@joeyh.name>
Tue, 21 Apr 2020 16:36:58 +0000 (12:36 -0400)
commitcd1676d6048ff7307518df94ea22a23e711be29d
treef22e623fad1278bd3848f4f80158dc6130bc1f87
parent2f87c6db79ddda9315797b9b59c047a1583224ef
fix bug involving local git remote and out of date location log

get --from, move --from: When used with a local git remote, these used to
silently skip files that the location log thought were present on the
remote, when the remote actually no longer contained them. Since that
behavior could be surprising, now instead display a warning.

I got very confused when I encountered this behavior, since it was silently
skipping a file I needed that whereis said was on the remote.

get without --from already displayed a "unable to access these remotes"
message, which while a bit misleading in that the remote is likely
accessible, but just doesn't contain the file, at least indicated something
went wrong.

Having get --from display a warning makes it in line with get
w/o --from, so seems certianly ok. It might be there are situations where
move --from is used, on eg a whole directory, and the user only wants to
move whatever is present in the remote, and is perfectly ok with files
that are not present being skipped. So I'm less sure about the new warning
being ok there. OTOH, only local git remotes avoiding displaying a warning
in that case too, so this just brings them into line with other remotes.

(Also note that this makes it a little bit faster when dealing with a lot of
files, since it avoids a redundant stat of the file.)
CHANGELOG
Command/Move.hs
Remote/Git.hs
doc/bugs/get_behavior_when_location_log_is_out_of_date.mdwn