Merge branch 'master' of ssh://git-annex.branchable.com

This commit is contained in:
Joey Hess 2013-10-13 13:31:50 -04:00
commit 0d0c7e1244
8 changed files with 374 additions and 1 deletions

View file

@ -41,6 +41,8 @@ The second is probably simply that quvi doesn't support the internet archive, an
my good old faithful `4.20130921-g434dc22` i compiled manually some time ago. :)
This is [[done]] in git-annex version: 4.20131011-g2c0badc. Thanks!
### Please provide any additional information below.
[[!format sh """

View file

@ -0,0 +1,8 @@
[[!comment format=mdwn
username="https://id.koumbit.net/anarcat"
ip="72.0.72.144"
subject="awesome, fix confirmed, and IA+quvi forwarded upstream"
date="2013-10-12T11:23:31Z"
content="""
Great! I confirm latest versions work properly.. I have [written the quvi-devel mailing list](http://sourceforge.net/mailarchive/forum.php?thread_name=20131012104904.GA11972%40angela.anarcat.ath.cx&forum_name=quvi-devel) to ask for help for archive.org support, we'll see where it goes...
"""]]

View file

@ -0,0 +1,197 @@
### Please describe the problem.
Data loss due to incorrect merge of repos in direct mode. (I tested the same scenario in indirect mode and it worked fine there)
Given 2 repos A and B, in direct mode:
1. in A: mkdir f, with a file f in it
2. in B: touch f
3. in B: sync
Result: Only an f.variant-f###remains, which is file f of B, and the merge conflict has already been automatically resolved. I.e. Directory f containing file f, is lost.
Expected result: remaining contents: f.variant-AAA which is file f of B, f.variant-BBB which is directory f of A, containing a file f. Merge conflict marked resolved.
### What steps will reproduce the problem?
Execute the script given below in additional information.
### What version of git-annex are you using?
git-annex version: 4.20130911-g6625d0e
build flags: Assistant Webapp Pairing Testsuite S3 WebDAV Inotify DBus XMPP Feeds Quvi
### On what operating system?
Linux basementcat 3.10.10-1-ARCH #1 SMP PREEMPT Fri Aug 30 11:30:06 CEST 2013 x86_64 GNU/Linux
### Please provide any additional information below.
[[!format sh """
[~]$ mkdir test
[~/test]$ mkdir a
[~/test/a]$ git init
Initialized empty Git repository in /home/limyreth/test/a/.git/
[~/test/a]$ git annex init test
init test ok
(Recording state in git...)
[~/test/a]$ touch firstfile
[~/test/a]$ git annex add firstfile
add firstfile (checksum...) ok
(Recording state in git...)
[~/test/a]$ git annex sync
commit
ok
git-annex: no branch is checked out
[~]$ git clone test/a
Cloning into 'a'...
done.
[~]$ mv a test/b
[~/test/a]$ git annex direct
commit
# On branch master
nothing to commit, working directory clean
ok
direct firstfile ok
direct ok
[~/test/a]$ ls -l
total 0
-rw-r--r-- 1 limyreth users 0 Oct 12 15:09 firstfile
[~/test/a]$ mkdir f
[~/test/a]$ touch f/f
[~/test/a]$ git annex add f/f
add f/f (checksum...) ok
(Recording state in git...)
[~/test/a]$ git annex sync
commit
ok
[~/test/b]$ git remote -v
origin /home/limyreth/test/a (fetch)
origin /home/limyreth/test/a (push)
[~/test/b]$ ls
firstfile
[~/test/b]$ git annex direct
commit
(Recording state in git...)
# On branch master
nothing to commit, working directory clean
ok
direct ok
[~/test/b]$ touch f
[~/test/b]$ git annex add f
add f (checksum...) ok
(Recording state in git...)
[~/test/b]$ git annex sync
(merging origin/git-annex into git-annex...)
(Recording state in git...)
commit
ok
pull origin
remote: Counting objects: 14, done.
remote: Compressing objects: 100% (7/7), done.
remote: Total 9 (delta 1), reused 0 (delta 0)
Unpacking objects: 100% (9/9), done.
From /home/limyreth/test/a
2a8fa45..ad6802d master -> origin/master
1f39016..19e3e12 git-annex -> origin/git-annex
* [new branch] synced/master -> origin/synced/master
Adding f/f
CONFLICT (file/directory): There is a directory with name f in refs/remotes/origin/master. Adding f as f~HEAD
Automatic merge failed; fix conflicts and then commit the result.
f: needs merge
(Recording state in git...)
ok
[master 37a8019] git-annex automatic merge conflict fix
Already up-to-date.
ok
(merging origin/git-annex into git-annex...)
(Recording state in git...)
push origin
Counting objects: 36, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (20/20), done.
Writing objects: 100% (25/25), 2.16 KiB | 0 bytes/s, done.
Total 25 (delta 5), reused 0 (delta 0)
To /home/limyreth/test/a
ad6802d..37a8019 master -> synced/master
* [new branch] git-annex -> synced/git-annex
ok
[~/test/b]$ ls -l
total 0
-rw-r--r-- 1 limyreth users 0 Oct 12 15:11 firstfile
-rw-r--r-- 1 limyreth users 0 Oct 12 15:11 f.variant-f874
[~/test/b]$ git log --summary
commit 37a80199abe3cf82100bbdb5dd2217ed6bcb4b62
Merge: 5a8942a ad6802d
Author: timdiels <timdiels.m@gmail.com>
Date: Sat Oct 12 15:11:47 2013 +0200
git-annex automatic merge conflict fix
commit 5a8942a9a1735cb313c1f6624cbd3f48b252d9d9
Author: timdiels <timdiels.m@gmail.com>
Date: Sat Oct 12 15:11:47 2013 +0200
git-annex automatic sync
create mode 120000 f
commit ad6802dc231d389b86154e2df900a70b18e17b29
Author: timdiels <timdiels.m@gmail.com>
Date: Sat Oct 12 15:11:40 2013 +0200
git-annex automatic sync
create mode 120000 f/f
commit 2a8fa45bea996ab5ae219a017d4b642153e6d9c9
Author: timdiels <timdiels.m@gmail.com>
Date: Sat Oct 12 15:09:40 2013 +0200
git-annex automatic sync
create mode 120000 firstfile
[~/test/a]$ git annex sync
(merging synced/git-annex into git-annex...)
commit
ok
merge synced/master
Updating ad6802d..37a8019
Fast-forward
f.variant-f874 | 1 +
f/f | 1 -
2 files changed, 1 insertion(+), 1 deletion(-)
create mode 120000 f.variant-f874
delete mode 120000 f/f
ok
[~/test/a]$ git log --summary
commit 37a80199abe3cf82100bbdb5dd2217ed6bcb4b62
Merge: 5a8942a ad6802d
Author: timdiels <timdiels.m@gmail.com>
Date: Sat Oct 12 15:11:47 2013 +0200
git-annex automatic merge conflict fix
commit 5a8942a9a1735cb313c1f6624cbd3f48b252d9d9
Author: timdiels <timdiels.m@gmail.com>
Date: Sat Oct 12 15:11:47 2013 +0200
git-annex automatic sync
create mode 120000 f
commit ad6802dc231d389b86154e2df900a70b18e17b29
Author: timdiels <timdiels.m@gmail.com>
Date: Sat Oct 12 15:11:40 2013 +0200
git-annex automatic sync
create mode 120000 f/f
commit 2a8fa45bea996ab5ae219a017d4b642153e6d9c9
Author: timdiels <timdiels.m@gmail.com>
Date: Sat Oct 12 15:09:40 2013 +0200
git-annex automatic sync
create mode 120000 firstfile
"""]]

View file

@ -0,0 +1,10 @@
[[!comment format=mdwn
username="https://www.google.com/accounts/o8/id?id=AItOawlWskoNgUB7r70OXglR-4iKI4bOuPJb-xg"
nickname="Tim"
subject="comment 1"
date="2013-10-13T12:35:47Z"
content="""
I've just tested a similar scenario with 2 conflicting files, a file-file conflict, and then it works fine. That makes sense, as there's a test written for that.
So the specific bits are: directory-file conflict of repos in direct mode.
"""]]

View file

@ -0,0 +1,10 @@
[[!comment format=mdwn
username="http://joeyh.name/"
ip="4.154.4.22"
subject="comment 4"
date="2013-10-12T23:31:16Z"
content="""
Git simply creates a file as a lock file, and does not use any form of locking on it, so if the git process dies for any reason before it gets a chance to remove the lock file, a stale lock file remains, and future git commands will fall over it.
It's really surprisingly bad..
"""]]

View file

@ -0,0 +1,136 @@
[[!comment format=mdwn
username="https://www.google.com/accounts/o8/id?id=AItOawkUwqII7LhbatqAQY1T5ZZOdPEFcQJKG6I"
nickname="Rafael"
subject="comment 3"
date="2013-10-13T16:14:34Z"
content="""
This code needs the bash-completion file for git by Shawn O. Pearce, I think it is distributed by default on debian. Any feed-back or improvement is welcome! I'm far from expert, use at your own risks.
#!bash
#
# bash completion support for git-annex
# depends on git completion file (by Shawn O. Pearce):
[ -n \"$__git_whitespacelist\" ] || . $BASH_COMPLETION_DIR/git
# almost copy of __git_aliased_command
# requires 2 arguments: alias and main command (after git)
__git_aliased_subcommand ()
{
local word cmdline=$(git --git-dir=\"$(__gitdir)\" \
config --get \"alias.$1\")
for word in $cmdline; do
case \"$word\" in
\!*) : shell command alias ;;
-*) : option ;;
*=*) : setting env ;;
git) : git itself ;;
\"$2\") : main command
local found=1 ;;
*)
[ -n \"${found-}\" ] && echo \"$word\"
return
esac
done
}
_git_annex ()
{
_get_comp_words_by_ref -n =: cur words
# $ git annex 2>&1 |sed '1,6d '|grep -v '^$'|grep -v 'commands:$'|cut -c1-12
local subcommands=\"
add addurl assistant copy drop edit get import importfeed lock
mirror move rmurl sync unlock watch webapp content dead describe
direct enableremote group indirect init initremote semitrust
trust ungroup untrust vicfg addunused dropunused fix forget fsck
merge unused upgrade find help list log map status version
whereis migrate reinject unannex uninit dropkey
\"
# plumbing (to complete?): fromkey fuzztest pre-commit rekey test
# transferkey transferkeys xmppgit
local subcommand=\"$(__git_find_on_cmdline \"$subcommands\")\"
if [ -z \"$subcommand\" ]; then
## search for aliased subcommand
## works only if the alias is invoked just after git
## (simpler, cf _git function)
local maybesubcom maybealias=${words[1]}
[ -n \"$maybealias\" ] && # false with a bash alias='git annex'
[ \"${maybealias:0:1}\" != '-' ] &&
maybesubcom=$(__git_aliased_subcommand \"$maybealias\" annex)
for subcommand in $subcommands \"\"; do
[ \"$maybesubcom\" = \"$subcommand\" ] && break
done
[ -z \"$subcommand\" ] &&
__gitcomp \"$subcommands\" &&
return
fi
case \"$cur\" in
--from=*|--to=*|--trust=*|--semitrust=*|--untrust=*|--in=*)
__gitcomp \"here $(__git_remotes)\" \"\" \"${cur##*=}\"
;;
--*)
__gitcomp \"
--force --fast --auto --all --unused --quiet --verbose --json --debug
--no-debug --from= --to= --numcopies= --time-limit= --trust= --semitrust=
--untrust= --trust-glacier-inventory --backend= --format= --user-agent=
--exclude= --include= --in= --copies= --inbackend= --inallgroup=
--smallerthan= --largerthan= --not --and --or
\"
;;
# -*)
# __gitcomp \"-( -) -c\"
# ;;
*)
case \"$subcommand\" in
# subcommands with PATH (currently outputs wrongly \"uninit\",
# and not \"reinject\")
# $ tr ' ' '|' <<< $(git annex 2>&1 |sed '1,6d '|grep -v '^$' | \
# grep -v 'commands:$'|grep PATH |cut -c1-12)
add|copy|drop|edit|get|import|lock|mirror|move|unlock|fix| \
fsck|find|list|log|status|whereis|migrate|unannex| \
fromkey|pre-commit|rekey|reinject)
COMPREPLY=() # complete with paths
;;
addurl|importfeed|rmurl) # URL commands
COMPREPLY=() # at least works with file://...
;;
init|uninit|unused|merge|status|map|upgrade|version|assistant| \
watch|webapp|direct|indirect|vicfg|forget|help) # | plumbing...
COMPREPLY= # no more args expected
# is 'COMPREPLY=' correct? (seems not standard practice...)
;;
describe|trust|untrust|semitrust|sync|content|dead|group|ungroup)
__gitcomp \"here $(__git_remotes)\"
# TODO: handle git-annex special remotes
;;
initremote|enableremote)
case \"$cur\" in
type=*)
__gitcomp \"S3 bup directory rsync gcrypt webdav\" \"\" \"${cur##type=}\"
;;
encryption=*)
__gitcomp \"none hybrid shared pubkey\" \"\" \"${cur##encryption=}\"
;;
buprepo=|directory=|rsyncurl=)
COMPREPLY=()
# use COMPREPLY (and compgen below) directly because
# __gitcomp does not handle '*=*' pattern, only '--*=*'
# Writing a __gitannexcomp function may be worth it.
;;
*)
local initremoteopts=\"
type= encryption= buprepo= directory= rsyncurl= \"
COMPREPLY=($(compgen -W \"$initremoteopts \" -- \"$cur\"))
;;
esac
;;
esac
;;
esac
}
"""]]

View file

@ -0,0 +1,10 @@
[[!comment format=mdwn
username="RaspberryPie"
ip="213.61.149.100"
subject="comment 5"
date="2013-10-13T06:33:24Z"
content="""
I use v4.20130909 and get the same error when running `git-annex status`. Does it matter that my filename in question is shown to have two dashes (--) at the end, just as in OP's case? Other files in .git/annex/tmp only have one dash at the end.
Joey, I straced the command and sent the output to your kitenet e-mail address. Hope it helps.
"""]]

View file

@ -68,7 +68,7 @@ number takes that many paths from the end.
## videos
<a name=quvi />
<a name=quvi></a>
There's support for downloading videos from sites like YouTube, Vimeo,
and many more. This relies on [quvi](http://quvi.sourceforge.net/) to find