diff --git a/doc/bugs/Drop_files_with_the_same_checksum..mdwn b/doc/bugs/Drop_files_with_the_same_checksum..mdwn new file mode 100644 index 0000000000..e22e1f18d4 --- /dev/null +++ b/doc/bugs/Drop_files_with_the_same_checksum..mdwn @@ -0,0 +1,30 @@ +### Please describe the problem. +When two identical files are annexed and one of them is dropped, both files are gone (one dangling symlink is left). This may be intentional (the checksums are the same after all), but then is there a way to drop one of the files? + +### What steps will reproduce the problem? + + mkdir annex + cd annex + git init + git annex init + mkdir a b + dd if=/dev/urandom of=a/data.bin count=2048 + cp a/data.bin b + git annex add a/data.bin b/data.bin + git commit -m "Added raw data." + git annex drop --force a/data.bin + file b/data.bin + +### What version of git-annex are you using? On what operating system? + +git-annex version: 5.20140831+b1 +build flags: Assistant Webapp Webapp-secure Pairing Testsuite S3 WebDAV Inotify DBus DesktopNotify XMPP DNS Feeds Quvi TDFA CryptoHash +key/value backends: SHA256E SHA1E SHA512E SHA224E SHA384E SKEIN256E SKEIN512E SHA256 SHA1 SHA512 SHA224 SHA384 SKEIN256 SKEIN512 WORM URL +remote types: git gcrypt S3 bup directory rsync web webdav tahoe glacier ddar hook external +local repository version: 5 +supported repository version: 5 + +Distributor ID: Debian +Description: Debian GNU/Linux testing (jessie) +Release: testing +Codename: jessie diff --git a/doc/bugs/annex_get_fails_from_read-only_filesystem.mdwn b/doc/bugs/annex_get_fails_from_read-only_filesystem.mdwn new file mode 100644 index 0000000000..43efc382c3 --- /dev/null +++ b/doc/bugs/annex_get_fails_from_read-only_filesystem.mdwn @@ -0,0 +1,24 @@ +### Please describe the problem. + +annex get does not work from read-only file systems... + +### What steps will reproduce the problem? + + $ git annex get --from=... + error: could not lock config file /.../Annex/.git/config: Read-only file system + get ... (from ...) error: could not lock config file .../Annex/.git/config: Read-only file system + git [Param "config",Param "annex.version",Param "5"] failed + failed + +### What version of git-annex are you using? On what operating system? + +annex.version = 3 in the remote + + $ git annex version + git-annex version: 5.20140927 + build flags: Assistant Webapp Webapp-secure Pairing Testsuite S3 WebDAV Inotify DBus DesktopNotify XMPP DNS Feeds Quvi TDFA CryptoHash + key/value backends: SHA256E SHA1E SHA512E SHA224E SHA384E SKEIN256E SKEIN512E SHA256 SHA1 SHA512 SHA224 SHA384 SKEIN256 SKEIN512 WORM URL + remote types: git gcrypt S3 bup directory rsync web webdav tahoe glacier ddar hook external + local repository version: 5 + supported repository version: 5 + upgrade supported from repository versions: 0 1 2 4 diff --git a/doc/bugs/git_clone_ignores_annex.mdwn b/doc/bugs/git_clone_ignores_annex.mdwn new file mode 100644 index 0000000000..7c6b7bbfa3 --- /dev/null +++ b/doc/bugs/git_clone_ignores_annex.mdwn @@ -0,0 +1,23 @@ +### Please describe the problem. + +More of a feature request than a bug. It would be nice if when creating a local clone with git clone this would run automatically: + +ln -s ../../annex/.git/annex .git/annex + +to hook up the annex. Just a minor thing, but I'd be nice. + +### What steps will reproduce the problem? + + +### What version of git-annex are you using? On what operating system? + + +### Please provide any additional information below. + +[[!format sh """ +# If you can, paste a complete transcript of the problem occurring here. +# If the problem is with the git-annex assistant, paste in .git/annex/daemon.log + + +# End of transcript or log. +"""]] diff --git a/doc/forum/Android_version_does_not_sync/comment_3_2a4efec37015ea44509e7ed16b36a72d._comment b/doc/forum/Android_version_does_not_sync/comment_3_2a4efec37015ea44509e7ed16b36a72d._comment new file mode 100644 index 0000000000..71c5b91d19 --- /dev/null +++ b/doc/forum/Android_version_does_not_sync/comment_3_2a4efec37015ea44509e7ed16b36a72d._comment @@ -0,0 +1,13 @@ +[[!comment format=mdwn + username="https://www.google.com/accounts/o8/id?id=AItOawnjX_O_VChwfDjcKlcRHbc2Aah8aYQlqts" + nickname="Ludovic" + subject="comment 3" + date="2014-10-05T11:01:39Z" + content=""" +I have the same problem. +I checked again, removed the previous annex/ directory and created a new annex repository from the webapp. No annex/.git/index file is created. + +I then add a remore ssh server. The synchronisation fails with the error in the log: \"/storage/emulated/legacy/annex/.git/index: copyFile: does not exist (No such file or directory).\" + +Running \"git annex sync\" solved the problem. +"""]] diff --git a/doc/forum/Broken_symlinks_remain_after_drop.mdwn b/doc/forum/Broken_symlinks_remain_after_drop.mdwn new file mode 100644 index 0000000000..bc24049010 --- /dev/null +++ b/doc/forum/Broken_symlinks_remain_after_drop.mdwn @@ -0,0 +1,7 @@ +This is a newb question. I don't know whether this is a bug or the way git-annex is intended to function. + +I have two annex repos connected to each other. My idea was to have the first repository add files, which would then be moved to the second repository for storage. After moving, repo1 would be empty again, empty and clean of any symlinks. + +But after I 'git-annex move * --to repo2' broken symlinks remain in repo1. I don't want any broken/unused symlinks to remain in repo1 for object data it doesn't currently have (even if those files remain in the repository itself). + +Is there a way I can clean/remove broken symlinks to object data when those objects aren't present, so the directory only contains symlinks when the repo currently has the object data for those files? diff --git a/doc/forum/Equivalent_to_git_bundle__63__/comment_2_2b8b5c237d8572fdd27202f3502bea96._comment b/doc/forum/Equivalent_to_git_bundle__63__/comment_2_2b8b5c237d8572fdd27202f3502bea96._comment new file mode 100644 index 0000000000..167353df3e --- /dev/null +++ b/doc/forum/Equivalent_to_git_bundle__63__/comment_2_2b8b5c237d8572fdd27202f3502bea96._comment @@ -0,0 +1,13 @@ +[[!comment format=mdwn + username="tdussa" + ip="217.84.78.25" + subject="tar -- not really" + date="2014-10-03T20:40:45Z" + content=""" +Hi, + +THX for your suggestion. Unfortunately, git bundle is able to carve out particular slices of a repo, which a simple tar obviously cannot do. This functionality is much desired. + +Cheers, +Toby. +"""]] diff --git a/doc/forum/Is_there_a_way_to_get_back_to_clean-state_after_unworking_annex_assistant_configuration_attempt__63__/comment_1_d77fbbbe3a7438a1e79f175df1f69ef3._comment b/doc/forum/Is_there_a_way_to_get_back_to_clean-state_after_unworking_annex_assistant_configuration_attempt__63__/comment_1_d77fbbbe3a7438a1e79f175df1f69ef3._comment new file mode 100644 index 0000000000..8dc0692e63 --- /dev/null +++ b/doc/forum/Is_there_a_way_to_get_back_to_clean-state_after_unworking_annex_assistant_configuration_attempt__63__/comment_1_d77fbbbe3a7438a1e79f175df1f69ef3._comment @@ -0,0 +1,17 @@ +[[!comment format=mdwn + username="https://www.google.com/accounts/o8/id?id=AItOawldUCypSR21BObbzC0Uf8NVd1vZnjYlXZc" + nickname="Adam" + subject="Ok, found it :-)" + date="2014-10-04T10:11:55Z" + content=""" +I think I found reliable although a bit excessive way to get back to clean state: + +1. stop all the running daemons +2. on android, remove folder git-annex.home +3. on linux, remove ~/.config/git-annex and ~/.ssh/git-annex +4. on both attempted repositories I removed .git folder +5. I removed everything I have stored on rsync.net + +Then I re-did the steps on good wifi network an plugged in to power source on both devices :-) +It seems that important step is to wait for the annex to share the remote repo with the other device (took ~5 minutes) +"""]] diff --git a/doc/tips/Synology_NAS_and_git_annex/comment_2_5e723ccf026fe970ad31207f9f036b69._comment b/doc/tips/Synology_NAS_and_git_annex/comment_2_5e723ccf026fe970ad31207f9f036b69._comment new file mode 100644 index 0000000000..60122bb137 --- /dev/null +++ b/doc/tips/Synology_NAS_and_git_annex/comment_2_5e723ccf026fe970ad31207f9f036b69._comment @@ -0,0 +1,30 @@ +[[!comment format=mdwn + username="https://www.google.com/accounts/o8/id?id=AItOawllyDAwjTPuM6G2d3eKE481V0qGXRKtF8s" + nickname="Pieter" + subject="Syncing metadata only with Synology NAS and git annex" + date="2014-10-06T12:03:35Z" + content=""" +I am not able to get full syncing working. It says \"syncing enabled (metadata only)\". +When I click on Actions -> Edit it says: + +Just a git repository. + +This repository is not currently set up as a git annex; only git metadata is synced with this repository. + +If this repository's ssh server has git-annex installed, you can upgrade this repository to a full git annex, which will store the contents of your files, not only their metadata. + +When I try to upgrade the repository it does not work. The log says: + +sh: git-annex-shell: not found + +rsync: connection unexpectedly closed (0 bytes received so far) [sender] + +rsync error: remote command not found (code 127) at io.c(226) [sender=3.1.1] + +I'm using Version: 5.20140717 on the Linux Ubuntu 14.10. + +Ssh'ing from Ubuntu to gituser@synology works fine and shows the git-annex-shell options + +Any ideas? + +"""]] diff --git a/doc/tips/dumb_metadata_extraction_from_xbmc.mdwn b/doc/tips/dumb_metadata_extraction_from_xbmc.mdwn index 652c37e5bd..e3611ec30b 100644 --- a/doc/tips/dumb_metadata_extraction_from_xbmc.mdwn +++ b/doc/tips/dumb_metadata_extraction_from_xbmc.mdwn @@ -20,7 +20,7 @@ Or just show the files that haven't been played yet: git annex view playCount=0 -Use `git checkout master` to reset the view. Note that the above will flatten the tree hierarchy, which you may not way. Try this in that case: +Use `git checkout master` to reset the view. Note that the above will flatten the tree hierarchy, which you may not want. Try this in that case: git annex view playCount=0 films/=* diff --git a/doc/tips/dumb_metadata_extraction_from_xbmc/git-annex-xbmc-playcount.pl b/doc/tips/dumb_metadata_extraction_from_xbmc/git-annex-xbmc-playcount.pl index 3e2bd9bce0..85b97188f1 100644 --- a/doc/tips/dumb_metadata_extraction_from_xbmc/git-annex-xbmc-playcount.pl +++ b/doc/tips/dumb_metadata_extraction_from_xbmc/git-annex-xbmc-playcount.pl @@ -1,45 +1,227 @@ #! /usr/bin/perl -w -# we want to operate on relative links, so set this to the common prefix -# to the git annex repo -my $prefix="/home/media/video/"; -# this is the directory for the XBMC database -my $path = '/home/video/.xbmc/userdata/Database/'; +use Getopt::Long; +use Pod::Usage; -# no user-serviceable parts below +my $help = 0; +my $usage = 0; +my $dryrun = 0; +my $verbose = 0; +my $path = ''; +my $annex = ''; +my $home = $ENV{'HOME'}; + +sub main() { + checkargs(); + if (!$path) { + $path = $home . '/.xbmc/userdata/Database'; + } + print("# checking XBMC directory '$path'\n") if ($verbose); + $dbpath = finddb($path); + if (!$dbpath) { + pod2usage("$0: can't find a XBMC database in '$path'."); + } + print("# using database '$dbpath'\n") if ($verbose); + checkdb(); +} # list videos database, find the latest one # modified version of # http://stackoverflow.com/questions/4651092/getting-the-list-of-files-sorted-by-modification-date-in-perl -opendir my($dirh), $path or die "can't opendir $path: $!"; -my @flist = sort { -M $a <=> -M $b } # Sort by modification time - map { "$path/$_" } # We need full paths for sorting - grep { /^MyVideos.*\.db$/ } - readdir $dirh; -closedir $dirh; - -my $dbpath=$flist[0]; - -my @lines = `echo 'SELECT playCount, path.strPath, files.strFileName FROM movie JOIN files ON files.idFile=movie.idFile JOIN path ON path.idPath=files.idPath;' | sqlite3 $dbpath`; -for (@lines) { - my ($count, $dir, $file) = split /\|/; - chomp $file; - # empty or non-numeric count is zero - if ($count !~ /[0-9]/) { - $count = 0; - } - if ($file =~ s#stack://##) { - for (split /,/, $file) { - s/$prefix//; - s/^ //; - s/ $//; - my @cmd = (qw(git annex metadata --set), "playCount=$count", $_); - system(@cmd); - } +sub finddb($) { + my $path = shift(@_); + opendir my($dirh), $path or die "can't opendir $path: $!"; + my @flist = sort { -M $a <=> -M $b } # Sort by modification time + map { "$path/$_" } # We need full paths for sorting + grep { /^MyVideos.*\.db$/ } + readdir $dirh; + closedir $dirh; + if ($#flist > 0) { + return $flist[0]; } else { - $dir =~ s/$prefix//; - my @cmd = (qw(git annex metadata --set), "playCount=$count", "$dir$file"); - system(@cmd); + return 0; } } + +sub checkargs() { + pod2usage(1) if $help; + pod2usage(-exitval => 0, -verbose => 2) if $usage; + + GetOptions('h|?' => \$help, + 'help|usage' => \$usage, + # we want to operate on relative links, so set this to + # the common annex to the git annex repo + 'annex=s' => \$annex, + 'path=s' => \$path, + 'home=s' => \$home, + 'dryrun|n' => \$dryrun, + 'verbose|v' => \$verbose, + ) + or die("Error parsing commandline\n"); +} + +sub checkdb() { + my @lines = `echo 'SELECT playCount, path.strPath, files.strFileName FROM movie JOIN files ON files.idFile=movie.idFile JOIN path ON path.idPath=files.idPath;' | sqlite3 $dbpath`; + print "# finding files...\n" if $verbose; + for (@lines) { + my ($count, $dir, $file) = split /\|/; + chomp $file; + # empty or non-numeric count is zero + if ($count !~ /[0-9]/) { + $count = 0; + } + print "# $dir/$file\n" if $verbose; + if ($file =~ s#stack://##) { + for (split /,/, $file) { + s/$annex//; + s/^ //; + s/ $//; + my @cmd = (qw(git annex metadata --set), "playCount=$count", $_); + if ($dryrun) { + print join(' ', @cmd) . "\n"; + } + else { + system(@cmd); + } + } + } + else { + $dir =~ s/$annex//; + my @cmd = (qw(git annex metadata --set), "playCount=$count", "$dir$file"); + if ($dryrun) { + print join(' ', @cmd) . "\n"; + } + else { + system(@cmd); + } + } + } +} + +main(); + +__END__ +=encoding utf8 + +=head1 NAME + +git-annex-xbmc-playcount - register XBMC playcounts as git-annex metadata + +=head1 SYNOPSIS + +git-annex-xbmc-playcount [--path .xbmc/userdata/Database] + + Options: + -h short usage + --help complete help + --dryrun, -n do nothing and show the commands that would be ran + --annex path to the git-annex repo + --home the home directory where the .xbmc directory is located + --path the location of the Database directory of XBMC, overrides --home + --verbose show interaction details with the database + +=head1 DESCRIPTION + +This program will look into the XBMC database for the "playcount" +field to register that number as metadata in the git-annex repository. + +=head1 OPTIONS + +=over 8 + +=item B<--dryrun> + +Do nothing but show all the steps that would be ran. The output can be +piped through a POSIX shell after inspection. B<-n> is an alias of +this command. Example: + + git-annex-xbmc-playcount -n | tee runme + # inspect the output + sh < runme + +=item B<--annex> + +This option allows the user to specify the root of the git-annex +repository, which is then stripped off the paths found in the XBMC +database. + +=item B<--home> + +Home of the user running XBMC. If not specified, defaults to the $HOME +environment variables. The script will look into +B<$home/.xbmc/userdata/Database> for a file matching +B<^MyVideos.*\.db$> and will fail if none is found. + +=item B<--path> + +Manually specify the path to B<.xbmc/userdata/Database>. This +overrides B<--home>. + +Note that this doesn't point directly to the datbase itself, because +there are usually many database files and we want to automatically +find the latest. This may be a stupid limitation. + +=item B<--verbose> + +Show more information about path discovery. Doesn't obstruct +B<--dryrun> output because lines are prefixed with C<#>. + +=back + +=head1 EXAMPLES + +You have a git annex in B and XBMC is ran as the +B