all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* org-attach-commit optional
@ 2016-02-10 22:39 John J Foerch
  2016-02-11  9:09 ` Nicolas Goaziou
  2016-02-11  9:16 ` Marco Wahl
  0 siblings, 2 replies; 8+ messages in thread
From: John J Foerch @ 2016-02-10 22:39 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 182 bytes --]

Hello,

I would like for org-attach's automatic committing of attachments to be
easily disabled.  Something along the lines of the attached patch.
Thoughts?

Thank you,

John Foerch

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: org-attach-commit optional --]
[-- Type: text/x-diff, Size: 1246 bytes --]

From 2e6b4adb249ea36cd3546068974e97ff50e1e76b Mon Sep 17 00:00:00 2001
From: John Foerch <jjfoerch@earthlink.net>
Date: Wed, 10 Feb 2016 17:37:03 -0500
Subject: [PATCH] org-attach-attach: make use of git optional with variable
 org-attach-commit


diff --git a/lisp/org-attach.el b/lisp/org-attach.el
index 15d4841..8f367a2 100644
--- a/lisp/org-attach.el
+++ b/lisp/org-attach.el
@@ -55,6 +55,12 @@ where the Org file lives."
   :group 'org-attach
   :type 'directory)
 
+(defcustom org-attach-commit t
+  "If non-nil, attachments will be committed with git, if the org
+file is in a git repository."
+  :group 'org-attach
+  :type 'boolean)
+
 (defcustom org-attach-git-annex-cutoff (* 32 1024)
   "If non-nil, files larger than this will be annexed instead of stored."
   :group 'org-attach
@@ -373,7 +379,8 @@ METHOD may be `cp', `mv', `ln', or `lns' default taken from
        ((eq method 'cp)	(copy-file file fname))
        ((eq method 'ln) (add-name-to-file file fname))
        ((eq method 'lns) (make-symbolic-link file fname)))
-      (org-attach-commit)
+      (when org-attach-commit
+	(org-attach-commit))
       (org-attach-tag)
       (cond ((eq org-attach-store-link-p 'attached)
 	     (org-attach-store-link fname))
-- 
2.6.4


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

* Re: org-attach-commit optional
  2016-02-10 22:39 org-attach-commit optional John J Foerch
@ 2016-02-11  9:09 ` Nicolas Goaziou
  2016-02-11 15:46   ` John J Foerch
  2016-02-11  9:16 ` Marco Wahl
  1 sibling, 1 reply; 8+ messages in thread
From: Nicolas Goaziou @ 2016-02-11  9:09 UTC (permalink / raw)
  To: John J Foerch; +Cc: emacs-orgmode

Hello,

John J Foerch <jjfoerch@earthlink.net> writes:

> I would like for org-attach's automatic committing of attachments to be
> easily disabled.  Something along the lines of the attached patch.
> Thoughts?

Thank you. A few stylistic comments follow.

> Subject: [PATCH] org-attach-attach: make use of git optional with variable
>  org-attach-commit

The commit message should be something along the lines:

  org-attach: Optionally make use of git

* lisp/org-attach.el (org-attach-commit): New variable.
(org-attach-attach): Use new variable.

You also need to add TINYCHANGE at the end of the commit message. On
this topic, please not that you are, with this patch, reaching the limit
of allowed changes without FSF assignment. You may want to consider
signing FSF papers.

> +(defcustom org-attach-commit t
> +  "If non-nil, attachments will be committed with git, if the org
> +file is in a git repository."
> +  :group 'org-attach
> +  :type 'boolean)

First line in docstring should be a sentence on its own, e.g.

    "Non-nil means attachements are to be committed with git.
  This can only happen if the Org file is in a git repository."

You should also add :version and :package-version keywords, e.g.,

  :version "25.1"
  :package-version '(Org . "9.0")


Regards,

-- 
Nicolas Goaziou

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

* Re: org-attach-commit optional
  2016-02-10 22:39 org-attach-commit optional John J Foerch
  2016-02-11  9:09 ` Nicolas Goaziou
@ 2016-02-11  9:16 ` Marco Wahl
  1 sibling, 0 replies; 8+ messages in thread
From: Marco Wahl @ 2016-02-11  9:16 UTC (permalink / raw)
  To: emacs-orgmode

Hi!

John J Foerch <jjfoerch@earthlink.net> writes:

> I would like for org-attach's automatic committing of attachments to be
> easily disabled.  Something along the lines of the attached patch.
> Thoughts?

I think this is a good idea since it extends the user's possibility.

Further it looks natural to me to do *one* commit for a note which has
attached some fresh files.


Best regards,
-- 
Marco Wahl
GPG: 0x49010A040A3AE6F2

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

* Re: org-attach-commit optional
  2016-02-11  9:09 ` Nicolas Goaziou
@ 2016-02-11 15:46   ` John J Foerch
  2016-02-11 17:29     ` Nicolas Goaziou
  0 siblings, 1 reply; 8+ messages in thread
From: John J Foerch @ 2016-02-11 15:46 UTC (permalink / raw)
  To: emacs-orgmode

Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

> Hello,
>
> John J Foerch <jjfoerch@earthlink.net> writes:
>
>> I would like for org-attach's automatic committing of attachments to be
>> easily disabled.  Something along the lines of the attached patch.
>> Thoughts?
>
> Thank you. A few stylistic comments follow.
>
>> Subject: [PATCH] org-attach-attach: make use of git optional with variable
>>  org-attach-commit
>
> The commit message should be something along the lines:
>
>   org-attach: Optionally make use of git
>
> * lisp/org-attach.el (org-attach-commit): New variable.
> (org-attach-attach): Use new variable.
>
> You also need to add TINYCHANGE at the end of the commit message. On
> this topic, please not that you are, with this patch, reaching the limit
> of allowed changes without FSF assignment. You may want to consider
> signing FSF papers.
>
>> +(defcustom org-attach-commit t
>> +  "If non-nil, attachments will be committed with git, if the org
>> +file is in a git repository."
>> +  :group 'org-attach
>> +  :type 'boolean)
>
> First line in docstring should be a sentence on its own, e.g.
>
>     "Non-nil means attachements are to be committed with git.
>   This can only happen if the Org file is in a git repository."
>
> You should also add :version and :package-version keywords, e.g.,
>
>   :version "25.1"
>   :package-version '(Org . "9.0")
>
>
> Regards,

Many thanks, Nicolas,

I would be glad to do the paperwork, but as it's such a simple change, I
have no objections to anybody else implementing this feature request in
my place if they want to.  I think it would save time.  Need not use the
patch I sent, which needs revision anyway - it was just a suggested
implementation.  Let me know if this works for this community, or
whether it is preferred for me to go through the FSF process.

Thank you,

John Foerch

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

* Re: org-attach-commit optional
  2016-02-11 15:46   ` John J Foerch
@ 2016-02-11 17:29     ` Nicolas Goaziou
  2016-02-11 18:32       ` John J Foerch
  0 siblings, 1 reply; 8+ messages in thread
From: Nicolas Goaziou @ 2016-02-11 17:29 UTC (permalink / raw)
  To: John J Foerch; +Cc: emacs-orgmode

Hello,

John J Foerch <jjfoerch@earthlink.net> writes:

> I would be glad to do the paperwork, but as it's such a simple change, I
> have no objections to anybody else implementing this feature request in
> my place if they want to.  I think it would save time.

There is no rush. Besides, your patch can still fit within the
TINYCHANGE limit, albeit it would unfortunately be the last one.

> Let me know if this works for this community, or whether it is
> preferred for me to go through the FSF process.

I think the best solution for the community is to finish the patch and
apply it with a TINYCHANGE tag, while at the same time going through the
FSF process for future patches. It's always best to eat the cake and
have it too.

Regards,

-- 
Nicolas Goaziou

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

* Re: org-attach-commit optional
  2016-02-11 17:29     ` Nicolas Goaziou
@ 2016-02-11 18:32       ` John J Foerch
  2016-02-14 16:57         ` Nicolas Goaziou
  0 siblings, 1 reply; 8+ messages in thread
From: John J Foerch @ 2016-02-11 18:32 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 939 bytes --]

Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

> Hello,
>
> John J Foerch <jjfoerch@earthlink.net> writes:
>
>> I would be glad to do the paperwork, but as it's such a simple change, I
>> have no objections to anybody else implementing this feature request in
>> my place if they want to.  I think it would save time.
>
> There is no rush. Besides, your patch can still fit within the
> TINYCHANGE limit, albeit it would unfortunately be the last one.
>
>> Let me know if this works for this community, or whether it is
>> preferred for me to go through the FSF process.
>
> I think the best solution for the community is to finish the patch and
> apply it with a TINYCHANGE tag, while at the same time going through the
> FSF process for future patches. It's always best to eat the cake and
> have it too.
>
> Regards,

Okay, will do.  Here is an updated version of the patch.  I started the
process for copyright assignment as well.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: org-attach make use of git optional --]
[-- Type: text/x-diff, Size: 1373 bytes --]

From e89c4e833deb6a55bbb2aa231afebe0fe8bd7f23 Mon Sep 17 00:00:00 2001
From: John Foerch <jjfoerch@earthlink.net>
Date: Wed, 10 Feb 2016 17:37:03 -0500
Subject: [PATCH] org-attach: Make use of git optional

* lisp/org-attach.el (org-attach-commit): New variable.
(org-attach-attach): Use new variable.

TINYCHANGE

diff --git a/lisp/org-attach.el b/lisp/org-attach.el
index 15d4841..ebea435 100644
--- a/lisp/org-attach.el
+++ b/lisp/org-attach.el
@@ -55,6 +55,14 @@ where the Org file lives."
   :group 'org-attach
   :type 'directory)
 
+(defcustom org-attach-commit t
+  "If non-nil commit attachments with git.
+This is only done if the Org file is in a git repository."
+  :group 'org-attach
+  :type 'boolean
+  :version "25.1"
+  :package-version '(Org . "9.0"))
+
 (defcustom org-attach-git-annex-cutoff (* 32 1024)
   "If non-nil, files larger than this will be annexed instead of stored."
   :group 'org-attach
@@ -373,7 +381,8 @@ METHOD may be `cp', `mv', `ln', or `lns' default taken from
        ((eq method 'cp)	(copy-file file fname))
        ((eq method 'ln) (add-name-to-file file fname))
        ((eq method 'lns) (make-symbolic-link file fname)))
-      (org-attach-commit)
+      (when org-attach-commit
+	(org-attach-commit))
       (org-attach-tag)
       (cond ((eq org-attach-store-link-p 'attached)
 	     (org-attach-store-link fname))
-- 
2.6.4


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

* Re: org-attach-commit optional
  2016-02-11 18:32       ` John J Foerch
@ 2016-02-14 16:57         ` Nicolas Goaziou
  2016-02-14 17:09           ` John J Foerch
  0 siblings, 1 reply; 8+ messages in thread
From: Nicolas Goaziou @ 2016-02-14 16:57 UTC (permalink / raw)
  To: John J Foerch; +Cc: emacs-orgmode

Hello,

John J Foerch <jjfoerch@earthlink.net> writes:

> Okay, will do.Here is an updated version of the patch.  I started the
> process for copyright assignment as well.

Great.

I added an entry in ORG-NEWS and applied your patch. Thank you.

Regards,

-- 
Nicolas Goaziou

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

* Re: org-attach-commit optional
  2016-02-14 16:57         ` Nicolas Goaziou
@ 2016-02-14 17:09           ` John J Foerch
  0 siblings, 0 replies; 8+ messages in thread
From: John J Foerch @ 2016-02-14 17:09 UTC (permalink / raw)
  To: emacs-orgmode

Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

> Hello,
>
> John J Foerch <jjfoerch@earthlink.net> writes:
>
>> Okay, will do.Here is an updated version of the patch.  I started the
>> process for copyright assignment as well.
>
> Great.
>
> I added an entry in ORG-NEWS and applied your patch. Thank you.
>
> Regards,

Many thanks

--
John Foerch

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

end of thread, other threads:[~2016-02-14 17:10 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-10 22:39 org-attach-commit optional John J Foerch
2016-02-11  9:09 ` Nicolas Goaziou
2016-02-11 15:46   ` John J Foerch
2016-02-11 17:29     ` Nicolas Goaziou
2016-02-11 18:32       ` John J Foerch
2016-02-14 16:57         ` Nicolas Goaziou
2016-02-14 17:09           ` John J Foerch
2016-02-11  9:16 ` Marco Wahl

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.