tips/replacing Sparkleshare or dvcs-autosync with the assistantgit-annexhttp://git-annex.branchable.com/tips/replacing_Sparkleshare_or_dvcs-autosync_with_the_assistant/git-annexikiwiki2013-12-12T19:58:53Zsoftware from the future?http://git-annex.branchable.com/tips/replacing_Sparkleshare_or_dvcs-autosync_with_the_assistant/comment_1_907e4032ca4a39adb846cf16dbf447dc/hands2013-11-27T22:47:37Z2013-03-31T17:30:34Z
I think you probably meant at least version 4.20130323 <img src="http://git-annex.branchable.com/smileys/smile4.png" alt=";-)" />
comment 2http://git-annex.branchable.com/tips/replacing_Sparkleshare_or_dvcs-autosync_with_the_assistant/comment_2_902d001ba86657ef0f8cca5b175f99ca/joey2013-11-27T22:47:37Z2013-03-31T18:50:35Z
I meant 4.20130329
Trying this featurehttp://git-annex.branchable.com/tips/replacing_Sparkleshare_or_dvcs-autosync_with_the_assistant/comment_3_a1cf93f9b29658f0f26e9e0ae6057ee3/Tobias2013-11-27T22:47:37Z2013-04-14T13:04:55Z
<p>I just gave this feature a try, but it seems it doesn't work as expected or maybe I don't understand it:</p>
<pre><code>~/annex/largefilestest % git init
~/annex/largefilestest (git)-[master] % git annex init "test repo"
~/annex/largefilestest (git)-[master] % git config annex.largefiles "not include=*.txt"
</code></pre>
<p>Now I copy two files to this directory and add both to the annex</p>
<pre><code>~/annex/largefilestest (git)-[master] % ll
total 100
-rw-rw-r-- 1 tobru tobru 93709 Oct 19 16:14 dpkg-get-selections.txt
-rw-rw-r-- 1 tobru tobru 7256 Jan 6 15:52 x3400.jpg
~/annex/largefilestest (git)-[master] % git annex add .
add x3400.jpg (checksum...) ok
(Recording state in git...)
~/annex/largefilestest (git)-[master] % git status
# On branch master
#
# Initial commit
#
# Changes to be committed:
# (use "git rm --cached <file>..." to unstage)
#
# new file: x3400.jpg
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# dpkg-get-selections.txt
~/annex/largefilestest (git)-[master] % ll
total 96
-rw-rw-r-- 1 tobru tobru 93709 Oct 19 16:14 dpkg-get-selections.txt
lrwxrwxrwx 1 tobru tobru 192 Jan 6 15:52 x3400.jpg -> .git/annex/objects/vf/QX/SHA256E-s7256--60e5b69ade5619e37f7fcaa964626da9c415959d861241aa13e2516fffc2dddf.jpg/SHA256E-s7256--60e5b69ade5619e37f7fcaa964626da9c415959d861241aa13e2516fffc2dddf.jpg
</code></pre>
<p>So the picture is added to the annex as expected. But the .txt file is not added to git. Do I have to manually add this to git? And why is the picture seen as new file by git?</p>
<p>The second question could be answered by: "run git annex sync". Is this correct? Because after running this command, git does not see this file as a new file anymore:</p>
<pre><code>~/annex/largefilestest (git)-[master] % git annex sync
commit
[master (root-commit) a0afb14] git-annex automatic sync
1 file changed, 1 insertion(+)
create mode 120000 x3400.jpg
ok
git-annex: no branch is checked out
~/annex/largefilestest (git)-[master] % git status
# On branch master
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# dpkg-get-selections.txt
nothing added to commit but untracked files present (use "git add" to track)
</code></pre>
comment 4http://git-annex.branchable.com/tips/replacing_Sparkleshare_or_dvcs-autosync_with_the_assistant/comment_4_e10671908b58c554375787d0f76e2366/joey2013-11-27T22:47:37Z2013-04-14T18:37:50Z
<p>Like it says in the tip, <code>git annex add</code> will add the large files to git. You can add the small files with <code>git add</code>; git-annex won't do that for you.</p>
<p>To automatically add both sorts of files, you can use the <code>git annex watch</code> or <code>git annex assistant</code> daemons. The latter also keeps files in sync between repositories automatically.</p>
<p>(Why did the picture show up as a new file in git? Because you hadn't committed it. This is the same as when you <code>git add</code> a file;
it's only staged in the index; <code>git status</code> will show it is new until you <code>git commit</code>)</p>
mimetypeshttp://git-annex.branchable.com/tips/replacing_Sparkleshare_or_dvcs-autosync_with_the_assistant/comment_5_4114380f66b6376c851e93f6876d590b/Tobias2013-11-27T22:47:37Z2013-05-01T20:37:33Z
Does <code>annex.largefiles</code> support mimetypes? F.e. <code>git config annex.largefiles "not mimetype=text/plain"</code>
annex.largefiles and direct modehttp://git-annex.branchable.com/tips/replacing_Sparkleshare_or_dvcs-autosync_with_the_assistant/comment_6_6a5d6af107b297afd008b021f73d787b/binet2013-11-27T22:47:37Z2013-09-16T22:50:48Z
I was wondering if the annex.largefiles feature was compatible with direct mode?
comment 7http://git-annex.branchable.com/tips/replacing_Sparkleshare_or_dvcs-autosync_with_the_assistant/comment_7_74d57cf503a86d8f7ace2d769dbb58be/joeyh.name2013-11-27T22:47:37Z2013-09-19T18:03:29Z
<p>annex.largefiles does not support mime types. I agree it would be a useful addition.</p>
<p>annex.largefiles can be used with direct mode. I would only recommending using it this way using the assistant, which will keep straight which files are which and commit them appropriately.</p>
Disappearing fileshttp://git-annex.branchable.com/tips/replacing_Sparkleshare_or_dvcs-autosync_with_the_assistant/comment_8_85765c0cfeb5b326c06cf60c98147cbf/Marc2013-12-08T12:16:37Z2013-12-08T12:16:37Z
<p>I've tried this with version 5.20131130, but my files disappear if I modify them on the remote end.</p>
<p>My setup:
- A local repository, direct mode, client group, annex.largefiles "exclude=<em>.txt"
- A remote one, also direct mode, backup group, annex.largefiles "exclude=</em>.txt"
Both are running the assistant.</p>
<p>If I create a .txt file locally, it gets committed and pushed to the remote as described. But, if I then modify that file on the remote end, the file gets deleted from both repositories. Also, if I create a file on the remote end, it's pushed to the local one (according to the log) but it never appears in the directory.</p>
<p>Changing the remote from 'backup' to 'client' group doesn't seem to make any difference.</p>
<p>Is there a 'best practice' on using git-annex like SparkleShare? I mean, syncing changes on all repositories but keeping a history of changes in git.</p>
<p>Thanks!</p>
comment 9http://git-annex.branchable.com/tips/replacing_Sparkleshare_or_dvcs-autosync_with_the_assistant/comment_9_082b5d90ffc836e7c86e40b63a75780d/Marc2013-12-08T20:41:45Z2013-12-08T20:41:41Z
After further testing, it seems that the setup I wanted works when both repos are set as indirect, instead of direct as comment 7 recommends. With both repos in indirect mode, the changes are propagated correctly and the files not selected by annex.largefiles are kept in git.
comment 10http://git-annex.branchable.com/tips/replacing_Sparkleshare_or_dvcs-autosync_with_the_assistant/comment_10_d1bd5d6b33951f6d11185bb4a8228269/joeyh.name2013-12-12T17:35:28Z2013-12-12T17:35:28Z
The behavior is direct mode is a bug: <span class="createlink"><a href="http://git-annex.branchable.com/ikiwiki.cgi?do=create&from=tips%2Freplacing_Sparkleshare_or_dvcs-autosync_with_the_assistant%2Fcomment_10_d1bd5d6b33951f6d11185bb4a8228269&page=bugs%2Fwhen_syncing_a_direct_repository__44___git_annex_delete_non_annexed_new_git_files" rel="nofollow">?</a>when syncing a direct repository, git annex delete non annexed new git files</span>. Hopefully it will be fixed soon.
comment 11http://git-annex.branchable.com/tips/replacing_Sparkleshare_or_dvcs-autosync_with_the_assistant/comment_11_54692ebf854ecbcc5314bb29c33ecc66/joeyh.name2013-12-12T19:58:53Z2013-12-12T19:58:53Z
The abovementioned bug is fixed in git, and will be in a release tomorrow.