all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [SYNC] How do you sync your org-mode files between n devices (n > 2)
@ 2013-09-03 21:34 noreply
  2013-09-04  6:04 ` Suvayu Ali
                   ` (4 more replies)
  0 siblings, 5 replies; 21+ messages in thread
From: noreply @ 2013-09-03 21:34 UTC (permalink / raw)
  To: emacs-orgmode

Hello,

I have a problem. I need to sync my files between several devices
(currently 3). At first, I thought the solution would have been to use
mobileorg (that made sense since I also use an android device) but as
far as I understand it, it is not really designed for that purpose (I
have several agendas.org staying in the hierarchy with conflicts from
all sources...)

How do you sync your files easily and share them between 3, 4 or even
more places ?

Regards
-- 
XMA

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

* Re: [SYNC] How do you sync your org-mode files between n devices (n > 2)
  2013-09-03 21:34 [SYNC] How do you sync your org-mode files between n devices (n > 2) noreply
@ 2013-09-04  6:04 ` Suvayu Ali
  2013-09-04  6:30   ` Xiao-Yong Jin
  2013-09-04  6:21 ` Jambunathan K
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 21+ messages in thread
From: Suvayu Ali @ 2013-09-04  6:04 UTC (permalink / raw)
  To: emacs-orgmode

On Tue, Sep 03, 2013 at 11:34:52PM +0200, noreply@maillard.im wrote:
> Hello,
> 
> I have a problem. I need to sync my files between several devices
> (currently 3). At first, I thought the solution would have been to use
> mobileorg (that made sense since I also use an android device) but as
> far as I understand it, it is not really designed for that purpose (I
> have several agendas.org staying in the hierarchy with conflicts from
> all sources...)
> 
> How do you sync your files easily and share them between 3, 4 or even
> more places ?

I use Git.

-- 
Suvayu

Open source is the future. It sets us free.

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

* Re: [SYNC] How do you sync your org-mode files between n devices (n > 2)
  2013-09-03 21:34 [SYNC] How do you sync your org-mode files between n devices (n > 2) noreply
  2013-09-04  6:04 ` Suvayu Ali
@ 2013-09-04  6:21 ` Jambunathan K
  2013-09-04  6:47 ` Paul Rudin
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 21+ messages in thread
From: Jambunathan K @ 2013-09-04  6:21 UTC (permalink / raw)
  To: noreply; +Cc: emacs-orgmode


> I have a problem. I need to sync my files between several devices
> (currently 3). 

I don't use multiple machines.

I use unison to copy files between Hard disk and USB disk.  Apparently
unison is superior to rsync.

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

* Re: [SYNC] How do you sync your org-mode files between n devices (n > 2)
  2013-09-04  6:04 ` Suvayu Ali
@ 2013-09-04  6:30   ` Xiao-Yong Jin
  2013-09-04  7:43     ` Suvayu Ali
  0 siblings, 1 reply; 21+ messages in thread
From: Xiao-Yong Jin @ 2013-09-04  6:30 UTC (permalink / raw)
  To: emacs-orgmode@gnu.org


On Sep 4, 2013, at 3:04 PM, Suvayu Ali <fatkasuvayu+linux@gmail.com> wrote:

> On Tue, Sep 03, 2013 at 11:34:52PM +0200, noreply@maillard.im wrote:
>> Hello,
>> 
>> I have a problem. I need to sync my files between several devices
>> (currently 3). At first, I thought the solution would have been to use
>> mobileorg (that made sense since I also use an android device) but as
>> far as I understand it, it is not really designed for that purpose (I
>> have several agendas.org staying in the hierarchy with conflicts from
>> all sources...)
>> 
>> How do you sync your files easily and share them between 3, 4 or even
>> more places ?
> 
> I use Git.

You might try unison.  Works for me.

> -- 
> Suvayu
> 
> Open source is the future. It sets us free.
> 

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

* Re: [SYNC] How do you sync your org-mode files between n devices (n > 2)
  2013-09-03 21:34 [SYNC] How do you sync your org-mode files between n devices (n > 2) noreply
  2013-09-04  6:04 ` Suvayu Ali
  2013-09-04  6:21 ` Jambunathan K
@ 2013-09-04  6:47 ` Paul Rudin
  2013-09-04  6:50 ` Samuel Loury
  2013-09-05 20:00 ` Marc Ihm
  4 siblings, 0 replies; 21+ messages in thread
From: Paul Rudin @ 2013-09-04  6:47 UTC (permalink / raw)
  To: emacs-orgmode

noreply@maillard.im writes:


> I have a problem. I need to sync my files between several devices
> (currently 3). At first, I thought the solution would have been to use
> mobileorg (that made sense since I also use an android device) but as
> far as I understand it, it is not really designed for that purpose (I
> have several agendas.org staying in the hierarchy with conflicts from
> all sources...)
>
> How do you sync your files easily and share them between 3, 4 or even
> more places ?

Dropbox.

I also use bitbucket for coding projects proper, but its overkill if you
just want to keep up to date with latest versions of files.

The nice thing about using Dropbox is that you don't need to check
anything in - as long as you save files you can just work away from you
desktop and then pick things up exactly where you left off on your
laptop.

If you have changes that you need to merge together on different devices
then you probably do want to use git or similar.

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

* Re: [SYNC] How do you sync your org-mode files between n devices (n > 2)
  2013-09-03 21:34 [SYNC] How do you sync your org-mode files between n devices (n > 2) noreply
                   ` (2 preceding siblings ...)
  2013-09-04  6:47 ` Paul Rudin
@ 2013-09-04  6:50 ` Samuel Loury
  2013-09-05 20:00 ` Marc Ihm
  4 siblings, 0 replies; 21+ messages in thread
From: Samuel Loury @ 2013-09-04  6:50 UTC (permalink / raw)
  To: noreply, emacs-orgmode

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

Hi,

noreply@maillard.im writes:

> How do you sync your files easily and share them between 3, 4 or even
> more places ?
You might find the answer to that question in a previous thread:

http://www.mail-archive.com/emacs-orgmode@gnu.org/msg73502.html

Hope that helps.
Best,
-- 
Konubinix
GPG Key    : 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 489 bytes --]

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

* Re: [SYNC] How do you sync your org-mode files between n devices (n > 2)
  2013-09-04  6:30   ` Xiao-Yong Jin
@ 2013-09-04  7:43     ` Suvayu Ali
  2013-09-04  8:00       ` Torsten Wagner
  2013-09-05  8:50       ` Alan Schmitt
  0 siblings, 2 replies; 21+ messages in thread
From: Suvayu Ali @ 2013-09-04  7:43 UTC (permalink / raw)
  To: emacs-orgmode

On Wed, Sep 04, 2013 at 03:30:24PM +0900, Xiao-Yong Jin wrote:
> 
> On Sep 4, 2013, at 3:04 PM, Suvayu Ali <fatkasuvayu+linux@gmail.com> wrote:
> 
> > On Tue, Sep 03, 2013 at 11:34:52PM +0200, noreply@maillard.im wrote:
> >> Hello,
> >> 
> >> I have a problem. I need to sync my files between several devices
> >> (currently 3). At first, I thought the solution would have been to use
> >> mobileorg (that made sense since I also use an android device) but as
> >> far as I understand it, it is not really designed for that purpose (I
> >> have several agendas.org staying in the hierarchy with conflicts from
> >> all sources...)
> >> 
> >> How do you sync your files easily and share them between 3, 4 or even
> >> more places ?
> > 
> > I use Git.
> 
> You might try unison.  Works for me.

I think the issue with tools like Unison, Dropbox, is conflict
resolution on simultaneous edits.  Traditional version control does a
better job of that, but then it loses the convenience of these other
tools.

I believe there is a list member (Alan) close to Unison development; in
the thread referenced by Samuel there is some discussion on how this
could be done in a more well defined manner.

Hope this helps,

-- 
Suvayu

Open source is the future. It sets us free.

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

* Re: [SYNC] How do you sync your org-mode files between n devices (n > 2)
  2013-09-04  7:43     ` Suvayu Ali
@ 2013-09-04  8:00       ` Torsten Wagner
  2013-09-05  8:50       ` Alan Schmitt
  1 sibling, 0 replies; 21+ messages in thread
From: Torsten Wagner @ 2013-09-04  8:00 UTC (permalink / raw)
  To: Suvayu Ali; +Cc: Org Mode Mailing List

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

Hi,

For me it is git using a central "server". I push from the clients to the
server and pull from the server only. Never on a device to device base,
because most of the time the devices can't see each other (different
networks).


Hope that helps

Torsten



On 4 September 2013 09:43, Suvayu Ali <fatkasuvayu+linux@gmail.com> wrote:

> On Wed, Sep 04, 2013 at 03:30:24PM +0900, Xiao-Yong Jin wrote:
> >
> > On Sep 4, 2013, at 3:04 PM, Suvayu Ali <fatkasuvayu+linux@gmail.com>
> wrote:
> >
> > > On Tue, Sep 03, 2013 at 11:34:52PM +0200, noreply@maillard.im wrote:
> > >> Hello,
> > >>
> > >> I have a problem. I need to sync my files between several devices
> > >> (currently 3). At first, I thought the solution would have been to use
> > >> mobileorg (that made sense since I also use an android device) but as
> > >> far as I understand it, it is not really designed for that purpose (I
> > >> have several agendas.org staying in the hierarchy with conflicts from
> > >> all sources...)
> > >>
> > >> How do you sync your files easily and share them between 3, 4 or even
> > >> more places ?
> > >
> > > I use Git.
> >
> > You might try unison.  Works for me.
>
> I think the issue with tools like Unison, Dropbox, is conflict
> resolution on simultaneous edits.  Traditional version control does a
> better job of that, but then it loses the convenience of these other
> tools.
>
> I believe there is a list member (Alan) close to Unison development; in
> the thread referenced by Samuel there is some discussion on how this
> could be done in a more well defined manner.
>
> Hope this helps,
>
> --
> Suvayu
>
> Open source is the future. It sets us free.
>
>

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

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

* Re: [SYNC] How do you sync your org-mode files between n devices (n > 2)
  2013-09-04  7:43     ` Suvayu Ali
  2013-09-04  8:00       ` Torsten Wagner
@ 2013-09-05  8:50       ` Alan Schmitt
  2013-09-05  9:42         ` Suvayu Ali
  1 sibling, 1 reply; 21+ messages in thread
From: Alan Schmitt @ 2013-09-05  8:50 UTC (permalink / raw)
  To: Suvayu Ali; +Cc: emacs-orgmode

fatkasuvayu+linux@gmail.com writes:

> I think the issue with tools like Unison, Dropbox, is conflict
> resolution on simultaneous edits.  Traditional version control does a
> better job of that, but then it loses the convenience of these other
> tools.
>
> I believe there is a list member (Alan) close to Unison development; in
> the thread referenced by Samuel there is some discussion on how this
> could be done in a more well defined manner.

Unison can call external tools to merge conflicting files. If someone
wants to use such a tool with unison, I can definitely give a hand.

Alan

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

* Re: [SYNC] How do you sync your org-mode files between n devices (n > 2)
  2013-09-05  8:50       ` Alan Schmitt
@ 2013-09-05  9:42         ` Suvayu Ali
  2013-09-05 10:00           ` Alan Schmitt
  0 siblings, 1 reply; 21+ messages in thread
From: Suvayu Ali @ 2013-09-05  9:42 UTC (permalink / raw)
  To: Alan Schmitt; +Cc: emacs-orgmode

Hi Alan,

On Thu, Sep 05, 2013 at 10:50:18AM +0200, Alan Schmitt wrote:
> fatkasuvayu+linux@gmail.com writes:
> 
> > I think the issue with tools like Unison, Dropbox, is conflict
> > resolution on simultaneous edits.  Traditional version control does a
> > better job of that, but then it loses the convenience of these other
> > tools.
> >
> > I believe there is a list member (Alan) close to Unison development; in
> > the thread referenced by Samuel there is some discussion on how this
> > could be done in a more well defined manner.
> 
> Unison can call external tools to merge conflicting files. If someone
> wants to use such a tool with unison, I can definitely give a hand.

If you can find the time, I have a somewhat more involved proposal for
you :).

I think this would be a wonderful addition to Worg.  Probably the FAQ is
more appropriate (under "Tips and Tricks") since this is one of most
commonly asked questions on the list.  On the other hand, if you think
covering this topic requires more than just a few lines, a longer entry
or short article in the config section would be more appropriate.

Cheers,

-- 
Suvayu

Open source is the future. It sets us free.

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

* Re: [SYNC] How do you sync your org-mode files between n devices (n > 2)
  2013-09-05  9:42         ` Suvayu Ali
@ 2013-09-05 10:00           ` Alan Schmitt
  2013-09-05 10:26             ` Karl Voit
                               ` (2 more replies)
  0 siblings, 3 replies; 21+ messages in thread
From: Alan Schmitt @ 2013-09-05 10:00 UTC (permalink / raw)
  To: Suvayu Ali; +Cc: emacs-orgmode

Hi,

fatkasuvayu+linux@gmail.com writes:

> Hi Alan,
>
> On Thu, Sep 05, 2013 at 10:50:18AM +0200, Alan Schmitt wrote:
>> fatkasuvayu+linux@gmail.com writes:
>> 
>> > I think the issue with tools like Unison, Dropbox, is conflict
>> > resolution on simultaneous edits.  Traditional version control does a
>> > better job of that, but then it loses the convenience of these other
>> > tools.
>> >
>> > I believe there is a list member (Alan) close to Unison development; in
>> > the thread referenced by Samuel there is some discussion on how this
>> > could be done in a more well defined manner.
>> 
>> Unison can call external tools to merge conflicting files. If someone
>> wants to use such a tool with unison, I can definitely give a hand.
>
> If you can find the time, I have a somewhat more involved proposal for
> you :).
>
> I think this would be a wonderful addition to Worg.  Probably the FAQ is
> more appropriate (under "Tips and Tricks") since this is one of most
> commonly asked questions on the list.  On the other hand, if you think
> covering this topic requires more than just a few lines, a longer entry
> or short article in the config section would be more appropriate.

I can't promise anything, but I can try to write something. What
external merging tool should I use?

Thanks,

Alan

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

* Re: [SYNC] How do you sync your org-mode files between n devices (n > 2)
  2013-09-05 10:00           ` Alan Schmitt
@ 2013-09-05 10:26             ` Karl Voit
  2013-09-05 11:42               ` Jonas Hörsch
  2013-09-05 11:25             ` [SYNC] How do you sync your org-mode files between n devices (n > 2) Suvayu Ali
  2013-09-05 13:37             ` [SYNC] How do you sync your org-mode files between n devices (n > 2) Robert Horn
  2 siblings, 1 reply; 21+ messages in thread
From: Karl Voit @ 2013-09-05 10:26 UTC (permalink / raw)
  To: emacs-orgmode

* Alan Schmitt <alan.schmitt@polytechnique.org> wrote:
> Hi,

Hi,

> fatkasuvayu+linux@gmail.com writes:
>
>> I think this would be a wonderful addition to Worg.  

Absolutely!

I am using unison as well. So far, I resolved conflicts (I try to do
anything I can to avoid them) very basic manually. I'd love to learn
how to do it with software support in a quick how-to.

> I can't promise anything, but I can try to write something. What
> external merging tool should I use?

I haven't used it yet but I read that Emacs offers some kind of a
3-way-merger ...

-- 
mail|git|SVN|photos|postings|SMS|phonecalls|RSS|CSV|XML to Org-mode:
       > get Memacs from https://github.com/novoid/Memacs <

https://github.com/novoid/extract_pdf_annotations_to_orgmode + more on github

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

* Re: [SYNC] How do you sync your org-mode files between n devices (n > 2)
  2013-09-05 10:00           ` Alan Schmitt
  2013-09-05 10:26             ` Karl Voit
@ 2013-09-05 11:25             ` Suvayu Ali
  2013-09-05 12:31               ` Alan Schmitt
  2013-09-05 13:37             ` [SYNC] How do you sync your org-mode files between n devices (n > 2) Robert Horn
  2 siblings, 1 reply; 21+ messages in thread
From: Suvayu Ali @ 2013-09-05 11:25 UTC (permalink / raw)
  To: Alan Schmitt; +Cc: emacs-orgmode

On Thu, Sep 05, 2013 at 12:00:02PM +0200, Alan Schmitt wrote:
> Hi,
> 
> fatkasuvayu+linux@gmail.com writes:
> 
> > I think this would be a wonderful addition to Worg.  Probably the FAQ is
> > more appropriate (under "Tips and Tricks") since this is one of most
> > commonly asked questions on the list.  On the other hand, if you think
> > covering this topic requires more than just a few lines, a longer entry
> > or short article in the config section would be more appropriate.
> 
> I can't promise anything, but I can try to write something. What
> external merging tool should I use?

I think the most appropriate tool would be org-merge-driver.  But I'm
not sure how reliable it is.  That said, what might be nicer is if you
treat the external tool bits generically.  Then people can choose their
own tools in the future; also that will probably be less work for you
since you don't have to figure out the details of the external merging
tool yourself.

What I'm after is having all the Unison config bits on Worg, then people
choose how they want to use it:
1. plain sync,
2. sync with merging (with their own choice of tools)

I or someone else could then add the Dropbox like, and "version control
(Git) way" of syncing.  This would then be a fairly complete FAQ on
synchronisation questions.  Does that seem feasible to you?

Thanks a lot,

:)

-- 
Suvayu

Open source is the future. It sets us free.

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

* Re: [SYNC] How do you sync your org-mode files between n devices (n > 2)
  2013-09-05 10:26             ` Karl Voit
@ 2013-09-05 11:42               ` Jonas Hörsch
  2013-09-05 13:03                 ` [SYNC] How do you sync your org-mode files between ndevices (n > 2)) Alan Schmitt
  0 siblings, 1 reply; 21+ messages in thread
From: Jonas Hörsch @ 2013-09-05 11:42 UTC (permalink / raw)
  To: emacs-orgmode

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

On Thu, Sep 05 2013, Karl Voit wrote:

> * Alan Schmitt <alan.schmitt@polytechnique.org> wrote:
>> I can't promise anything, but I can try to write something. What
>> external merging tool should I use?
>
> I haven't used it yet but I read that Emacs offers some kind of a
> 3-way-merger ...

and then there is an early git-merge-tool[1] or rather the org-merge-driver
for git. i've been using it for half a year now for my org files in
git, although i seldom have conflicts, as we're just a small group.

maybe somebody on the list has more info on its status?

cheers,
jonas

Footnotes:

[1] http://orgmode.org/worg/org-contrib/gsoc2012/student-projects/git-merge-tool/index.html

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

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

* Re: [SYNC] How do you sync your org-mode files between n devices (n > 2)
  2013-09-05 11:25             ` [SYNC] How do you sync your org-mode files between n devices (n > 2) Suvayu Ali
@ 2013-09-05 12:31               ` Alan Schmitt
  2013-09-05 12:54                 ` Suvayu Ali
  2013-09-05 16:14                 ` [SYNC] How do you sync your org-mode files between ndevices (n > 2)) Ramon Diaz-Uriarte
  0 siblings, 2 replies; 21+ messages in thread
From: Alan Schmitt @ 2013-09-05 12:31 UTC (permalink / raw)
  To: Suvayu Ali; +Cc: emacs-orgmode

fatkasuvayu+linux@gmail.com writes:

> On Thu, Sep 05, 2013 at 12:00:02PM +0200, Alan Schmitt wrote:
>> Hi,
>> 
>> fatkasuvayu+linux@gmail.com writes:
>> 
>> > I think this would be a wonderful addition to Worg.  Probably the FAQ is
>> > more appropriate (under "Tips and Tricks") since this is one of most
>> > commonly asked questions on the list.  On the other hand, if you think
>> > covering this topic requires more than just a few lines, a longer entry
>> > or short article in the config section would be more appropriate.
>> 
>> I can't promise anything, but I can try to write something. What
>> external merging tool should I use?
>
> I think the most appropriate tool would be org-merge-driver.  But I'm
> not sure how reliable it is.  That said, what might be nicer is if you
> treat the external tool bits generically.  Then people can choose their
> own tools in the future; also that will probably be less work for you
> since you don't have to figure out the details of the external merging
> tool yourself.

It makes sense.

> What I'm after is having all the Unison config bits on Worg, then people
> choose how they want to use it:
> 1. plain sync,
> 2. sync with merging (with their own choice of tools)
>
> I or someone else could then add the Dropbox like, and "version control
> (Git) way" of syncing.  This would then be a fairly complete FAQ on
> synchronisation questions.  Does that seem feasible to you?

I've been playing with the merging using ediff, and it works. I'll
explain it here, and depending on the feedback, I'll put it on worg.

Alan

* Synchronizing org files with Unison

This describes how to synchronize org files using the [[http://www.cis.upenn.edu/~bcpierce/unison/][Unison file synchronizer]],
as well as how to configure it to use an external tool to merge conflicting
edits.

** Prerequisites

You should have Unison up and running. Binaries can be found [[http://www.cis.upenn.edu/~bcpierce/unison/download.html][here]] and the
documentation is [[http://www.cis.upenn.edu/~bcpierce/unison/download/releases/stable/unison-manual.html][here]].

** Synchronization

Unison is a file synchronizer, thus it may be used to synchronize org files. To
configure Unison, on uses a /profile/ which states where the things to
synchronize are as well as some options. Assuming I want to synchronize the
files in ~/Users/schmitta/dir1~ and ~/Users/schmitta/dir2~, the profile would
look like this

#+BEGIN_EXAMPLE
root = /Users/schmitta/dir1
root = /Users/schmitta/dir2
#+END_EXAMPLE

In most cases Unison will be used with a remote machine. The local machine is
called the /client/ and the remote one the /server/. For such remote
synchronization, the ~unison~ binary must be installed in the server as
well. The simplest way to connect to the machine is using ssh. One should check
that unison can be found there by doing ~ssh user@remote unison -version~. If
~unison~ cannot be found in the path, one may set the ~servercmd~ option as
indicated in the next example.

(Please see the [[http://www.cis.upenn.edu/~bcpierce/unison/download/releases/stable/unison-manual.html#roots][manual section on roots]] for further details.)

#+BEGIN_EXAMPLE
root = /Users/schmitta/dir1
root = ssh://user@remote/relative/path/to/dir2

servercmd = /usr/bin/unison
#+END_EXAMPLE

** Merging

As Unison works on the level of files, it will trigger a /conflict/ if both
files have changed since the last synchronization. In that case one can only
choose which file to keep, which is not satisfying. Unison offers the
possibility to use external tools to merge the files. There is an [[http://www.cis.upenn.edu/~bcpierce/unison/download/releases/stable/unison-manual.html#merge][extensive
manual section]] regarding this, we'll just describe how to use emacs and ediff to
do it.

For better merging, we will ask unison to keep the last synchronized version of
every org file on the client; this way we can use ediff with ancestor. These
~currentbackup~ files may live alongside the synchronized files (with names of
the form ~.bak.version.name~, which is configurable) or in a central location.

Here is the modified configuration file.

#+BEGIN_EXAMPLE
root = /Users/schmitta/dir1
root = ssh://user@remote/relative/path/to/dir2

servercmd = /usr/bin/unison

backupcurrent = Name *.org
backuplocation = local
maxbackups = 0

merge = Name *.org -> emacsclient -c --eval '(ediff-merge-files-with-ancestor "CURRENT1" "CURRENT2" "CURRENTARCH" nil "NEW")'

#+END_EXAMPLE

The ~backupcurrent~ option tells unison to keep a backup of the last
synchronized version of ever file with an ~org~ extension. The location of the
backup should be local (alongside the file). Finally, no other backup should be
created.

Next follows the merge command. For every org file in conflict, use the command
that launches a new emacs frame calling the ediff with ancestor function. The
~CURRENT1~, ~CURRENT2~, and ~CURRENTARCH~ strings are  replaced with the file
from the first root, the file from the second root, and the last synchronized
version. The ~NEW~ file is where Unison expects the file to be saved (which will
be done by the ediff session).

Thus, when an org file has been modified on both hosts, an ediff session will be
launched in a new frame. Closing the frame will make Unison commit the merge (it
waits until the command has finished).

If one does not want to use backups, it's possible to use the simpler ediff
(without ancestor) command as follows.

#+BEGIN_EXAMPLE
root = /Users/schmitta/dir1
root = ssh://user@remote/relative/path/to/dir2

servercmd = /usr/bin/unison

merge = Name *.org -> emacsclient -c --eval '(ediff-merge-files "CURRENT1" "CURRENT2" nil "NEW")'

#+END_EXAMPLE

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

* Re: [SYNC] How do you sync your org-mode files between n devices (n > 2)
  2013-09-05 12:31               ` Alan Schmitt
@ 2013-09-05 12:54                 ` Suvayu Ali
  2013-09-05 13:24                   ` Alan Schmitt
  2013-09-05 16:14                 ` [SYNC] How do you sync your org-mode files between ndevices (n > 2)) Ramon Diaz-Uriarte
  1 sibling, 1 reply; 21+ messages in thread
From: Suvayu Ali @ 2013-09-05 12:54 UTC (permalink / raw)
  To: Alan Schmitt; +Cc: emacs-orgmode

Just a few typo/editorial comments.

On Thu, Sep 05, 2013 at 02:31:42PM +0200, Alan Schmitt wrote:
> 
> * Synchronizing org files with Unison
> 
> This describes how to synchronize org files using the [[http://www.cis.upenn.edu/~bcpierce/unison/][Unison file synchronizer]],
> as well as how to configure it to use an external tool to merge conflicting
> edits.
> 
> ** Prerequisites
> 
> You should have Unison up and running. Binaries can be found [[http://www.cis.upenn.edu/~bcpierce/unison/download.html][here]] and the
> documentation is [[http://www.cis.upenn.edu/~bcpierce/unison/download/releases/stable/unison-manual.html][here]].
> 
> ** Synchronization
> 
> Unison is a file synchronizer, thus it may be used to synchronize org files. To
> configure Unison, on uses a /profile/ which states where the things to

on uses -> one uses

> synchronize are as well as some options. Assuming I want to synchronize the
> files in ~/Users/schmitta/dir1~ and ~/Users/schmitta/dir2~, the profile would
> look like this
> 
> #+BEGIN_EXAMPLE
> root = /Users/schmitta/dir1
> root = /Users/schmitta/dir2
> #+END_EXAMPLE
> 
> In most cases Unison will be used with a remote machine. The local machine is
> called the /client/ and the remote one the /server/. For such remote
> synchronization, the ~unison~ binary must be installed in the server as
> well. The simplest way to connect to the machine is using ssh. One should check
> that unison can be found there by doing ~ssh user@remote unison -version~. If
> ~unison~ cannot be found in the path, one may set the ~servercmd~ option as
> indicated in the next example.
> 
> (Please see the [[http://www.cis.upenn.edu/~bcpierce/unison/download/releases/stable/unison-manual.html#roots][manual section on roots]] for further details.)
> 
> #+BEGIN_EXAMPLE
> root = /Users/schmitta/dir1
> root = ssh://user@remote/relative/path/to/dir2
> 
> servercmd = /usr/bin/unison
> #+END_EXAMPLE
> 
> ** Merging
> 
> As Unison works on the level of files, it will trigger a /conflict/ if both
> files have changed since the last synchronization. In that case one can only
> choose which file to keep, which is not satisfying. Unison offers the

Maybe satisfactory is better than satisfying?

> possibility to use external tools to merge the files. There is an [[http://www.cis.upenn.edu/~bcpierce/unison/download/releases/stable/unison-manual.html#merge][extensive
> manual section]] regarding this, we'll just describe how to use emacs and ediff to
> do it.
> 
> For better merging, we will ask unison to keep the last synchronized version of
> every org file on the client; this way we can use ediff with ancestor. These
> ~currentbackup~ files may live alongside the synchronized files (with names of
> the form ~.bak.version.name~, which is configurable) or in a central location.
> 
> Here is the modified configuration file.
> 
> #+BEGIN_EXAMPLE
> root = /Users/schmitta/dir1
> root = ssh://user@remote/relative/path/to/dir2
> 
> servercmd = /usr/bin/unison
> 
> backupcurrent = Name *.org
> backuplocation = local
> maxbackups = 0
> 
> merge = Name *.org -> emacsclient -c --eval '(ediff-merge-files-with-ancestor "CURRENT1" "CURRENT2" "CURRENTARCH" nil "NEW")'
> 
> #+END_EXAMPLE
> 
> The ~backupcurrent~ option tells unison to keep a backup of the last
> synchronized version of ever file with an ~org~ extension. The location of the

ever file -> every file

> backup should be local (alongside the file). Finally, no other backup should be
> created.
> 
> Next follows the merge command. For every org file in conflict, use the command
> that launches a new emacs frame calling the ediff with ancestor function. The
> ~CURRENT1~, ~CURRENT2~, and ~CURRENTARCH~ strings are  replaced with the file
> from the first root, the file from the second root, and the last synchronized
> version. The ~NEW~ file is where Unison expects the file to be saved (which will
> be done by the ediff session).
> 
> Thus, when an org file has been modified on both hosts, an ediff session will be
> launched in a new frame. Closing the frame will make Unison commit the merge (it
> waits until the command has finished).
> 
> If one does not want to use backups, it's possible to use the simpler ediff
> (without ancestor) command as follows.
> 
> #+BEGIN_EXAMPLE
> root = /Users/schmitta/dir1
> root = ssh://user@remote/relative/path/to/dir2
> 
> servercmd = /usr/bin/unison
> 
> merge = Name *.org -> emacsclient -c --eval '(ediff-merge-files "CURRENT1" "CURRENT2" nil "NEW")'
> 
> #+END_EXAMPLE

This a very clear and complete write-up.  Thanks a lot Alan!

:)

-- 
Suvayu

Open source is the future. It sets us free.

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

* Re: [SYNC] How do you sync your org-mode files between ndevices (n > 2))
  2013-09-05 11:42               ` Jonas Hörsch
@ 2013-09-05 13:03                 ` Alan Schmitt
  0 siblings, 0 replies; 21+ messages in thread
From: Alan Schmitt @ 2013-09-05 13:03 UTC (permalink / raw)
  To: Jonas Hörsch; +Cc: emacs-orgmode

coroa@online.de writes:

> On Thu, Sep 05 2013, Karl Voit wrote:
>
>> * Alan Schmitt <alan.schmitt@polytechnique.org> wrote:
>>> I can't promise anything, but I can try to write something. What
>>> external merging tool should I use?
>>
>> I haven't used it yet but I read that Emacs offers some kind of a
>> 3-way-merger ...
>
> and then there is an early git-merge-tool[1] or rather the org-merge-driver
> for git. i've been using it for half a year now for my org files in
> git, although i seldom have conflicts, as we're just a small group.
>
> maybe somebody on the list has more info on its status?

If someone is adventurous enough, the command to use org-merge-driver
with unison would be:

org-merge-driver -- CURRENTARCH CURRENT1 CURRENT2 NEW

(see my other mail for the rest of the details)

Alan

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

* Re: [SYNC] How do you sync your org-mode files between n devices (n > 2)
  2013-09-05 12:54                 ` Suvayu Ali
@ 2013-09-05 13:24                   ` Alan Schmitt
  0 siblings, 0 replies; 21+ messages in thread
From: Alan Schmitt @ 2013-09-05 13:24 UTC (permalink / raw)
  To: Suvayu Ali; +Cc: emacs-orgmode

fatkasuvayu+linux@gmail.com writes:

> Just a few typo/editorial comments.

I fixed them.

> This a very clear and complete write-up.  Thanks a lot Alan!
>
> :)

Thanks. It's online at
http://orgmode.org/worg/org-tutorials/unison-sync.html (I also changed
the index page to point at it).

Alan

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

* Re: [SYNC] How do you sync your org-mode files between n devices (n > 2)
  2013-09-05 10:00           ` Alan Schmitt
  2013-09-05 10:26             ` Karl Voit
  2013-09-05 11:25             ` [SYNC] How do you sync your org-mode files between n devices (n > 2) Suvayu Ali
@ 2013-09-05 13:37             ` Robert Horn
  2 siblings, 0 replies; 21+ messages in thread
From: Robert Horn @ 2013-09-05 13:37 UTC (permalink / raw)
  To: Alan Schmitt; +Cc: emacs-orgmode


Alan Schmitt writes:

> I can't promise anything, but I can try to write something. What
> external merging tool should I use?
>

There was some work done in a Summer of Code last year or the year
before.  I don't know how much more work remains.  It was an effort for
a delta operator for git.

I use a multi-system git environment, and the one area that is beyond
the git capabilities at present is the following kind of problem:

There is a repeating daily task with a log file.  On machine A, the task
is finished on Monday, Wednesday, and Friday.  On machine B, the task is
finished on Tuesday, Thursday, and Saturday.

Git does not understand the task structure, nor does it understand date
oriented logs.  It recognizes that there is a stretch of logfile and
task structure that needs my human intervention and leaves that part for
me to fix.  I have to cut the log entries from machine A version and put them
into the log from machine B version in proper date order.  The last
complete and next lines will come from machine B because they are more
recent.  I understand the date orientation, task structure, etc.  Git
does not.

Proper understanding of things like interleaving date related entries is
a difficult task to get right.  It would be enough to get it 80% right
with 0% improper fixes, and 20% identified for human merging.  But to
reach this level means understanding all the different users of date
tagged lines, entries, headlines, etc. in the org structure.

R Horn

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

* Re: [SYNC] How do you sync your org-mode files between ndevices (n > 2))
  2013-09-05 12:31               ` Alan Schmitt
  2013-09-05 12:54                 ` Suvayu Ali
@ 2013-09-05 16:14                 ` Ramon Diaz-Uriarte
  1 sibling, 0 replies; 21+ messages in thread
From: Ramon Diaz-Uriarte @ 2013-09-05 16:14 UTC (permalink / raw)
  To: Alan Schmitt; +Cc: emacs-orgmode


alan.schmitt@polytechnique.org writes:

> fatkasuvayu+linux@gmail.com writes:
>
>> On Thu, Sep 05, 2013 at 12:00:02PM +0200, Alan Schmitt wrote:
>>> Hi,
>>> 
>>> fatkasuvayu+linux@gmail.com writes:
>>> 
>>> > I think this would be a wonderful addition to Worg.  Probably the FAQ is
>>> > more appropriate (under "Tips and Tricks") since this is one of most
>>> > commonly asked questions on the list.  On the other hand, if you think
>>> > covering this topic requires more than just a few lines, a longer entry
>>> > or short article in the config section would be more appropriate.
>>> 
>>> I can't promise anything, but I can try to write something. What
>>> external merging tool should I use?
>>
>> I think the most appropriate tool would be org-merge-driver.  But I'm
>> not sure how reliable it is.  That said, what might be nicer is if you
>> treat the external tool bits generically.  Then people can choose their
>> own tools in the future; also that will probably be less work for you
>> since you don't have to figure out the details of the external merging
>> tool yourself.
>
> It makes sense.
>
>> What I'm after is having all the Unison config bits on Worg, then people
>> choose how they want to use it:
>> 1. plain sync,
>> 2. sync with merging (with their own choice of tools)
>>
>> I or someone else could then add the Dropbox like, and "version control
>> (Git) way" of syncing.  This would then be a fairly complete FAQ on
>> synchronisation questions.  Does that seem feasible to you?
>
> I've been playing with the merging using ediff, and it works. I'll
> explain it here, and depending on the feedback, I'll put it on worg.
>


I find it very clear and helpful.  Thanks a lot!


R.


> Alan
>
> * Synchronizing org files with Unison
>
> This describes how to synchronize org files using the [[http://www.cis.upenn.edu/~bcpierce/unison/][Unison file synchronizer]],
> as well as how to configure it to use an external tool to merge conflicting
> edits.
>
> ** Prerequisites
>
> You should have Unison up and running. Binaries can be found [[http://www.cis.upenn.edu/~bcpierce/unison/download.html][here]] and the
> documentation is [[http://www.cis.upenn.edu/~bcpierce/unison/download/releases/stable/unison-manual.html][here]].
>
> ** Synchronization
>
> Unison is a file synchronizer, thus it may be used to synchronize org files. To
> configure Unison, on uses a /profile/ which states where the things to
> synchronize are as well as some options. Assuming I want to synchronize the
> files in ~/Users/schmitta/dir1~ and ~/Users/schmitta/dir2~, the profile would
> look like this
>
> #+BEGIN_EXAMPLE
> root = /Users/schmitta/dir1
> root = /Users/schmitta/dir2
> #+END_EXAMPLE
>
> In most cases Unison will be used with a remote machine. The local machine is
> called the /client/ and the remote one the /server/. For such remote
> synchronization, the ~unison~ binary must be installed in the server as
> well. The simplest way to connect to the machine is using ssh. One should check
> that unison can be found there by doing ~ssh user@remote unison -version~. If
> ~unison~ cannot be found in the path, one may set the ~servercmd~ option as
> indicated in the next example.
>
> (Please see the [[http://www.cis.upenn.edu/~bcpierce/unison/download/releases/stable/unison-manual.html#roots][manual section on roots]] for further details.)
>
> #+BEGIN_EXAMPLE
> root = /Users/schmitta/dir1
> root = ssh://user@remote/relative/path/to/dir2
>
> servercmd = /usr/bin/unison
> #+END_EXAMPLE
>
> ** Merging
>
> As Unison works on the level of files, it will trigger a /conflict/ if both
> files have changed since the last synchronization. In that case one can only
> choose which file to keep, which is not satisfying. Unison offers the
> possibility to use external tools to merge the files. There is an [[http://www.cis.upenn.edu/~bcpierce/unison/download/releases/stable/unison-manual.html#merge][extensive
> manual section]] regarding this, we'll just describe how to use emacs and ediff to
> do it.
>
> For better merging, we will ask unison to keep the last synchronized version of
> every org file on the client; this way we can use ediff with ancestor. These
> ~currentbackup~ files may live alongside the synchronized files (with names of
> the form ~.bak.version.name~, which is configurable) or in a central location.
>
> Here is the modified configuration file.
>
> #+BEGIN_EXAMPLE
> root = /Users/schmitta/dir1
> root = ssh://user@remote/relative/path/to/dir2
>
> servercmd = /usr/bin/unison
>
> backupcurrent = Name *.org
> backuplocation = local
> maxbackups = 0
>
> merge = Name *.org -> emacsclient -c --eval '(ediff-merge-files-with-ancestor "CURRENT1" "CURRENT2" "CURRENTARCH" nil "NEW")'
>
> #+END_EXAMPLE
>
> The ~backupcurrent~ option tells unison to keep a backup of the last
> synchronized version of ever file with an ~org~ extension. The location of the
> backup should be local (alongside the file). Finally, no other backup should be
> created.
>
> Next follows the merge command. For every org file in conflict, use the command
> that launches a new emacs frame calling the ediff with ancestor function. The
> ~CURRENT1~, ~CURRENT2~, and ~CURRENTARCH~ strings are  replaced with the file
> from the first root, the file from the second root, and the last synchronized
> version. The ~NEW~ file is where Unison expects the file to be saved (which will
> be done by the ediff session).
>
> Thus, when an org file has been modified on both hosts, an ediff session will be
> launched in a new frame. Closing the frame will make Unison commit the merge (it
> waits until the command has finished).
>
> If one does not want to use backups, it's possible to use the simpler ediff
> (without ancestor) command as follows.
>
> #+BEGIN_EXAMPLE
> root = /Users/schmitta/dir1
> root = ssh://user@remote/relative/path/to/dir2
>
> servercmd = /usr/bin/unison
>
> merge = Name *.org -> emacsclient -c --eval '(ediff-merge-files "CURRENT1" "CURRENT2" nil "NEW")'
>
> #+END_EXAMPLE


-- 
Ramon Diaz-Uriarte
Department of Biochemistry, Lab B-25
Facultad de Medicina 
Universidad Autónoma de Madrid 
Arzobispo Morcillo, 4
28029 Madrid
Spain

Phone: +34-91-497-2412

Email: rdiaz02@gmail.com
       ramon.diaz@iib.uam.es

http://ligarto.org/rdiaz

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

* Re: [SYNC] How do you sync your org-mode files between n devices (n > 2)
  2013-09-03 21:34 [SYNC] How do you sync your org-mode files between n devices (n > 2) noreply
                   ` (3 preceding siblings ...)
  2013-09-04  6:50 ` Samuel Loury
@ 2013-09-05 20:00 ` Marc Ihm
  4 siblings, 0 replies; 21+ messages in thread
From: Marc Ihm @ 2013-09-05 20:00 UTC (permalink / raw)
  To: emacs-orgmode

Hi,

My aproach is low-tech.

I manage two special files:
- token.txt, which (through shell-scripts) moves around with me and helps to check,
   that I do not have multiple emacs open on different machines.
- open.txt, which is created by a small piece of elisp and helps to check,
   that I do not have multiple emacs open on the same machine.
With both files I can be sure, that there is only one single instance of emacs open
on all my devices (other instances of emacs at least display a warning message).

Having this, synchronisation with rsync is quite easy.

With this approach I do not have merge conflicts (unless I mess up things occasionally :-).
I use several instances of windows and linux, that are connected by network or usb-stick.

best regards,
Marc

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

end of thread, other threads:[~2013-09-05 20:00 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-03 21:34 [SYNC] How do you sync your org-mode files between n devices (n > 2) noreply
2013-09-04  6:04 ` Suvayu Ali
2013-09-04  6:30   ` Xiao-Yong Jin
2013-09-04  7:43     ` Suvayu Ali
2013-09-04  8:00       ` Torsten Wagner
2013-09-05  8:50       ` Alan Schmitt
2013-09-05  9:42         ` Suvayu Ali
2013-09-05 10:00           ` Alan Schmitt
2013-09-05 10:26             ` Karl Voit
2013-09-05 11:42               ` Jonas Hörsch
2013-09-05 13:03                 ` [SYNC] How do you sync your org-mode files between ndevices (n > 2)) Alan Schmitt
2013-09-05 11:25             ` [SYNC] How do you sync your org-mode files between n devices (n > 2) Suvayu Ali
2013-09-05 12:31               ` Alan Schmitt
2013-09-05 12:54                 ` Suvayu Ali
2013-09-05 13:24                   ` Alan Schmitt
2013-09-05 16:14                 ` [SYNC] How do you sync your org-mode files between ndevices (n > 2)) Ramon Diaz-Uriarte
2013-09-05 13:37             ` [SYNC] How do you sync your org-mode files between n devices (n > 2) Robert Horn
2013-09-04  6:21 ` Jambunathan K
2013-09-04  6:47 ` Paul Rudin
2013-09-04  6:50 ` Samuel Loury
2013-09-05 20:00 ` Marc Ihm

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.