another pull request

Linus Torvalds torvalds at linux-foundation.org
Fri Aug 17 20:45:15 PDT 2012


On Fri, Aug 17, 2012 at 7:59 PM, Dirk Hohndel <dirk at hohndel.org> wrote:
>
> Two tiny changes
> - check we don't override existing equipment data when editing multiple dives

This doesn't actually parallel the logic for the strings (like your
comment says).

The logic for the strings is that yes, we overwrite empty fields if
they have changed. But we *also* overwrite fields that matched the
master dive, and it changed.

Now, I don't think the equipment logic is necessarily wrong, but the
commit comment is definitely wrong in stating "This parallels the
logic used for all the string entries".

The logic for "we also change non-empty fields that used to match the
old master dive state" ("remember" in equipment-speak) is two-fold:

 - it makes the "same change" as it does for the master dive.

 - it allows you to correct things you did

For an example of the second case, say that you filled in the suit
with "Drysuit" for the last dive trip, but then you realized that was
a thinko, and it really should have been "3mm wetsuit". You keep the
same selection, and just edit "Drysuit" to "3mm wetsuit", and they all
change, even though they were no longer empty - because all the dives
matched the master dive in that field.

                Linus


More information about the subsurface mailing list