From mboxrd@z Thu Jan 1 00:00:00 1970 From: Erik Hetzner Subject: org-attach + git annex not working Date: Sat, 02 May 2015 12:59:40 -0700 Message-ID: <55452cc1.c28e440a.4541.ffff8b76@mx.google.com> Reply-To: Erik Hetzner Mime-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37274) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yoddz-00089O-98 for emacs-orgmode@gnu.org; Sat, 02 May 2015 16:04:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yoda0-0002av-GI for emacs-orgmode@gnu.org; Sat, 02 May 2015 16:00:07 -0400 Received: from mail-pa0-x22c.google.com ([2607:f8b0:400e:c03::22c]:33750) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yoda0-0002Yn-9C for emacs-orgmode@gnu.org; Sat, 02 May 2015 16:00:04 -0400 Received: by pacwv17 with SMTP id wv17so123514166pac.0 for ; Sat, 02 May 2015 13:00:02 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Org Mode Cc: John Wiegley Hi all, I am trying to get org-attach to work with git-annex, but there is a bug that prevents it working. org-attach checks if there is an annex directory in the results of (vc-git-root org-attach-directory) in order to decide whether to use git-annex. But the annex directory is a subdir of the .git dir, and vc-git-root returns the path to the directory that contains .git, not the .git path itself, e.g. /foo not /foo/.git I don=E2=80=99t know if the behavior of vc-git-root has changed, but I don= =E2=80=99t see anything in the emacs git log for vc/vc-git.el and it seems to have the same behavior in 24 & 25. The following patch fixes this issue. diff --git a/lisp/org-attach.el b/lisp/org-attach.el index 1737ec1..b843d48 100644 --- a/lisp/org-attach.el +++ b/lisp/org-attach.el @@ -276,7 +276,7 @@ the ATTACH_DIR property) their own attachment directory= ." "Commit changes to git if `org-attach-directory' is properly initialized. This checks for the existence of a \".git\" directory in that directory." (let* ((dir (expand-file-name org-attach-directory)) - (git-dir (vc-git-root dir)) + (git-dir (expand-file-name ".git" (vc-git-root dir))) (changes 0)) (when (and git-dir (executable-find "git")) (with-temp-buffer -- Sent from my free software system .