<feed xmlns='http://www.w3.org/2005/Atom'>
<title>subsurface.git/subsurface-core, branch v4.6.4</title>
<subtitle>forked from https://github.com/subsurface/subsurface</subtitle>
<id>https://git.tsegers.com/subsurface.git/atom?h=v4.6.4</id>
<link rel='self' href='https://git.tsegers.com/subsurface.git/atom?h=v4.6.4'/>
<link rel='alternate' type='text/html' href='https://git.tsegers.com/subsurface.git/'/>
<updated>2016-04-05T05:33:58Z</updated>
<entry>
<title>Move subsurface-core to core and qt-mobile to mobile-widgets</title>
<updated>2016-04-05T05:33:58Z</updated>
<author>
<name>Dirk Hohndel</name>
<email>dirk@hohndel.org</email>
</author>
<published>2016-04-05T05:02:03Z</published>
<link rel='alternate' type='text/html' href='https://git.tsegers.com/subsurface.git/commit/?id=7be962bfc2879a72c32ff67518731347dcdff6de'/>
<id>urn:sha1:7be962bfc2879a72c32ff67518731347dcdff6de</id>
<content type='text'>
Having subsurface-core as a directory name really messes with
autocomplete and is obviously redundant. Simmilarly, qt-mobile caused an
autocomplete conflict and also was inconsistent with the desktop-widget
name for the directory containing the "other" UI.

And while cleaning up the resulting change in the path name for include
files, I decided to clean up those even more to make them consistent
overall.

This could have been handled in more commits, but since this requires a
make clean before the build, it seemed more sensible to do it all in one.

Signed-off-by: Dirk Hohndel &lt;dirk@hohndel.org&gt;
</content>
</entry>
<entry>
<title>Don't write back dive data that hasn't changed in git</title>
<updated>2016-04-05T00:27:10Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2016-04-03T22:31:59Z</published>
<link rel='alternate' type='text/html' href='https://git.tsegers.com/subsurface.git/commit/?id=2d760a7bff71c46c5aeba37c40d236ea16eefea2'/>
<id>urn:sha1:2d760a7bff71c46c5aeba37c40d236ea16eefea2</id>
<content type='text'>
This caches the git ID for the dive on load, and avoids building the
dive directory and hashing it on save as long as nothing has invalidated
the git ID cache.

That should make it much faster to write back data to the git
repository, since the dive tree structure and the divecomputer blobs in
particular are the bulk of it (due to all the sample data).  It's not
actually the git operations that are all that expensive, it's literally
generating the big blob with all the snprintf() calls for the data.

The git save used to be a fairly expensive with large data sets,
especially noticeable on mobile with much weaker CPU's.  This should
speed things up by at least a factor of two.

Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Dirk Hohndel &lt;dirk@hohndel.org&gt;
</content>
</entry>
<entry>
<title>Use the same format for output to stderr and AppLog</title>
<updated>2016-04-04T21:19:13Z</updated>
<author>
<name>Dirk Hohndel</name>
<email>dirk@hohndel.org</email>
</author>
<published>2016-04-04T17:57:44Z</published>
<link rel='alternate' type='text/html' href='https://git.tsegers.com/subsurface.git/commit/?id=9283332b95d3e41f43f3300667ac7523f58ab14b'/>
<id>urn:sha1:9283332b95d3e41f43f3300667ac7523f58ab14b</id>
<content type='text'>
Signed-off-by: Dirk Hohndel &lt;dirk@hohndel.org&gt;
</content>
</entry>
<entry>
<title>QML UI: keep cloud sync enabled state in settings</title>
<updated>2016-04-04T21:18:51Z</updated>
<author>
<name>Dirk Hohndel</name>
<email>dirk@hohndel.org</email>
</author>
<published>2016-04-04T01:48:20Z</published>
<link rel='alternate' type='text/html' href='https://git.tsegers.com/subsurface.git/commit/?id=f7564c2b776f93cb1c2af2da26a44ef2eaaec837'/>
<id>urn:sha1:f7564c2b776f93cb1c2af2da26a44ef2eaaec837</id>
<content type='text'>
So if the app gets closed and restarted, it will continue to not sync (or
sync) over the network.

Signed-off-by: Dirk Hohndel &lt;dirk@hohndel.org&gt;
</content>
</entry>
<entry>
<title>Instrument the git storage code</title>
<updated>2016-04-04T21:18:11Z</updated>
<author>
<name>Dirk Hohndel</name>
<email>dirk@hohndel.org</email>
</author>
<published>2016-04-04T00:26:05Z</published>
<link rel='alternate' type='text/html' href='https://git.tsegers.com/subsurface.git/commit/?id=5821c56da24d0aa02e5bb6d54f14e7651d23269b'/>
<id>urn:sha1:5821c56da24d0aa02e5bb6d54f14e7651d23269b</id>
<content type='text'>
This allows fairly fine grained analysis on what part of loading from
and saving to git we are spending our time. Compute performance and
network speed play a significant role in how all this plays out.

The routine to check if we can reach the cloud server is modified to
send updates every second so we don't hang without any feedback for five
seconds when there is network but we can't reach the cloud server (not
an unlikely scenario in many dive locations with poor network quality)

Signed-off-by: Dirk Hohndel &lt;dirk@hohndel.org&gt;
</content>
</entry>
<entry>
<title>Change the git progress update callback signature</title>
<updated>2016-04-04T21:17:45Z</updated>
<author>
<name>Dirk Hohndel</name>
<email>dirk@hohndel.org</email>
</author>
<published>2016-04-03T23:13:22Z</published>
<link rel='alternate' type='text/html' href='https://git.tsegers.com/subsurface.git/commit/?id=eea1ff6a83a318d7749110baa81c249a6faea8ef'/>
<id>urn:sha1:eea1ff6a83a318d7749110baa81c249a6faea8ef</id>
<content type='text'>
This way we can include additional text. This will be used in later
patches.

Signed-off-by: Dirk Hohndel &lt;dirk@hohndel.org&gt;
</content>
</entry>
<entry>
<title>Git storage: after successful merge push merged commit to upstream</title>
<updated>2016-04-04T21:17:30Z</updated>
<author>
<name>Dirk Hohndel</name>
<email>dirk@hohndel.org</email>
</author>
<published>2016-04-03T23:48:19Z</published>
<link rel='alternate' type='text/html' href='https://git.tsegers.com/subsurface.git/commit/?id=8b710f4d6cde00bf598031fafa9e3f1d8c2708a5'/>
<id>urn:sha1:8b710f4d6cde00bf598031fafa9e3f1d8c2708a5</id>
<content type='text'>
Otherwise a merge will only make it to cloud storage the second time we
connect.

Signed-off-by: Dirk Hohndel &lt;dirk@hohndel.org&gt;
</content>
</entry>
<entry>
<title>Fix cylinder end pressure fixup from samples</title>
<updated>2016-04-02T01:18:53Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2016-04-01T20:23:55Z</published>
<link rel='alternate' type='text/html' href='https://git.tsegers.com/subsurface.git/commit/?id=a554c66fa39912ac82253741880a83a22bf574b4'/>
<id>urn:sha1:a554c66fa39912ac82253741880a83a22bf574b4</id>
<content type='text'>
This bug admittedly hits almost nobody, but if you had multiple cylinder
pressure sensors on the same cylinder (attached to multiple dive
computers, of course), we would take the beginning pressure from the
first dive computer, and the ending pressure from the last dive
computer.

That came about because we'd just walk all the dive computer samples in
order, and the first time we see a relevant sample and we don't have a
beginning pressure, we'd take that pressure.  So the beginning pressure
was from the first dive computer, and once we'd seen a valid beginning
pressure, that would never change.

But as we're walking along, we'd continue to update the ending pressure
from the last relevant sample we see, which means that as we go on to
look at the other dive computers, we'd continue to update the ending
pressure with data from them.

And mixing beginning/ending pressures from two different sensors just
does not make sense.

This changes the logic to be the same for beginning and ending
pressures: we only update it once, with the first relevant sample we
see.  But we walk the samples twice: forwards from the beginning to
find the first beginning pressure, and backwards from the end to find
the ending pressure.

That means that as we move on to the second dive computer, we've now
filled in the ending pressure from the first one, and will no longer
update it any more.

NOTE! We don't stop scanning the samples (or the dive computers) just
because we've found a valid pressure value.  We'll always walk all the
samples because there might be multiple different cylinders that get
pressure data from different samples (and different dive computers).

We could have some early-out logic when we've filled in all relevant
cylinders, but since this just runs once per dive it's not worth it.

Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Dirk Hohndel &lt;dirk@hohndel.org&gt;
</content>
</entry>
<entry>
<title>Split up fixup_dive_dc() into multiple smaller independent functions</title>
<updated>2016-04-02T01:17:40Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2016-04-01T19:32:56Z</published>
<link rel='alternate' type='text/html' href='https://git.tsegers.com/subsurface.git/commit/?id=f92e2e752f6e16af518b3e2e5221bf401221751a'/>
<id>urn:sha1:f92e2e752f6e16af518b3e2e5221bf401221751a</id>
<content type='text'>
fixup_dive_dc() is called for each dive computer when we add a new dive.
It does various housekeeping functions, cleaning up the sample data, and
fixing up dive details as a result of the sample data.

The function has grown to be a monster over time, and particularly the
central "walk every sample" loop has become an unreadable mess.

And the thing is, this isn't even all that performance-critical: it's
only done once per dive and dc, and there is no reason to have a single
illegible and complex loop.

So split up that loop into several smaller pieces that each will loop
individually over the sample data, and do just one thing.  So now we
have separate functions for

 - fixing up the depth samples with interpolation
 - fixing up dive temperature data
 - correcting the cylinder pressure sensor index
 - cleaning up the actual sample pressures

Yes, this way we walk the samples multiple times, but the end result is
that the code is much easier to understand.  There should be no actual
behavioral differences from this cleanup, except for the fact that since
the code is much more understandable, this cleanup also fixed a bug:

In the temperature fixup, we would fix up the overall dive temperatures
based on the dive computer temperatures.  But we would then fix up the
overall dive computer temperature based on the sample temperature
*afterwards*, which wouldn't then be reflected in the overall dive
temperatures.

There was another non-symptomatic bug that became obvious when doing
this cleanup: the code used to calculate a 'depthtime' over the dive
that was never actually used.  That's a historical artifact of old code
that had become dead when the average depth calculations were moved to a
function of their own earlier.

This is preparatory for fixing the overall cylinder pressure stats,
which are currently wrong for dives with multiple dive computers: we
currently take the starting cylinder pressure from the *first* dive
computer that has cylinder pressure information, but we take the ending
cylinder pressure from the *last* dive computer with cylinder pressure
information.

This does not fix that bug, but without this cleanup fixing that would
be a nightmare due to the previous complicated "do everything in one
single loop" model.

Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Dirk Hohndel &lt;dirk@hohndel.org&gt;
</content>
</entry>
<entry>
<title>Be smarter about dive renumbering when merging dives</title>
<updated>2016-03-31T01:16:19Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2016-03-30T19:42:27Z</published>
<link rel='alternate' type='text/html' href='https://git.tsegers.com/subsurface.git/commit/?id=f0be2764da557e7576c4645848984fac5f94b611'/>
<id>urn:sha1:f0be2764da557e7576c4645848984fac5f94b611</id>
<content type='text'>
We really have two different cases for merging dives:

 (a) downloading a new dive from a dive computer, and merging it with an
     existing dive that we had already created using a different dive
     computer.  This is the "try_to_merge()" case, called from
     "process_dives()

 (b) merging two different dives into one longer dive.  This is the
     "merge_two_dives()" case when you explicitly merge dives using the
     divelist.

While a lot of the issues are the same, many details differ, and one of
the details is how dive numbering should be handled.

In particular, when you download from a dive computer and merge with an
existing dive, you want too take the *maximum* dive number, because the
dive computer notion of which dive it is may well not match what the
user dive number is.

On the other hand, when you explicitly merge in the dive list, you end
up renumbering not just the dive you are merging, but also all
subsequent dives, since you now have one fewer dives overall.  So that
case already has to be handled by the caller.

Now, the simpler "download from dive computer" case was broken by commit
ce3a78efcac2 ("Assign lower number to a merged dive instead of higher
one").  It fixed the numbering for the divelist case, but broke the
download case.

So this commit reverts commit ce3a78efcac2, and instead extends and
clarifies the dive renumbering that "merge_two_dives()" already did.  It
now explicitly renumbers not just the following dives, but also
renumbers the merged dive itself, so now we can go back to the old "take
the bigger dive number" for the core merging, which fixes the download
case.

Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Dirk Hohndel &lt;dirk@hohndel.org&gt;
</content>
</entry>
</feed>
