git backend: actually update local cache from remote

Dirk Hohndel dirk at hohndel.org
Thu Jun 11 11:22:41 PDT 2015


On Thu, Jun 11, 2015 at 06:32:48PM +0200, Davide DB wrote:
> On Thu, Jun 11, 2015 at 6:03 PM, Dirk Hohndel <dirk at hohndel.org> wrote:
> >
> > So any "sync" is a two step process. FIRST we save to the local cache.
> > THEN we sync.
> 
> Ah!
> So if I manually use "Ctrl+S" or "File > Save" I fire this two step process.
> If I never save explicitly my logbook, is this two step process fired
> automatically every X seconds?

NO!
It only happens if you save. Either explicitly (or implicitly when you
quit - actually that's explicit as well as we ask you about this).

There will be no "constant updating to the cloud".

> > The situation that I want to avoid is this one:
> >
> > You load the local cache.
> > You start making modification.
> > The local cache updates from the remote.
> > Now you have two sets of changes, the ones made in Subsurface and the ones
> > that got synced from the remote to the local cache. Sure, we could try to
> > merge this. I'd rather not have to go there.
> 
> How could local be synced form remote while working if we pull/sync at
> application start?

There were suggestions that we should sync in the background and then tell
the user when the sync was done in case there were changes (I think Robert
suggested that). I wanted to make sure we don't allow that scenario.

> Do we foresee two workstations working on the same logbook?
> Sorry for my silly question.

Not silly at all.
In the long run I want some simple merging because I can see something
like this:

My machine at home has Subsurface on it.
I sync my laptop and Android tablet before a trip.
Bad internet / no internet.
On the trip I edit some thing on the laptop but also use the tablet to
download new dives.
Now I connect both the laptop and the tablet again.

-> possibly easy to merge, possibly conflicts.

> >> Then we could have a small round dot like a led (green/red) on the
> >> window right upper side to signal if the local repo is in sync with
> >> remote repository.
> >
> > That I'm not so sure about. I'd rather have a symbol that reflects whether
> > we have determined that we are connected or not...
> 
> Maybe you are not more connected but all your edits were successfully
> synced when network was available. Or the contrary.

As I said, we don't sync in the background.
So at "save time" you either synced or you didn't.

But you are right, we need to think through the different scenarios.

> Hence how do you indicate that all your edits are successfully saved
> on local repository but it was not possible to load them on the remote
> repository?
> From my proposal above, you would have:
> 
> johndoe-logbook.xml (saved)
> Sync Led red (not sync)
> 
> I'm afraid I'm writing silly questions :)

NO, I think this is mostly based on a misunderstanding when / how we'd
sync. Does it make sense with this explanation?

/D


More information about the subsurface mailing list