Couldn't you use the existing info --batch for the same purpose?
batching find has the problem that it can output any number of lines
(0 for a non-annexed file, 1 for an annexed file, N for a directory). So,
the consumer has no way to tell when it reaches the end of output. So some
additional thing would be needed to indicate end of output.
info -- nope, since it returns the same success and size = 0 bytes for a 0-length file which is under annex regardless either its precious load is present locally or not
$> git annex find empty
$> git annex info --json empty
{"command":"info empty","file":"empty","size":"0 bytes","key":"SHA256E-s0--e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","success":true}
$> git annex get empty
get empty (from web...)/tmp/123/.git/annex/tmp/SHA256E-s0--e3b0c44298fc1c149af [ <=> ]0--.-KB/s in0s
(checksum...) ok
(recording state in git...)
$> git annex info --json empty
{"command":"info empty","file":"empty","size":"0 bytes","key":"SHA256E-s0--e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","success":true}
I could use whereis (--batch is TODO for it as well) and analyze output either any remote claims it to be "here" though.
you caught me! indeed in this case we could use 'info' for that purpose. But if we decide if content is present under annex (which is what actually our function does, we just used it for determining "if under annex" after addurl) -- then find --batch would be needed, or whois --batch could be used. So we are both correct!
Couldn't you use the existing info --batch for the same purpose?
batching find has the problem that it can output any number of lines (0 for a non-annexed file, 1 for an annexed file, N for a directory). So, the consumer has no way to tell when it reaches the end of output. So some additional thing would be needed to indicate end of output.
info -- nope, since it returns the same success and size = 0 bytes for a 0-length file which is under annex regardless either its precious load is present locally or not
I could use whereis (--batch is TODO for it as well) and analyze output either any remote claims it to be "here" though.
You were talking about determining if a file is in git-annex or git, and git-annex info can do that.