+git-annex (10.20220128) UNRELEASED; urgency=medium
+
+ * adb: Avoid find failing with "Argument list too long"
+
+ -- Joey Hess <id@joeyh.name> Mon, 31 Jan 2022 13:14:42 -0400
+
git-annex (10.20220127) upstream; urgency=medium
* New v10 repository version (with v9 as a stepping-stone to it).
-- won't recurse into the directory
, File $ fromAndroidPath adir ++ "/"
, Param "-type", Param "f"
- , Param "-exec", Param "stat"
- , Param "-c", Param statformat
- , Param "{}", Param "+"
+ , Param "-printf", Param "%p\\0"
]
- (if ignorefinderror then "|| true" else "")
+ (\s -> concat
+ [ "set -o pipefail; "
+ , s
+ , "| xargs -0 stat -c " ++ shellEscape statformat ++ " --"
+ , if ignorefinderror then " || true" else ""
+ ]
+ )
ignorefinderror = fromMaybe False (getRemoteConfigValue ignorefinderrorField c)
--
-- Any stdout from the command is returned, separated into lines.
adbShell :: AndroidSerial -> [CommandParam] -> Annex (Maybe [String])
-adbShell serial cmd = adbShell' serial cmd ""
+adbShell serial cmd = adbShell' serial cmd id
-adbShell' :: AndroidSerial -> [CommandParam] -> String -> Annex (Maybe [String])
-adbShell' serial cmd extra = adbShellRaw serial $
- (unwords $ map shellEscape (toCommand cmd)) ++ extra
+adbShell' :: AndroidSerial -> [CommandParam] -> (String -> String) -> Annex (Maybe [String])
+adbShell' serial cmd f = adbShellRaw serial $
+ f (unwords $ map shellEscape (toCommand cmd))
adbShellBool :: AndroidSerial -> [CommandParam] -> Annex Bool
adbShellBool serial cmd =
### 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)
This is the first time I've tried it. However, when I restricted the path to /sdcard/DCIM or /sdcard/Music, I didn't have any problems. I could use some assistance regarding how to "copy" a file from one path to another inside an annex. It appears that I could try to resolve and then symlink to the same file, or maybe unlock, copy, and commit both copies of the file. E.g. I'd like to have a copy of the music from my primary "annex/Music" into the "annex/android/Music" tree, then "git rm" the file from "annex/android/Music" when I'm done with it.
+
+> [[fixed|done]] --[[Joey]]
--- /dev/null
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 1"""
+ date="2022-01-31T16:45:55Z"
+ content="""
+Ah so unfortunately android's `find` does not break the command
+runs by arrgument size like xargs does. So the `+` argument
+can't be used, instead I'll make it pipe through xargs.
+
+(To copy a file, you can use `cp -a` or just `cp`, followed by `git-annex
+add`. either will work.)
+"""]]