diff --git a/doc/todo/clarify_that_v7_applies_to_all_clones/comment_7_55995a092e64f1f6d7454d4f9b75a553._comment b/doc/todo/clarify_that_v7_applies_to_all_clones/comment_7_55995a092e64f1f6d7454d4f9b75a553._comment new file mode 100644 index 0000000000..a65e8cafac --- /dev/null +++ b/doc/todo/clarify_that_v7_applies_to_all_clones/comment_7_55995a092e64f1f6d7454d4f9b75a553._comment @@ -0,0 +1,37 @@ +[[!comment format=mdwn + username="kyle" + avatar="http://cdn.libravatar.org/avatar/7d6e85cde1422ad60607c87fa87c63f3" + subject="comment 7" + date="2020-10-05T17:42:23Z" + content=""" +> - find a way for `find --unlocked` without invoking `git-annex`. + +Assuming you're interested in finding just the v6+ pointer files, +instead of also finding the uncommitted type changes for v5 unlocked +files, perhaps you could use something like this + +[[!format python \"\"\" +import subprocess as sp + +p_ls = sp.Popen([\"git\", \"ls-files\", \"--stage\"], stdout=sp.PIPE) +p_cat = sp.Popen([\"git\", \"cat-file\", \"--batch\"], stdin=sp.PIPE, stdout=sp.PIPE) +with p_ls: + with p_cat: + for line in p_ls.stdout: + info, fname = line.strip().split(b\"\t\") + mode, objid = info.split(b\" \")[:2] + if mode != b\"100644\": + continue + p_cat.stdin.write(objid + b\"\n\") + p_cat.stdin.flush() + out = p_cat.stdout.readline() + _, objtype, size = out.split() + size = int(size) + if size > 0: + content = p_cat.stdout.read(size) + if content.startswith(b\"/annex/objects/\"): + print(fname.decode()) + p_cat.stdout.readline() +\"\"\"]] + +"""]] diff --git a/doc/todo/clarify_that_v7_applies_to_all_clones/comment_8_842f3b0356ee1844d400a8fe564abab5._comment b/doc/todo/clarify_that_v7_applies_to_all_clones/comment_8_842f3b0356ee1844d400a8fe564abab5._comment new file mode 100644 index 0000000000..c0ddf2b44d --- /dev/null +++ b/doc/todo/clarify_that_v7_applies_to_all_clones/comment_8_842f3b0356ee1844d400a8fe564abab5._comment @@ -0,0 +1,20 @@ +[[!comment format=mdwn + username="yarikoptic" + avatar="http://cdn.libravatar.org/avatar/f11e9c84cb18d26a1748c33b48c924b4" + subject="comment 8" + date="2020-10-05T18:02:48Z" + content=""" +Thank you Kyle! I came up with + +```shell +unlocked=( `git grep -l -a --no-textconv --cached '^/annex/objects/' || :` ) +if [ \"${#unlocked[*]}\" -ge 1 ]; then + error \"Found ${#unlocked[*]} unlocked files. Cannot do: ${unlocked[*]}\" 2 +fi +``` + +do you think it would miss something? + +Here is my complete script ATM (didn't try in \"production\" yet, switched to other tasks for now but it is ready, also does some testing of operation at the end, so must not be applied as is to existing repos without commenting that out): http://www.onerussian.com/tmp/downgrade-annex + +"""]] diff --git a/doc/todo/clarify_that_v7_applies_to_all_clones/comment_9_600a47e0a1ed8fa43130308e0f9dfb6a._comment b/doc/todo/clarify_that_v7_applies_to_all_clones/comment_9_600a47e0a1ed8fa43130308e0f9dfb6a._comment new file mode 100644 index 0000000000..4e904e9cd0 --- /dev/null +++ b/doc/todo/clarify_that_v7_applies_to_all_clones/comment_9_600a47e0a1ed8fa43130308e0f9dfb6a._comment @@ -0,0 +1,9 @@ +[[!comment format=mdwn + username="kyle" + avatar="http://cdn.libravatar.org/avatar/7d6e85cde1422ad60607c87fa87c63f3" + subject="comment 9" + date="2020-10-05T18:09:03Z" + content=""" +Ah, I didn't think of using `git grep` for this. I think that's much +better than my suggestion. +"""]]