From 9f6609d2b15dd7d1093cb3a9f6f3a4cd1c1782c3 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 17 Nov 2023 16:46:43 -0400 Subject: [PATCH] fixed --- ...--to_does_not_copy_if_present_locally.mdwn | 1 + ..._492d7c932fe5663aab916aacc829fb5d._comment | 27 +++++++++++++++++++ ..._8cfb9f2c14559a7574edd29b161cf7c7._comment | 19 +++++++++++++ 3 files changed, 47 insertions(+) create mode 100644 doc/bugs/copy_--from_--to_does_not_copy_if_present_locally/comment_3_492d7c932fe5663aab916aacc829fb5d._comment create mode 100644 doc/bugs/copy_--from_--to_does_not_copy_if_present_locally/comment_4_8cfb9f2c14559a7574edd29b161cf7c7._comment diff --git a/doc/bugs/copy_--from_--to_does_not_copy_if_present_locally.mdwn b/doc/bugs/copy_--from_--to_does_not_copy_if_present_locally.mdwn index 8c0eda44c9..af7a4e0da8 100644 --- a/doc/bugs/copy_--from_--to_does_not_copy_if_present_locally.mdwn +++ b/doc/bugs/copy_--from_--to_does_not_copy_if_present_locally.mdwn @@ -90,3 +90,4 @@ I didn't check `move` command but if it does support similar `--from --to` and h [[!tag projects/dandi]] +> [[fixed|done]] --[[Joey]] diff --git a/doc/bugs/copy_--from_--to_does_not_copy_if_present_locally/comment_3_492d7c932fe5663aab916aacc829fb5d._comment b/doc/bugs/copy_--from_--to_does_not_copy_if_present_locally/comment_3_492d7c932fe5663aab916aacc829fb5d._comment new file mode 100644 index 0000000000..a3d85237bf --- /dev/null +++ b/doc/bugs/copy_--from_--to_does_not_copy_if_present_locally/comment_3_492d7c932fe5663aab916aacc829fb5d._comment @@ -0,0 +1,27 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 3""" + date="2023-11-17T20:33:01Z" + content=""" +That bug I fixed would also explain the behavior that you saw if the +content *was* present locally, and the location log *was* out of date about +that. + +In that situation, git-annex sees that the object file is present, and so +treats the content as present, despite the location log not knowing it's +present. Which triggers the situation of the bug I fixed, causing it to +skip copying the file. + +Also, there's a pretty easy way to get into this situation. When the file +is not present, run `git-annex --from --to`. Then interrupt it after it's +downloaded the file --from but before it's finished sending it --to. +This results in the file being present locally, but only transiently so it +didn't update the location log. + +So my guess is you interrupted a copy like that (or it failed incomplete +for whatever reason). + +Now that I've fixed that bug, the behavior in that situation is that it +does copy the file to the remote. And then it drops the local copy since +the location log doesn't contain it. So it resumes correctly now. +"""]] diff --git a/doc/bugs/copy_--from_--to_does_not_copy_if_present_locally/comment_4_8cfb9f2c14559a7574edd29b161cf7c7._comment b/doc/bugs/copy_--from_--to_does_not_copy_if_present_locally/comment_4_8cfb9f2c14559a7574edd29b161cf7c7._comment new file mode 100644 index 0000000000..8afe914bd7 --- /dev/null +++ b/doc/bugs/copy_--from_--to_does_not_copy_if_present_locally/comment_4_8cfb9f2c14559a7574edd29b161cf7c7._comment @@ -0,0 +1,19 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 4""" + date="2023-11-17T20:42:24Z" + content=""" +So that leaves only the question of what it should do when +content is present locally but not on the --from remote. + +Another reason for the current behavior is to be symmetric with `git-annex +move --from foo --to bar`. It would be surprising, I think, if that +populated bar with files that are not present in foo, but are in the local +repository! + +So I'm inclined to not change the documented behavior. If you want to +populate a remote with files that are either in the local repo or in a +--from remote, you can just run `git-annex copy` twice after all. + +(Or there could be a new option like `git-annex copy --to bar --from foo --or-from-here`) +"""]]