Now I can finally push all these changes, as the CI should also run and
we're ready to try out the new version of the app which uses libgit2
instead of jgit. Hopefully no user will notice anything different.
It just seems to make a lot of changes. No idea about half of these. The
ios world is strange and foreign. I have hooked it up to Firebase
Analytics, though.
Also build on all architectures instead of just 64-bit.
Before it was broken, and we weren't really doing anything. Now, we
commit both versions of the file, so it results in the journal having an
ugly <<<< HEAD === thingy. But this is a start!
We can improve this by choosing which one of the changes to keep.
libssh is LGPL licensed, which means I would need to re-license the
entire app since we are linking against it statically. I could
dynamically link against it, but since I was only trying to use it for
key-generation and that doesn' seem to be working, I may as well discard
it.
For now, I'm going to stick with jsch for the key generation. On ios
side, I'm not sure what I will do. One option could be to compile
openssh and call the ssh-keygen binary.
This way we can easily test it outside of Android. Strangely enough this
doesn't work on Android or osx for me. It only seems to work in an
ubuntu linux container.
It's not perfect as our implementation of git pull results in an extra
merge commit and doesn't handle conflicts properly, but it is a basic
implementation, so at least we have something.
The annotated commit must be created from the remote's branch's ref.
This entire thing is quite confusing, but for now at least git pull's
work properly, though with an extra merge commit.
In order to do a commit, we need the parents for that commit. In the
case of a merge commit - it should be the 'master' and 'origin/master'
(in the case of the master branch). I cannot seem to get the id of the
'origin/master' commit. So, for now it is hardcoded.
But hey, at least this works.
This was what I was using to try out this library locally. I probably
should have made a proper unit test suite, but this was just so much
faster and easier.
LibGit2 has been designed in a strange way. It doesn't give us an easy
way of knowing if and why the credentials has failed, it jusst keep
calling the credentials failed method.
We are now working around this.
Libgit2 is quite horrible. When passing it credentials, if the
credentials are invalid, it will just ask for the credentials again and
again and again, without giving any feedback that the credentials have
failed. This just sucks.
This will allow us to remove the jgit dependency. JGit is annoying
because we have to use an old version in order to support older API
versions. Additionally, there are some subtle differences in their
implementation.
Finally, for iOS and desktop we will be using libgit2, so we may as well
use the same stack on Android.