Actually insert the (not yet parsed) dives into dive list and trips

Linus Torvalds torvalds at linux-foundation.org
Sat Mar 8 08:55:22 PST 2014


This patch is just a few trivial lines of code, and a lot of
explanation for one hacky line.

But with it, you can now see the dives being loaded from the git repo
into subsurface. Of course, since the actual dive data files aren't
being parsed, there's not a whole lot of information there, but it's
still fairly satisfying to see, even if all you can see is the date of
the trips and the date/time of the dives.

If you save the result to git, you'll get a whole lot of empty files
(well, the dive files will have "duration 0:00min" in them), but hey,
with since it's git, all the information is still there in the
history, and you can recover it.

Do *not* save over an old xml file, though. You'll just get output like

  ...
  <trip date='2014-01-11' time='00:00:00'>
  <dive date='2014-01-11' time='08:47:37' duration='0:00 min'>
    <divecomputer>
    </divecomputer>
  </dive>
  <dive date='2014-01-11' time='11:03:53' duration='0:00 min'>
    <divecomputer>
    </divecomputer>
  </dive>
  ...

since that's all we currently parse from the git tree. The goal is
that by Sunday, I can do

 - load xml file
 - save to git tree
 - load from git tree
 - export to another xml file
 - compare the original xml with the final export

and find no differences. But we're a *long* way away from that "no
differences" state.

                Linus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-git-dive-loading-actually-insert-the-dives-into-the-.patch
Type: text/x-patch
Size: 4119 bytes
Desc: not available
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20140308/68c2e116/attachment.bin>


More information about the subsurface mailing list