is gnucash files patch/diff friendly?

Derek Atkins warlord at MIT.EDU
Mon Jun 15 11:09:00 EDT 2009


Hi,

Zhang Weiwu <zhangweiwu at realss.com> writes:

> Hello. We are using gnucash files without compression. I am wondering if
> gnucash files are patch/diff friendly, because we often share other
> files (for other projects) using unison, a file synchronization tool,
> that merges changes from two modified version using traditional
> diff/patch unix commands.
>
> Say, if person A recorded a transaction, person B recorded a different
> transaction, both kept the last unmodified version, can they merge their
> changes with traditional unix diff/patch?
>
> Some text formats are patch/diff friendly and some are not. I can
> imagine, e.g. if gnucash keeps account sum in file, then it is not
> patch/diff-friendly, because two transactions both changed sum,
> resulting a conflict.
>
> I mostly believe gnucash must not be patch/diff friendly because it may
> result inefficient loading & saving, unless an index is maintained
> outside of the main transaction record and gets updated when finding
> index & transaction modification date different. But I ask anyway, just
> in case.

Generally, no, it's not patch/diff friendly.

There have been some patches sent to try to make the data file more
idempotent but AFAIK those patches have not been applied.  Even once
they ARE applied we DO NOT RECOMMEND merging files together!  If changes
have been made on both sides the merge MAY DESTROY YOUR DATA.

> Thanks.

> Please remember to CC this list on all your replies.
> You can do this by using Reply-To-List or Reply-All.

-derek

-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord at MIT.EDU                        PGP key available


More information about the gnucash-user mailing list