Package: git-annex
Version: 3.20120629
Severity: minor

Greetings.

When running git-annex in a repository created with
`git init --separate-git-dir=...` git-annex fails to find the corresponding
git-dir on its own (i.e. without manually setting GIT_DIR).  Vanilla git
however correctly locates the git-dir, and so should git-annex.

This bug is probably related to the "on --git-dir and --work-tree options"
bug [1].

Example:

     $ cd /tmp
     $ unset GIT_DIR GIT_WORK_TREE GIT_OBJECT_DIRECTORY
 (1) $ git init --separate-git-dir=git_dir work_tree
     Initialized empty Git repository in /tmp/git_dir/
     $ cd work_tree
 (2) $ git annex init
     git-annex: Not in a git repository.
 (3) $ GIT_DIR=/tmp/git_dir GIT_WORK_TREE=/tmp/work_tree git annex init
     init  ok
     (Recording state in git...)
 (4) $ git rev-parse --is-inside-work-tree
     true
 (5) $ git rev-parse --git-dir
     /tmp/git_dir
     $ file /tmp/work_tree/.git
     /tmp/work_tree/.git: ASCII text
 (6) $ cat /tmp/work_tree/.git
     gitdir: /tmp/git_dir

Commands of type (2) don't work, commands of type (3) do.  (4) correctly
reports that vanilla git believes it is in a git work tree.  (6) shows the
type of file that (1) created (a "gitfile", see [2]) and which git-annex
seemingly doesn't support.

While it's probably feasible to add support for gitfiles in a manner similar
to [1], I believe the correct fix is to always query vanilla git for the
location of the git-dir, as in (5).

Regards,
Marco Ricci

  [1]: http://git-annex.branchable.com/bugs/on--git-dir_and_--work-tree_options/
  [2]: 
http://git.kernel.org/?p=git/git.git;a=commit;h=b44ebb19e3234c5dffe9869ceac5408bb44c2e20
 

-- System Information:
Debian Release: wheezy/sid
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'testing'), (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 3.2.0-3-686-pae (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages git-annex depends on:
ii  curl            7.26.0-1
ii  git             1:1.7.10.4-1
ii  libc6           2.13-33
ii  libffi5         3.0.10-3
ii  libgmp10        2:5.0.5+dfsg-2
ii  libpcre3        1:8.30-5
ii  openssh-client  1:6.0p1-2
ii  rsync           3.0.9-3
ii  uuid            1.6.2-1.3
ii  wget            1.13.4-3

Versions of packages git-annex recommends:
ii  lsof  4.86+dfsg-1

Versions of packages git-annex suggests:
pn  bup       <none>
ii  gnupg     1.4.12-4+b1
ii  graphviz  2.26.3-12

-- no debconf information

-- 
Marco Ricci (OpenPGP key: 1024D/0x2C93_5A2E_565F_3D62)
Fingerprint 0x587A_47FE_F5F1_F486_299B__F193_2C93_5A2E_565F_3D62

Attachment: signature.asc
Description: PGP signature

Reply via email to