From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rasmus Subject: Re: [PATCH] org-attach.el: Fetch attachments from git annex Date: Tue, 26 Jan 2016 23:10:52 +0100 Message-ID: <87k2mwhtzn.fsf@gmx.us> References: <568b532e.d111620a.b25a8.ffffbb7c@mx.google.com> <87poxg8s22.fsf@kyleam.com> <568c6aaa.c345620a.7f4da.6359@mx.google.com> <56a5b193.ca77420a.1551e.667c@mx.google.com> <87lh7dz79f.fsf@gmx.us> <56a704a9.c18e420a.96e47.5774@mx.google.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60528) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aOBpH-0006yV-VK for emacs-orgmode@gnu.org; Tue, 26 Jan 2016 17:11:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aOBpE-0002WL-Jb for emacs-orgmode@gnu.org; Tue, 26 Jan 2016 17:11:03 -0500 Received: from plane.gmane.org ([80.91.229.3]:41421) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aOBpE-0002Vt-CB for emacs-orgmode@gnu.org; Tue, 26 Jan 2016 17:11:00 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1aOBpB-0007Yj-Uv for emacs-orgmode@gnu.org; Tue, 26 Jan 2016 23:10:58 +0100 Received: from x590e0733.dyn.telefonica.de ([89.14.7.51]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 26 Jan 2016 23:10:57 +0100 Received: from rasmus by x590e0733.dyn.telefonica.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 26 Jan 2016 23:10:57 +0100 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: emacs-orgmode@gnu.org Erik Hetzner writes: >> Seems fine, but I wonder if it wouldn’t be better to check the exit code >> of say an annex command and relies on its checking. E.g. on my system >> >> (zerop (shell-command "cd ~/annex/doc.annex/ && git annex info --fast" nil)) => t >> (zerop (shell-command "cd ~/src/code/org-mode && git annex info --fast" nil )) => nil > > This would be great, but it returns t for my non-annex git repos. I’m not sure > why the behavior is different for you. No idea. I have 6.20160114 and some recent version of Emacs-git (when xwidgets was just merged)... Weird. >> AFAIK annex will check if get should get anything. If that’s correct, I’d >> prefer to just rely on however git annex get checks files. > > That makes sense. I’ll change that code. The only disadvantage here is that it > is no longer clear to me how to tell if the content was fetched, if we want to > notify the user. I guess you could check the return code? And maybe output... You could just start by stating (message "getting $FILE..."); get it; (message "got $FILE"). It will instantaneous when the file is available. > This code is unchanged from org-attach.el. > http://git-annex.branchable.com/direct_mode/#index5h2 says: “you cannot git > commit or git pull” in direct mode - so I’m curious if direct mode would work at > all with org-attach? Don’t know. I use org-attach. My dir is in a direct repo. It never complained. Maybe there’s something I haven’t configured. Maybe it’s cause I use the assistant. Don’t know... > I’m happy to make that change, but I feel it should be a separate patch. Indeed. Thanks for working on this. Rasmus -- Got mashed potatoes. Ain't got no T-Bone. No T-Bone