Recent comments posted to this site:
Following the instructions above, when issuing:
git annex initremote googledrive type=external externaltype=googledrive encryption=shared folder=gitannex
googleannexdrive fails and I get:
initremote googledrive (encryption setup) (encryption key stored in git repository) No handlers could be found for logger "oauth2client.util"
git-annex: You need to set OAUTH environment variables and folder and encryption parameters when running initremote.
Am I making some obvious mistake?
If not, I'd like to share my positive experience with git-annex-remote-rclone (https://github.com/DanielDent/git-annex-remote-rclone), which wraps rclone (https://rclone.org) that supports Google Drive: it worked for me.
Hello
it took me some time to figure out how to exclude directories matching a specific structure within the .gitattributes file:
**/some_dir/**/below_this_dir_is_everything_in_plane_text/**/* annex.largefiles=nothing
Maybe it helps someone else. (In case this way is the intended way)
I want to use a recent git-annex
version, and I prefer a Docker solution to a binary. There wasn't much documentation on how to do that, so here are the steps I took, just in case anybody finds this information useful. This is not a complete guide, just more than I was able to find so far.
Install Docker so that you can access it (eg,
docker info
) withoutsudo
. (Beyond the scope in here.)Create a git-annex image as follows:
Dockerfile:
FROM debian:unstable
RUN apt-get update && apt-get install -y ssh git man git-annex=6.20160511-1
# maybe install gpg2, other remotes, etc
#RUN apt-get install -y gnupg2 && ln -s /usr/bin/gpg2 /usr/local/bin/gpg
#RUN apt-get install -y golang-go && GOPATH=/usr/local go get github.com/encryptio/git-annex-remote-b2
VOLUME /data
WORKDIR /data
Build image and run basic test:
docker build -t git-annex-6.20160511-1 .
docker run -it --rm git-annex-6.20160511-1 git-annex version
You still need to:
- On host: Replace
git-annex
by a script that invokes the Dockerized version. - In container:
- Use non-root uids, otherwise you end up creating files with uid 0.
- Access
ssh
andgpg
credentials on host. - Access
~/.gitconfig
on host. - Mount
git
repository root as a volume, not just the current dir. - Access AWS/B2 credentials, if applicable.
- On host: Replace
Here is a sample script that achieves these. Name it git-annex
, and place it in your PATH
before the host git-annex
(or just uninstall the latter).
#!/bin/bash
CONT_NAME=${CONT_NAME:-git-annex-6.20160511-1}
# if in git repo, mount root as /data, and cd into relative subdir
# if not, mount cwd as /data
abs_dir=$(readlink -e .)
root_dir=$(git rev-parse --show-toplevel 2>/dev/null || true)
root_dir=${root_dir:-$abs_dir}
rel_dir=${abs_dir#$root_dir}
# if run by git, assume command is git-annex
# otherwise, don't assume, to allow other uses
cmd=
! [ "$(basename "$(readlink -e /proc/$PPID/exe)")" = "git" ] || cmd=git-annex
exec docker run -it --rm \
-u $(id -u):$(id -g) \
-v /etc/passwd:/etc/passwd:ro \
-v $HOME/.ssh:$HOME/.ssh \
-v $HOME/.gnupg:$HOME/.gnupg \
-v $HOME/.gitconfig:$HOME/.gitconfig \
-v "$root_dir":/data \
${AWS_ACCESS_KEY_ID:+-e AWS_ACCESS_KEY_ID="$AWS_ACCESS_KEY_ID"} \
${AWS_SECRET_ACCESS_KEY:+-e AWS_SECRET_ACCESS_KEY="$AWS_SECRET_ACCESS_KEY"} \
${B2_ACCOUNT_ID:+-e B2_ACCOUNT_ID="$B2_ACCOUNT_ID"} \
${B2_APP_KEY:+-e B2_APP_KEY="$B2_APP_KEY"} \
-w /data"$rel_dir" \
$CONT_NAME $cmd "$@"
Actually you do want to exclude "cover.jpg" from being annexed because it will allow you to view the covers of all your books without getting them. Keeping metadata.opf out of annex is not that important because you cannot safely edit the metadata without getting the books first.
It would be great to teach Calibre to see broken symlinks as normal zero length files and work with them accordingly. And we do need a Calibre plugin with buttons "annex get" and "annex unlock".
Looks like it's not possible to set the annex cost of the "web" and "bittorrent" special remotes annex cost.
This doesn't seem to work:
[remote "web"] annex-cost = 500
Perhaps, because these remotes don't actually exist.
Setting annex cost for a webdav remote works but is incremented by 50 for some reason.
Hmm, guyz? Are you serious with these scripts?
- git rm -r --cached large_files
files are indexed as both removed and untracked and are still in place
- commit the changes
files are seen as untracked
- git annex add large_files
files are replaced with symlinks and are in the index
- commit changes again
Make sure that you don't have annex.largefiles settings that would prevent annexing the files.
The hash directories for a key can be looked up by passing the key to
git annex examinekey --format '${hashdirlower}\n'
Format appears to be /BASE_DIR/xxx/yyy/FILEKEY/FILEKEY
How can I get the xxx/yyy or the complete storage path of an annexed file in a fast way?
Background:
I have to "chmod" the xxx/yyy within an '.git/hooks/pre-commit' action (shared used NFS location).
Following way using 'find' needs too much time in case of a big remote:
$ git annex info --fast inputbinaries | grep 'directory:' | awk '{print $2}'
/gitworkspace/inputbinaries/DWDM1830-all_playground
$ git annex info vendor-libs/x86/libsnmpdm.a | grep 'key:' | awk '{print $2}'
SHA256E-s3992448--82604383354b28f8efcdf8d83bb63607a8d5967551ded055e782ac342bb7f8e0.a
$ find /gitworkspace/inputbinaries/DWDM1830-all_playground -type f -name SHA256E-s3992448--82604383354b28f8efcdf8d83bb63607a8d5967551ded055e782ac342bb7f8e0.a
/gitworkspace/inputbinaries/DWDM1830-all_playground/28e/785/SHA256E-s3992448--82604383354b28f8efcdf8d83bb63607a8d5967551ded055e782ac342bb7f8e0.a/SHA256E-s3992448--82604383354b28f8efcdf8d83bb63607a8d5967551ded055e782ac342bb7f8e0.a
Please open todo items for patches, don't send them as comments here.
(I suspect that the patch as provided might break compilation with old versions of ghc, or old versions of yesod..)