Merge remote branch 'branchable/master'

This commit is contained in:
Joey Hess 2011-02-01 20:55:36 -04:00
commit 1f136cb764
5 changed files with 112 additions and 0 deletions

View file

@ -0,0 +1,9 @@
See [[forum/unannex_alternatives]] for problem description.
If an unannex is followed by a "git add; git commit", git-annex's hook thinks
that you have used git annex unlock on the file and are
now committing a changed version, and the right thing to do there is to add the
new content to the annex and update the symlink accordingly.
Can we tell the difference between an unannexed file that has yet to be committed
and an unlocked file? --[[Joey||

View file

@ -0,0 +1,9 @@
what is the work flow to get a file that is in git-annex out of there and into git? (current situation: `git-annex add`ed a bunch of pictures, later found make files in there which i'd rather have in git for proper source code control)
the most intuitive thing to do is `git unannex`, which at first seemed to do the right thing, but when committing there came the hook and everything was back to where it was before.
i could disable the hook as a workaround, but that doesn't smell like a good work flow.
the [[man page|git-annex]] does warn that `unannex` is only supposed to be used against unintentional `git annex add`s (probably meaning that it should be used before something is committed), but the alternatives it suggests (`git rm` and `git annex drop`) don't to what i want to do.
am i missing something or is there really no work flow for this? --[[chrysn]]

View file

@ -0,0 +1,46 @@
[[!comment format=mdwn
username="http://joey.kitenet.net/"
nickname="joey"
subject="comment 1"
date="2011-02-02T00:39:10Z"
content="""
Git-annex's commit hook does not prevent unannex being used. The file you unannex will not be checked into git anymore and will be a regular file again, not a git-annex symlink.
For example, here's a transcript:
<pre>
joey@gnu:~/tmp>mkdir demo
joey@gnu:~/tmp>cd demo
joey@gnu:~/tmp/demo>git init
Initialized empty Git repository in /home/joey/tmp/demo/.git/
joey@gnu:~/tmp/demo>git annex init demo
init demo ok
joey@gnu:~/tmp/demo>echo hi > file
joey@gnu:~/tmp/demo>git annex add file
add file ok
(Recording state in git...)
joey@gnu:~/tmp/demo>git commit -m add
[master 64cf267] add
2 files changed, 2 insertions(+), 0 deletions(-)
create mode 100644 .git-annex/WORM:1296607093:3:file.log
create mode 120000 file
joey@gnu:~/tmp/demo>git annex unannex file
unannex file ok
(Recording state in git...)
joey@gnu:~/tmp/demo>ls -l file
-rw-r--r-- 1 joey joey 3 Feb 1 20:38 file
joey@gnu:~/tmp/demo>git commit
[master 78a09cc] unannex
2 files changed, 1 insertions(+), 2 deletions(-)
delete mode 120000 file
joey@gnu:~/tmp/demo>ls -l file
-rw-r--r-- 1 joey joey 3 Feb 1 20:38 file
joey@gnu:~/tmp/demo>git status
# On branch master
# Untracked files:
# (use \"git add <file>...\" to include in what will be committed)
#
# file
nothing added to commit but untracked files present (use \"git add\" to track)
</pre>
"""]]

View file

@ -0,0 +1,36 @@
[[!comment format=mdwn
username="http://joey.kitenet.net/"
nickname="joey"
subject="comment 2"
date="2011-02-02T00:41:24Z"
content="""
And following on to my transcript, you can then add the file to git in the regular git way, and it works fine:
<pre>
joey@gnu:~/tmp/demo>git add file
joey@gnu:~/tmp/demo>git commit
[master 225ffc0] added as regular git file, not in annex
1 files changed, 1 insertions(+), 0 deletions(-)
create mode 100644 file
joey@gnu:~/tmp/demo>ls -l file
-rw-r--r-- 1 joey joey 3 Feb 1 20:38 file
joey@gnu:~/tmp/demo>git log file
commit 225ffc048f5af7c0466b3b1fe549a6d5e9a9e9fe
Author: Joey Hess <joey@kitenet.net>
Date: Tue Feb 1 20:43:13 2011 -0400
added as regular git file, not in annex
commit 78a09cc791b875c3b859ca9401e5b6472bf19d08
Author: Joey Hess <joey@kitenet.net>
Date: Tue Feb 1 20:38:30 2011 -0400
unannex
commit 64cf267734adae05c020d9fd4d5a7ff7c64390db
Author: Joey Hess <joey@kitenet.net>
Date: Tue Feb 1 20:38:18 2011 -0400
add
</pre>
"""]]

View file

@ -0,0 +1,12 @@
[[!comment format=mdwn
username="http://joey.kitenet.net/"
nickname="joey"
subject="comment 3"
date="2011-02-02T00:46:00Z"
content="""
Sorry for all the followups, but I see now that if you unannex, then add the file to git normally, and commit, the hook *does* misbehave.
This seems to be a bug. git-annex's hook thinks that you have used git annex unlock (or \"git annex edit\") on the file and are now committing a changed version, and the right thing to do there is to add the new content to the annex and update the symlink accordingly. I'll track this bug over at [[bugs/unannex_vs_unlock_hook_confusion]].
So, committing after unannex, and before checking the file into git in the usual way, is a workaround.
"""]]