all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Store org-files in a git repository?
@ 2012-09-07 23:28 Moritz Ulrich
  2012-09-07 23:57 ` Marcelo de Moraes Serpa
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Moritz Ulrich @ 2012-09-07 23:28 UTC (permalink / raw)
  To: Emacs-orgmode


Hello,

I plan to put my org directory (where I keep among other my agenda
files) under version control and would like to have some sort of
specialized function for that.

My dream setup would be a range of functions hooking into all sorts of
org-mode hooks, automatically committing changes done via the agenda or
other org functions together with a context dependent commit message.

For example, changing a TODO item to DONE would commit this change to
git with the following message:

* Headline title: State changed to 'DONE'

Archiving, refiling, etc. would do similar things.

A use case is automatic, safe synchronization between different machines
and generally having recoverable backups of my org setup.

This setup should work pretty good with org-merge-driver.


Has someone built something comparable to this? I'd like to give it a
try but don't want to reinvent the wheel.


Cheers,
Moritz Ulrich

--
Moritz Ulrich

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

* Re: Store org-files in a git repository?
  2012-09-07 23:28 Store org-files in a git repository? Moritz Ulrich
@ 2012-09-07 23:57 ` Marcelo de Moraes Serpa
  2012-09-08  0:26   ` Charles Philip Chan
  2012-09-08  8:45 ` Achim Gratz
  2012-09-12 14:18 ` Bastien
  2 siblings, 1 reply; 11+ messages in thread
From: Marcelo de Moraes Serpa @ 2012-09-07 23:57 UTC (permalink / raw)
  To: Moritz Ulrich; +Cc: Emacs-orgmode

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

I have not done yet, but I do use git for my org repo; however, I commit
every 6 hours via cron (and the commit message is a timestamp). I'm
planning to do something similar to what you described, but I haven't used
org-merged-driver yet. I'll play with it and post my findings, if you do,
let us know how it goes as well!

- Marcelo.

On Fri, Sep 7, 2012 at 6:28 PM, Moritz Ulrich <moritz@tarn-vedra.de> wrote:

>
> Hello,
>
> I plan to put my org directory (where I keep among other my agenda
> files) under version control and would like to have some sort of
> specialized function for that.
>
> My dream setup would be a range of functions hooking into all sorts of
> org-mode hooks, automatically committing changes done via the agenda or
> other org functions together with a context dependent commit message.
>
> For example, changing a TODO item to DONE would commit this change to
> git with the following message:
>
> * Headline title: State changed to 'DONE'
>
> Archiving, refiling, etc. would do similar things.
>
> A use case is automatic, safe synchronization between different machines
> and generally having recoverable backups of my org setup.
>
> This setup should work pretty good with org-merge-driver.
>
>
> Has someone built something comparable to this? I'd like to give it a
> try but don't want to reinvent the wheel.
>
>
> Cheers,
> Moritz Ulrich
>
> --
> Moritz Ulrich
>
>

[-- Attachment #2: Type: text/html, Size: 1829 bytes --]

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

* Re: Store org-files in a git repository?
  2012-09-07 23:57 ` Marcelo de Moraes Serpa
@ 2012-09-08  0:26   ` Charles Philip Chan
  0 siblings, 0 replies; 11+ messages in thread
From: Charles Philip Chan @ 2012-09-08  0:26 UTC (permalink / raw)
  To: Org-mode

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

Marcelo de Moraes Serpa <celoserpa@gmail.com> writes:

Hello Marcelo and Moritz:

> I have not done yet, but I do use git for my org repo; however, I
> commit every 6 hours via cron (and the commit message is a timestamp).

I have my org repo under git too. However, instead of a cron job, I use
an after-save-hook:

#+BEGIN_SRC emacs-lisp
;;Git integration
(defun git-commit ()
  (when (eq major-mode 'org-mode)
      (shell-command "git commit -a -m 'Auto commit.'")))

      (add-hook 'after-save-hook 'git-commit)
#+END_SRC

Also, I am not too sure how practical Moritz's idea is. In order to get
that fine level of commit, org-mode will have to save the file after
each operation.

Cheers,
Charles

-- 
There are no threads in a.b.p.erotica,  so there's no  gain in using a
threaded news reader.
(Unknown source)

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

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

* Re: Store org-files in a git repository?
  2012-09-07 23:28 Store org-files in a git repository? Moritz Ulrich
  2012-09-07 23:57 ` Marcelo de Moraes Serpa
@ 2012-09-08  8:45 ` Achim Gratz
  2012-09-10 22:23   ` Moritz Ulrich
  2012-09-12 14:18 ` Bastien
  2 siblings, 1 reply; 11+ messages in thread
From: Achim Gratz @ 2012-09-08  8:45 UTC (permalink / raw)
  To: emacs-orgmode

Moritz Ulrich writes:
> I plan to put my org directory (where I keep among other my agenda
> files) under version control and would like to have some sort of
> specialized function for that.
>
> My dream setup would be a range of functions hooking into all sorts of
> org-mode hooks, automatically committing changes done via the agenda or
> other org functions together with a context dependent commit message.

»The road to hell is paved with good intentions.« — proverb

What you're proposing (if I understand it correctly) would introduce
transactions to Org and with it the non-trivial problem of determining
when a transaction is finished (and started, but that's really another
one).  Git would merely be the mechanism to record the transactions and
probably not a good one at that even with the merge driver.

THat aside, even if it worked I'm sure it would annoy me so much I'd
switch it off entirely.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Wavetables for the Terratec KOMPLEXER:
http://Synth.Stromeko.net/Downloads.html#KomplexerWaves

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

* Re: Store org-files in a git repository?
  2012-09-08  8:45 ` Achim Gratz
@ 2012-09-10 22:23   ` Moritz Ulrich
  2012-09-11  2:18     ` Marcelo de Moraes Serpa
  2012-09-14 11:15     ` Bernt Hansen
  0 siblings, 2 replies; 11+ messages in thread
From: Moritz Ulrich @ 2012-09-10 22:23 UTC (permalink / raw)
  To: Achim Gratz; +Cc: emacs-orgmode

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


Achim Gratz writes:

> Moritz Ulrich writes:
>> I plan to put my org directory (where I keep among other my agenda
>> files) under version control and would like to have some sort of
>> specialized function for that.
>>
>> My dream setup would be a range of functions hooking into all sorts of
>> org-mode hooks, automatically committing changes done via the agenda or
>> other org functions together with a context dependent commit message.
>
> »The road to hell is paved with good intentions.« — proverb
>
> What you're proposing (if I understand it correctly) would introduce
> transactions to Org and with it the non-trivial problem of determining
> when a transaction is finished (and started, but that's really another
> one).  Git would merely be the mechanism to record the transactions and
> probably not a good one at that even with the merge driver.
>
> THat aside, even if it worked I'm sure it would annoy me so much I'd
> switch it off entirely.
>
>
> Regards,
> Achim.

I rarely thought about the problem of transactional operations in
org-mode. From the standpoint you mentioned, my dream doesn't look that
nice anymore.

A simple cron job for committing doesn't sound that bad anymore ;-)

Thanks for saving me much work.


Cheers,
Moritz Ulrich

--
Moritz Ulrich

[-- Attachment #2: Type: application/pgp-signature, Size: 486 bytes --]

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

* Re: Store org-files in a git repository?
  2012-09-10 22:23   ` Moritz Ulrich
@ 2012-09-11  2:18     ` Marcelo de Moraes Serpa
  2012-09-11 18:11       ` Achim Gratz
  2012-09-14 11:15     ` Bernt Hansen
  1 sibling, 1 reply; 11+ messages in thread
From: Marcelo de Moraes Serpa @ 2012-09-11  2:18 UTC (permalink / raw)
  To: Moritz Ulrich; +Cc: Achim Gratz, emacs-orgmode

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

It'd be nice to see how Google Docs does its versioning and try to model
something like that for org. I think it's a version per data saved. I
currently use a cron, but I see some value in versioning after each save.

On Mon, Sep 10, 2012 at 5:23 PM, Moritz Ulrich <moritz@tarn-vedra.de> wrote:

>
> Achim Gratz writes:
>
> > Moritz Ulrich writes:
> >> I plan to put my org directory (where I keep among other my agenda
> >> files) under version control and would like to have some sort of
> >> specialized function for that.
> >>
> >> My dream setup would be a range of functions hooking into all sorts of
> >> org-mode hooks, automatically committing changes done via the agenda or
> >> other org functions together with a context dependent commit message.
> >
> > »The road to hell is paved with good intentions.« — proverb
> >
> > What you're proposing (if I understand it correctly) would introduce
> > transactions to Org and with it the non-trivial problem of determining
> > when a transaction is finished (and started, but that's really another
> > one).  Git would merely be the mechanism to record the transactions and
> > probably not a good one at that even with the merge driver.
> >
> > THat aside, even if it worked I'm sure it would annoy me so much I'd
> > switch it off entirely.
> >
> >
> > Regards,
> > Achim.
>
> I rarely thought about the problem of transactional operations in
> org-mode. From the standpoint you mentioned, my dream doesn't look that
> nice anymore.
>
> A simple cron job for committing doesn't sound that bad anymore ;-)
>
> Thanks for saving me much work.
>
>
> Cheers,
> Moritz Ulrich
>
> --
> Moritz Ulrich
>

[-- Attachment #2: Type: text/html, Size: 2226 bytes --]

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

* Re: Store org-files in a git repository?
  2012-09-11  2:18     ` Marcelo de Moraes Serpa
@ 2012-09-11 18:11       ` Achim Gratz
  0 siblings, 0 replies; 11+ messages in thread
From: Achim Gratz @ 2012-09-11 18:11 UTC (permalink / raw)
  To: emacs-orgmode

Marcelo de Moraes Serpa writes:
> It'd be nice to see how Google Docs does its versioning and try to
> model something like that for org. I think it's a version per data
> saved. I currently use a cron, but I see some value in versioning
> after each save.

That doesn't solve the problem.  A commit is named commit for a reason:
one assumption is that the change it effects is complete and (in the
case of software) it compiles and runs.  There is good reason not to
infer anything like that from the simple fact that I've saved the file.
In fact, stashes in Git are just recognition that sometimes you simply
don't want to make that "commitment", but need to store something away
that is not quite complete.

If you want to see "saving is versioning" in action, try (open)VMS.  Or
customize Emacs so that it does versioned backup files.  It is
occasionally useful to do that, but just like with RCS, versioning of
single files only gets you so far before things break.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Factory and User Sound Singles for Waldorf Q+, Q and microQ:
http://Synth.Stromeko.net/Downloads.html#WaldorfSounds

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

* Re: Store org-files in a git repository?
  2012-09-07 23:28 Store org-files in a git repository? Moritz Ulrich
  2012-09-07 23:57 ` Marcelo de Moraes Serpa
  2012-09-08  8:45 ` Achim Gratz
@ 2012-09-12 14:18 ` Bastien
  2012-09-12 16:52   ` Samuel Wales
  2 siblings, 1 reply; 11+ messages in thread
From: Bastien @ 2012-09-12 14:18 UTC (permalink / raw)
  To: Moritz Ulrich; +Cc: Emacs-orgmode

Moritz Ulrich <moritz@tarn-vedra.de> writes:

> My dream setup would be a range of functions hooking into all sorts of
> org-mode hooks, automatically committing changes done via the agenda or
> other org functions together with a context dependent commit message.

This calls for a good logging system.

Something that stores any action you take on a .org file (editing an
entry, marking it as DONE, clocking it, refiling it, etc.) and that you
can easily *query*.

For now the logs are somewhat hackish, more a casual convenience, 
and the actual system is not good for stable parsing.

That's something I considered working on at some point, but starting
this before org-element.el was complete was not a good idea.

Ok, now org-element.el is complete...  :)

-- 
 Bastien

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

* Re: Store org-files in a git repository?
  2012-09-12 14:18 ` Bastien
@ 2012-09-12 16:52   ` Samuel Wales
  2012-09-13 18:05     ` Marcelo de Moraes Serpa
  0 siblings, 1 reply; 11+ messages in thread
From: Samuel Wales @ 2012-09-12 16:52 UTC (permalink / raw)
  To: Bastien; +Cc: Emacs-orgmode, Moritz Ulrich

On 9/12/12, Bastien <bzg@altern.org> wrote:
> This calls for a good logging system.

Of possible tangential relevance for the display part of it: "FR:
inactive timestamps in log mode (and a sorting FR)"

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

* Re: Store org-files in a git repository?
  2012-09-12 16:52   ` Samuel Wales
@ 2012-09-13 18:05     ` Marcelo de Moraes Serpa
  0 siblings, 0 replies; 11+ messages in thread
From: Marcelo de Moraes Serpa @ 2012-09-13 18:05 UTC (permalink / raw)
  To: Samuel Wales; +Cc: Bastien, Emacs-orgmode, Moritz Ulrich

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

>
> This calls for a good logging system.
> Something that stores any action you take on a .org file (editing an
> entry, marking it as DONE, clocking it, refiling it, etc.) and that you
> can easily *query*.
> For now the logs are somewhat hackish, more a casual convenience,
> and the actual system is not good for stable parsing.
> That's something I considered working on at some point, but starting
> this before org-element.el was complete was not a good idea.
> Ok, now org-element.el is complete...  :)


This sounds promising, Bastien!

Let us know how it goes.

On Wed, Sep 12, 2012 at 11:52 AM, Samuel Wales <samologist@gmail.com> wrote:

> On 9/12/12, Bastien <bzg@altern.org> wrote:
> > This calls for a good logging system.
>
> Of possible tangential relevance for the display part of it: "FR:
> inactive timestamps in log mode (and a sorting FR)"
>
>

[-- Attachment #2: Type: text/html, Size: 3152 bytes --]

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

* Re: Store org-files in a git repository?
  2012-09-10 22:23   ` Moritz Ulrich
  2012-09-11  2:18     ` Marcelo de Moraes Serpa
@ 2012-09-14 11:15     ` Bernt Hansen
  1 sibling, 0 replies; 11+ messages in thread
From: Bernt Hansen @ 2012-09-14 11:15 UTC (permalink / raw)
  To: Moritz Ulrich; +Cc: emacs-orgmode

Moritz Ulrich <moritz@tarn-vedra.de> writes:

> A simple cron job for committing doesn't sound that bad anymore ;-)

Hi Moritz,

I use an hourly cron/windows schedule job to make commits when changes
occur in my org files.  My script details are here in case you find it
useful:

http://doc.norang.ca/org-mode.html#GitSync

Regards,
Bernt

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

end of thread, other threads:[~2012-09-14 11:16 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-07 23:28 Store org-files in a git repository? Moritz Ulrich
2012-09-07 23:57 ` Marcelo de Moraes Serpa
2012-09-08  0:26   ` Charles Philip Chan
2012-09-08  8:45 ` Achim Gratz
2012-09-10 22:23   ` Moritz Ulrich
2012-09-11  2:18     ` Marcelo de Moraes Serpa
2012-09-11 18:11       ` Achim Gratz
2012-09-14 11:15     ` Bernt Hansen
2012-09-12 14:18 ` Bastien
2012-09-12 16:52   ` Samuel Wales
2012-09-13 18:05     ` Marcelo de Moraes Serpa

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.