sequential use of Gnucash on multiple computers

Buddha Buck blaisepascal at gmail.com
Tue May 21 08:27:24 EDT 2013


>From my experience with version control systems, not likely.  However, I
have seen other problems with merging XML files, namely overly aggressive
determination of "common" lines in the merge, leading to poorly-formed XML
results.

For example:

File1.xml
-------------

<transaction id="a">
  <split>...</split>
  <split>...</split>
</transaction>
<transaction id="new1">
  <split id="new1-1">...</split>
  <split id="new1-2">...</split>
</transaction>
<transaction id="b">
  <split>...</split>
  <split>...</split>
</transaction>

File2.xml
-------------------

<transaction id="a">
  <split>...</split>
  <split>...</split>
</transaction>
<transaction id="new2">
  <split id="new2-1">...</split>
  <split id="new2-2">...</split>
</transaction>
<transaction id="b">
  <split>...</split>
  <split>...</split>
</transaction>

MergedFile.xml
----------------------------

<transaction id="a">
  <split>...</split>
  <split>...</split>
</transaction>
<transaction id="new1">
  <split id="new1-1">...</split>
  <split id="new1-2">...</split>
<transaction id="new2">
  <split id="new2-1">...</split>
  <split id="new2-2">...</split>
</transaction>
<transaction id="b">
  <split>...</split>
  <split>...</split>
</transaction>

The problem being that the merge program saw the </transaction> line in
both new files as a common edit, so included it only once in the output,
while merging in only one copy each of the rest of the new transactions.

In any event, the best policy when working with GnuCash files is to avoid
having diverging checkouts and thus merge issues.  Always fetch the latest
copy from subversion before starting GnuCash, and always commit your
changes before moving to a different machine.



On Tue, May 21, 2013 at 7:30 AM, Peter von Kaehne <refdoc at gmx.net> wrote:

>    Thanks Geert,
>
>    On the risk of appearing a bit thick..,
>
>    Is there a risk of the following happening?
>
>    File 1
>
>    Transaction A
>      ..
>    Transaction New1
>      Split New1a
>      Split New1b
>
>    Transaction B
>      ..
>    ----------------------------
>
>    File 2
>
>    Transaction A
>      ..
>    Transaction New2
>      Split New2a
>      Split New2b
>    Transaction B
>      ..
>    ---------------------------------
>
>    Merged File
>
>
>    Transaction A
>      ..
>    Transaction New1
>      Split New2a
>      Split New1a
>    Transaction New2
>      Split New1b
>      Split New2b
>    Transaction B
>      ..
>
>    --------------------------
>
>    This would obviously be a corrupting disaster.
>
>    A simple merge conflict would be annoying. But corruption would be a
>    much bigger problem
>
>    Peter
>
>    Gesendet: Dienstag, 21. Mai 2013 um 12:29 Uhr
>    Von: "Geert Janssens" <janssens-geert at telenet.be>
>    An: "Peter von Kaehne" <refdoc at gmx.net>
>    Betreff: Re: Aw: Re: Re: sequential use of Gnucash on multiple
>    computers
>
>    On Tuesday 21 May 2013 12:01:52 Peter von Kaehne wrote:
>
>    Thanks Geert,
>
>
>    Can you expand on that? Why would there be conflict? This obviously
>    would be a reason that these are not good tools for the job!
>
>
>    Gesendet: Dienstag, 21. Mai 2013 um 11:52 Uhr
>    Von: "Geert Janssens" <janssens-geert at telenet.be>
>    But I'd expect concurrent changes on different PC's to conflict more
>    often
>    than not from a pure text point of view, even though you may have
>    entered two
>    totally unrelated transactions in the two PCs.
>
>    Sure. New transactions entered are added sequentially to the data file
>    (based on date entered). So if you add one transaction in version A of
>    your file and another transaction in version B of your file. The
>    resulting files will both have different text added at the same
>    location in the file. Svn only sees text, it doesn't understand
>    transaction and split semantics, so it will raise a merge conflict.
>
>
>    Add to this that guids are random and it is very hard to enter the same
>    transaction on two pc's a the same split second. This means that even
>    if you enter the exact same transaction on the two different PC's, svn
>    will still see conflicting text in the same locations in the file: two
>    different guids and two different entry dates.
>
>
>    You can easily try this yourself: create a minimal gnucash file. Then
>    make a copy of it. Now open each file and add one transaction. Finally
>    run a diff on the files. The diff will not show two independent blocks
>    added in each file, but instead it will show overlapping changes.
>
>
>    You could of course manually resolve each such conflict, but that is
>    tedious and error prone. In my opinion you don't gain from such a set
>    up.
>
>
>    Geert
> _______________________________________________
> gnucash-user mailing list
> gnucash-user at gnucash.org
> https://lists.gnucash.org/mailman/listinfo/gnucash-user
> -----
> Please remember to CC this list on all your replies.
> You can do this by using Reply-To-List or Reply-All.
>


More information about the gnucash-user mailing list