emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] org-attach: Use relative path for git annex
@ 2016-02-26 20:44 Erik Hetzner
  2016-04-06 13:12 ` Nicolas Goaziou
  0 siblings, 1 reply; 4+ messages in thread
From: Erik Hetzner @ 2016-02-26 20:44 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: David Engster

* lisp/org-attach.el (org-attach-annex-get-maybe): Use relative path as
  argument for git annex. Fixes error in test with version 3 of git
  annex.
---
 lisp/org-attach.el | 33 +++++++++++++++++----------------
 1 file changed, 17 insertions(+), 16 deletions(-)

diff --git a/lisp/org-attach.el b/lisp/org-attach.el
index ebea435..cf8a1ca 100644
--- a/lisp/org-attach.el
+++ b/lisp/org-attach.el
@@ -299,22 +299,23 @@ the ATTACH_DIR property) their own attachment directory."
 (defun org-attach-annex-get-maybe (path)
   "Call git annex get PATH (via shell) if using git annex.
 Signals an error if the file content is not available and it was not retrieved."
-  (when (and (org-attach-use-annex)
-	     (not
-	      (string-equal
-	       "found"
-	       (shell-command-to-string
-		(format "git annex find --format=found --in=here %s"
-			(shell-quote-argument path))))))
-    (let ((should-get
-	   (if (eq org-attach-annex-auto-get 'ask)
-	       (y-or-n-p (format "Run git annex get %s? " path))
-	     org-attach-annex-auto-get)))
-      (if should-get
-	  (progn (message "Running git annex get \"%s\"." path)
-		 (call-process "git" nil nil nil "annex" "get" path))
-	(error "File %s stored in git annex but it is not available, and was not retrieved"
-	       path)))))
+  (let ((path-relative (file-relative-name path)))
+    (when (and (org-attach-use-annex)
+	       (not
+		(string-equal
+		 "found"
+		 (shell-command-to-string
+		  (format "git annex find --format=found --in=here %s"
+			  (shell-quote-argument path-relative))))))
+      (let ((should-get
+	     (if (eq org-attach-annex-auto-get 'ask)
+		 (y-or-n-p (format "Run git annex get %s? " path-relative))
+	       org-attach-annex-auto-get)))
+	(if should-get
+	    (progn (message "Running git annex get \"%s\"." path-relative)
+		   (call-process "git" nil nil nil "annex" "get" path-relative))
+	  (error "File %s stored in git annex but it is not available, and was not retrieved"
+		 path))))))

 (defun org-attach-commit ()
   "Commit changes to git if `org-attach-directory' is properly initialized.
--
2.5.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] org-attach: Use relative path for git annex
  2016-02-26 20:44 [PATCH] org-attach: Use relative path for git annex Erik Hetzner
@ 2016-04-06 13:12 ` Nicolas Goaziou
  2016-04-06 16:30   ` Erik Hetzner
  0 siblings, 1 reply; 4+ messages in thread
From: Nicolas Goaziou @ 2016-04-06 13:12 UTC (permalink / raw)
  To: Erik Hetzner; +Cc: emacs-orgmode, David Engster

Hello,

Erik Hetzner <egh@e6h.org> writes:

> * lisp/org-attach.el (org-attach-annex-get-maybe): Use relative path as
>   argument for git annex. Fixes error in test with version 3 of git
>   annex.

It seems like I lost track on this one. Could you tell me about the
status of this patch? I doesn't seem to be applied. Was it superseded by
another one?

Thank you.

Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] org-attach: Use relative path for git annex
  2016-04-06 13:12 ` Nicolas Goaziou
@ 2016-04-06 16:30   ` Erik Hetzner
  2016-04-10  8:15     ` Nicolas Goaziou
  0 siblings, 1 reply; 4+ messages in thread
From: Erik Hetzner @ 2016-04-06 16:30 UTC (permalink / raw)
  To: Nicolas Goaziou, emacs-orgmode, David Engster

Hi Nicolas,

I don’t believe it was ever applied, nor was it superseded by another. This was
to fix a problem with testing older versions of git-annex. I believe David
remove git-annex on the buildbot, which stopped it from failing, because it was
not being tested.

If you need me to make any changes to this patch, let me know. Thank you!

best, Erik

On Wed, 06 Apr 2016 06:12:42 -0700,
Nicolas Goaziou <mail@nicolasgoaziou.fr> wrote:
> 
> Hello,
> 
> Erik Hetzner <egh@e6h.org> writes:
> 
> > * lisp/org-attach.el (org-attach-annex-get-maybe): Use relative path as
> >   argument for git annex. Fixes error in test with version 3 of git
> >   annex.
> 
> It seems like I lost track on this one. Could you tell me about the
> status of this patch? I doesn't seem to be applied. Was it superseded by
> another one?
> 
> Thank you.
> 
> Regards,
> 
> -- 
> Nicolas Goaziou

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] org-attach: Use relative path for git annex
  2016-04-06 16:30   ` Erik Hetzner
@ 2016-04-10  8:15     ` Nicolas Goaziou
  0 siblings, 0 replies; 4+ messages in thread
From: Nicolas Goaziou @ 2016-04-10  8:15 UTC (permalink / raw)
  To: Erik Hetzner; +Cc: emacs-orgmode, David Engster

Hello,

Erik Hetzner <egh@e6h.org> writes:

> I don’t believe it was ever applied, nor was it superseded by another. This was
> to fix a problem with testing older versions of git-annex. I believe David
> remove git-annex on the buildbot, which stopped it from failing, because it was
> not being tested.
>
> If you need me to make any changes to this patch, let me know. Thank
> you!

I applied it. Thank you.


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-04-10  8:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-26 20:44 [PATCH] org-attach: Use relative path for git annex Erik Hetzner
2016-04-06 13:12 ` Nicolas Goaziou
2016-04-06 16:30   ` Erik Hetzner
2016-04-10  8:15     ` Nicolas Goaziou

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).