From e8839a4357b63ee04a00da34fc3150fb50a08bb7 Mon Sep 17 00:00:00 2001 From: reed Date: Sat, 12 Jan 2019 21:34:36 +0000 Subject: [PATCH 1/4] --- doc/forum/Sync_files_via_remote_server.mdwn | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 doc/forum/Sync_files_via_remote_server.mdwn diff --git a/doc/forum/Sync_files_via_remote_server.mdwn b/doc/forum/Sync_files_via_remote_server.mdwn new file mode 100644 index 0000000000..8f88433115 --- /dev/null +++ b/doc/forum/Sync_files_via_remote_server.mdwn @@ -0,0 +1,5 @@ +I have two local devices set up with the same remote server (a bare repo following https://git-annex.branchable.com/tips/centralized_git_repository_tutorial/on_your_own_server/) + +I can sync and move files to/from each device. But I can't see the files pushed by one device on the other (or vice-versa). + +So from desktop I sync file "a" and from android I sync file "b" but I can't do "git annex copy b --from origin" on the desktop. From 4de1aeacc28e3d9879cca1b4524dc72bb4d1736f Mon Sep 17 00:00:00 2001 From: jonas Date: Sun, 13 Jan 2019 12:28:21 +0000 Subject: [PATCH 2/4] --- ...opped_even_though_enough_copies_exist.mdwn | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 doc/forum/Old_versions_of_files_are_not_dropped_even_though_enough_copies_exist.mdwn diff --git a/doc/forum/Old_versions_of_files_are_not_dropped_even_though_enough_copies_exist.mdwn b/doc/forum/Old_versions_of_files_are_not_dropped_even_though_enough_copies_exist.mdwn new file mode 100644 index 0000000000..07df03ad56 --- /dev/null +++ b/doc/forum/Old_versions_of_files_are_not_dropped_even_though_enough_copies_exist.mdwn @@ -0,0 +1,43 @@ +When a changed version of a file is created after `git annex unlock && change-file && git annex add` the old file inside `.git/annex/objects` is retained and cannot be removed with `git annex drop`. +When I checkout a commit which has the old version of the file I can easily `git annex drop` it and then it also vanishes from `.git/annex/objects`. + +Look at the following script which reproduces the behavior. +Is this behavior intended? + +My use case is a big music library which does not fit onto my laptop. +So for updating the metadata in the files I basically run `git annex get && git annex unlock ` then update all files in that folder and then run `git annex add && git commit && git copy --to remote && git annex drop `. +This works perfectly but the problem is, that all old versions of changed files are retained in `.git/annex/objects` which in no time filled my drive to 100%. + +The script: + + #!/usr/bin/env bash + cd /tmp + git init client + cd client + git annex init + git annex numcopies 1 + dd if=/dev/zero of=zero bs=1M count=4 + git annex add zero + git commit -m 'Checkin' + cd .. + git clone client remote + cd client + git remote add remote ../remote + git annex sync + git annex copy --to remote + git annex drop zero + git annex get zero + git annex unlock zero + echo test >> zero + git annex add zero + git commit -m 'Update' + git annex copy --to remote + git annex drop zero + cd .. + tree {client,remote}/.git/annex/objects + cd client + git checkout master~ + git annex drop zero + git checkout master + cd .. + tree {client,remote}/.git/annex/objects From 2a6f8fa74a466e6300915b6ce922ba2b55cebc9e Mon Sep 17 00:00:00 2001 From: jonas Date: Sun, 13 Jan 2019 12:34:15 +0000 Subject: [PATCH 3/4] --- ...f_files_are_not_dropped_even_though_enough_copies_exist.mdwn | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/forum/Old_versions_of_files_are_not_dropped_even_though_enough_copies_exist.mdwn b/doc/forum/Old_versions_of_files_are_not_dropped_even_though_enough_copies_exist.mdwn index 07df03ad56..dc7ef44eec 100644 --- a/doc/forum/Old_versions_of_files_are_not_dropped_even_though_enough_copies_exist.mdwn +++ b/doc/forum/Old_versions_of_files_are_not_dropped_even_though_enough_copies_exist.mdwn @@ -8,6 +8,8 @@ My use case is a big music library which does not fit onto my laptop. So for updating the metadata in the files I basically run `git annex get && git annex unlock ` then update all files in that folder and then run `git annex add && git commit && git copy --to remote && git annex drop `. This works perfectly but the problem is, that all old versions of changed files are retained in `.git/annex/objects` which in no time filled my drive to 100%. +EDIT: As a clarification, I would expect git-annex to also drop the old versions of the file if enough copies exist… + The script: #!/usr/bin/env bash From ac9267a9a380e63ed4b76be1a7817c0b78b22693 Mon Sep 17 00:00:00 2001 From: "guzik.sergey@9391b6c15e4938a539e36fbe5bab71df07111d2e" Date: Sun, 13 Jan 2019 14:50:44 +0000 Subject: [PATCH 4/4] Added a comment --- ...ment_1_d43c3b97af1d9d2d4534b40a43567420._comment | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 doc/forum/Old_versions_of_files_are_not_dropped_even_though_enough_copies_exist/comment_1_d43c3b97af1d9d2d4534b40a43567420._comment diff --git a/doc/forum/Old_versions_of_files_are_not_dropped_even_though_enough_copies_exist/comment_1_d43c3b97af1d9d2d4534b40a43567420._comment b/doc/forum/Old_versions_of_files_are_not_dropped_even_though_enough_copies_exist/comment_1_d43c3b97af1d9d2d4534b40a43567420._comment new file mode 100644 index 0000000000..b467597216 --- /dev/null +++ b/doc/forum/Old_versions_of_files_are_not_dropped_even_though_enough_copies_exist/comment_1_d43c3b97af1d9d2d4534b40a43567420._comment @@ -0,0 +1,13 @@ +[[!comment format=mdwn + username="guzik.sergey@9391b6c15e4938a539e36fbe5bab71df07111d2e" + nickname="guzik.sergey" + avatar="http://cdn.libravatar.org/avatar/69073e903eefa0bc2755123b26441a2f" + subject="comment 1" + date="2019-01-13T14:50:44Z" + content=""" +The behaviour you described is intended, git annex preserves all versions of all files. Those old file are refered in git annex documentation as `unused`, so you can search for this term. Following are main commands: + +- [git annex unused](https://git-annex.branchable.com/git-annex-unused/) +- [git annex dropunused](https://git-annex.branchable.com/git-annex-dropunused/) +- [git annex drop --unused](https://git-annex.branchable.com/git-annex-drop/) +"""]]