44 Commits

Author SHA1 Message Date
789a0b1208 Settings Screens: Null safety++ 2021-05-27 13:19:20 +02:00
3b5ff6c9df Core: Finish null safety migration 2021-05-25 09:54:19 +02:00
01dd8c6c7a Use dart-git for most operations in Desktop
libgit2 hasn't been hooked up so far. This way, almost everything but
cloning working.

Related to #137
2021-05-17 21:48:14 +02:00
48f431d2d2 Optional: Make Git Add/Rm/Commit use Dart-git
It's a quick toggle for easy testing.
2021-05-09 11:11:24 +02:00
d008f0d982 First version of dart migrate
Most of the files haven't been migrated. Lets work on this bit by bit
2021-04-10 22:18:35 +02:00
45344d1b75 Put current branch name in exception
Hopefully it will provide more context to debug #361 issue.
2021-03-06 15:31:24 +01:00
4c7efdb2dc Move cloning logic to its own file
This has gotten very complex and needs to be properly tested. It's the
number 1 bug.
2021-01-19 15:40:08 +01:00
9946993364 shouldLogException: Handle all exception types
Fixes APP-SB
2021-01-18 23:47:03 +01:00
c64d30ec2a Stop guessing the default branch
Talk to the remote via ssh and ask it which is the default branch. This
has only been implemented for Android right now, so this breaks the ios
build.

Fixes #363
2020-12-16 12:17:22 +01:00
704329e3d5 Fix setting up an empty repo
Fixes APP-EQ
2020-10-21 15:32:33 +02:00
98c92a3fe1 Handle new version of git_bindings
This changes the way the SSH keys are managed, they are no longer
managed by the git_bindings plugin and are instead just passed as
parameters. They are now saved in shared_prefs. This allows us to easily
have multiple ssh keys.

It also allows us to store the ssh keys in a more secure storage
location in the future.
2020-10-19 14:52:24 +02:00
540078c413 Improve repo migrations
Earlier we had one folder 'journal_local', when the remote would be
setup a new folder called 'journal' would be created, and each all the
files would be copied over. This meant the local history was being
destroyed.

Now, we only have 1 folder 'journal', and on 'cloning', we add the url
as a remote, and do a git fetch + merge.

This simplifies everything drastically, and opens the door for multiple
remotes.
2020-10-15 12:18:47 +02:00
58de0498ac Replace git pull with git fetch + merge
This way we can swap the merge out easily for our own custom merge code.
Also, this makes it easier to do a merge as a way of migrating.

This commit probably breaks stuff on ios
2020-09-26 20:27:07 +02:00
eb4d99338b Remove some uses of the Settings singleton
It needs to be removed from everywhere.
2020-09-25 00:40:23 +02:00
9d00fdac06 Use import_sorter
flutter pub run import_sorter:main --no-comments

The code feels much cleaner
2020-07-24 12:43:28 +02:00
b3014d4186 Log GitPush/Pull fails as errors
Instead of debug
2020-06-10 13:28:35 +02:00
51ececd150 Immediately save the note when changing
Earlier we would wait till we got the 'mutex' to make a change, however
with the way libgit2 works, during a git push/pull other git operations
such as add/rm/commit block.

So performing a save, while the push/pull is occuring - might have
resulted in a note being lost

Related to #124
2020-06-10 13:03:28 +02:00
267ecb7499 Implement a very basic file system view
This will show all the files and not just the "notes". This way the user
can easily figure out why a file isn't included in the list of notes.

It's currently disabled by default as it clearly needs a lot more work.
2020-06-10 00:54:15 +02:00
66eeaa552b Bump git_bindings and pass fresh version of gitAuthor/Email
This way the Settings change for git author is immediately reflected.

Fixes #130
2020-05-13 11:36:08 +02:00
64bfefa266 Do not allow DartGit's exception to escape
DartGit is still quite experimental.
2020-05-01 11:22:02 +02:00
8636021952 SyncButton: Show number of unpushed changes
Related to #123
2020-05-01 11:09:40 +02:00
a0247e7c9e Ignore a few more git exceptions 2020-04-23 10:08:22 +02:00
0162d1e11a Only do a git push if one has commits to push
This is the first use of my pure Dart implementation of Git. Hurray!
Now hopefully, I can slowly get rid of git_bindings entirely.
2020-04-14 18:15:32 +02:00
bb0e574495 Abstract out the logging
This way moving away from Fimber will be much easier.
2020-04-04 11:50:57 +02:00
fe08b53539 Add a .gitjournal.yaml file in a folder
This file will be added to save the settings of how we want that folder
to behave. For example - default Editor, view, sorting mode, etc.

This feature is currently disabled as it will only be a part of the pro
mode.
2020-03-31 14:02:38 +02:00
577b73ff3c SyncButton: Seperate pulling and pushing
This way we also refresh the view after the pulling, as we don't need to
wait for a push for that.
2020-03-30 13:00:28 +02:00
ea8703518b Ignore more git ssh errors 2020-03-21 01:32:09 +01:00
a99eca9131 Simplify code by using pathSpec 2020-03-21 00:52:54 +01:00
b252f037b3 Rename NotesFolder -> NotesFolderFS
And NotesFolderReadOnly to NotesFolder. It just makes more sense this
way as we're now getting more and more different "types" of
NotesFolders.
2020-03-15 02:01:07 +01:00
43281bd2bb Add support for moving a Note to another folder
The Folder selection dialog needs a lot of work, but it's a start.
2020-01-29 16:51:57 +01:00
f8e7773f16 NoteBrowser: Add a button to rename notes
Fixes #23
2020-01-27 23:09:11 +01:00
93775ddca5 Ignore more git connection errors 2020-01-27 19:07:05 +01:00
06d1124c19 Sync: Retry if the remote has changed
This can happen if someone pushed between our pull and push. In this
case lets just try again.
2020-01-27 19:03:30 +01:00
6e2a905f05 Cleanup ignored exceptions 2020-01-27 18:47:17 +01:00
72777b96a4 Allow git pulls to fail
They fail when there is nothing to pull because no commit exists on the
server.
2020-01-02 01:04:21 +01:00
8a6b6023d6 Sync: Combine crashlytics code 2019-12-27 00:37:20 +01:00
6af3b03210 Add a sync button to the AppBar
This somewhat shows what's going on with the network. It isn't ideal, as
is a bit ugly. But it's a start to show the network status, and what's
going on in the background.
2019-12-26 20:43:12 +01:00
04af625a3b Log git exceptions in Crashlytics 2019-12-26 17:41:27 +01:00
757bf0b7ac Update dependencies and gradle 2019-12-23 12:25:31 +01:00
63170445d7 Move libgit2 code to git_bindings repo
We now have a much clearer separation between Git code and this app
specific code. This is awesome, it will allow other people to easily
integrate Git within their apps. Also, eventually it will be trivial to
switch to another implemention of Git (via JGit or a git client written
completely in Dart)

This breaks the iOS version as I haven't moved the code to build the ios
version. Maybe this will be a good excuse for me to setup a proper CI/CD
system for ios builds.

There is also a chance this breaks Crashalytics NDK symbols :(
2019-12-21 01:06:15 +01:00
70877438eb Git: Take the folderPath instead of folderName
The Git Api was strange and took a foldeName and it would only allow you
to access git operations in a particular path. This has now been fixed,
and now it can operate in any path.

This was the first step to moving the git api into its own library.
2019-12-20 20:40:00 +01:00
106953ad68 GitRepo: Change commit messages to say "Note" instead of "Journal" 2019-12-14 02:19:02 +01:00
abb6029798 Allow Folders to be deleted
For safety we're only allowing non-empty folders to be deleted. Ideally,
we should have some kind of undo button. Or some kind of history - since
we do have that with git.

Related to #18
2019-12-11 21:43:08 +01:00
b0b7da5291 Move storage classes into core
The Git functionality is fairly core!
2019-12-09 01:19:44 +01:00