Please describe the problem.
i have an adb remote setup to import and export treeishes. Recently when I tried to import from my adb remote i was met with the follwing error
commit
On branch master
Your branch is ahead of 'seagate5tb/master' by 14 commits.
(use "git push" to publish your local commits)
nothing to commit, working tree clean
ok
list motoE5 find: bad arg '-printf'
See stat --help
stat: Needs 1 argument
git-annex: Unable to list contents of motoE5: adb find failed
failed
What steps will reproduce the problem?
- setup an adb special remote, enabling importtreeish and exporttreeish
- use the command "git annex sync --content -remoteName-
- it should fail with the above mentioned error
What version of git-annex are you using? On what operating system?
git-annex version: 10.20220504-g4e4c44ed8
build flags: Assistant Webapp Pairing Inotify DBus DesktopNotify TorrentParser MagicMime Feeds Testsuite S3 WebDAV
dependency versions: aws-0.22 bloomfilter-2.0.1.0 cryptonite-0.30 DAV-1.3.4 feed-1.3.2.1 ghc-9.0.2 http-client-0.7.11 persistent-sqlite-2.13.0.3 torrent-10000.1.1 uuid-1.3.15 yesod-1.6.2
key/value backends: SHA256E SHA256 SHA512E SHA512 SHA224E SHA224 SHA384E SHA384 SHA3_256E SHA3_256 SHA3_512E SHA3_512 SHA3_224E SHA3_224 SHA3_384E SHA3_384 SKEIN256E SKEIN256 SKEIN512E SKEIN512 BLAKE2B256E BLAKE2B256 BLAKE2B512E BLAKE2B512 BLAKE2B160E BLAKE2B160 BLAKE2B224E BLAKE2B224 BLAKE2B384E BLAKE2B384 BLAKE2BP512E BLAKE2BP512 BLAKE2S256E BLAKE2S256 BLAKE2S160E BLAKE2S160 BLAKE2S224E BLAKE2S224 BLAKE2SP256E BLAKE2SP256 BLAKE2SP224E BLAKE2SP224 SHA1E SHA1 MD5E MD5 WORM URL X*
remote types: git gcrypt p2p S3 bup directory rsync web bittorrent webdav adb tahoe glacier ddar git-lfs httpalso borg hook external
operating system: linux x86_64
supported repository versions: 8 9 10
upgrade supported from repository versions: 0 1 2 3 4 5 6 7 8 9 10
local repository version: 8
Please provide any additional information below.
# If you can, paste a complete transcript of the problem occurring here.
# If the problem is with the git-annex assistant, paste in .git/annex/daemon.log
git annex sync --content motoE5 130 ↵ ──(Mon,Jul11)─┘
commit
On branch master
Your branch is ahead of 'seagate5tb/master' by 14 commits.
(use "git push" to publish your local commits)
nothing to commit, working tree clean
ok
list motoE5 find: bad arg '-printf'
See stat --help
stat: Needs 1 argument
git-annex: Unable to list contents of motoE5: adb find failed
failed
# End of transcript or log.
after it fails, i use ctrl-c to break out of the command in fear of it messing up the current state of the tree that is exported to my android device
also it appears that someone else is having this issue as well, but they posted it in the comment section of the adb remote tutorial page instead of filing a bug report
http://git-annex.branchable.com/tips/android_sync_with_adb/#comment-88511cef6861a2ab4d2da8b38d52dd64
Have you had any luck using git-annex before? (Sometimes we get tired of reading bug reports all day and a lil' positive end note does wonders)
git annex has been great so far, aside from some pitfalls on some of the more advanced features, i have been using it to manage my files using all kinds of special and non special remotes very solidly for 2 years now.
How unfortunate that Android on your phone does not support
find -printf
. What version of Android is that? I've tested a few and they do support it.Reverting a32ff6cef03ceb695af7bc6415ae7eaac06d3443 would certainly avoid this problem. But that commit did solve a bug in supporting large numbers of files.
Android's find is (probably) from toybox, and looking at its changelog,
find -printf
was added in May 2019, version 0.8.1. So versions of Android before 2020 or so will probably have too old a version.Maybe git-annex should have an option for older versions of android that falls back to using
find -exec stat {} ;
. That would be a lot slower, since it would run stat once per file, but it would work. Or it could fall back to the oldfind +
behavior that is limited to a certain number of files. Or, it could consume thefind
output, segment it into groups of files itself, and runadb stat
on each group. Which would be somewhat slower than using xargs, and potentially hard to get right.Ok, I've added an oldandroid=yes configuration to fix this. To enable it:
(Replace "android" with whatever name you used for the adb remote.)
I don't much like this, but it's better than git-annex being slow with new phones, and being slow with old phones is better than failing when there are too many files to import. I did consider trying to auto-probe it from the error message, but that seemed likely to be too fragile.