23 Commits

Author SHA1 Message Date
b4285b0512 Use go-git instead of libgit2 for git remote operations
We still need the git_bindings package as we're using it for generating
RSA keys.
2023-12-13 14:14:57 +01:00
88d5cf8713 Upgrade deps + flutter
* Also remove dart_code_metrics
2023-11-25 00:51:25 +01:00
657721adc6 Update dart-git and stop using the Result class
Instead we're going to move back to standard exceptions.

Using a custom Result class has created far far more problems
- The Stacktraces aren't always right
- Sometimes one forgets to check the Result error
- All other exception throwing code needing to be converted to Results
- Non idiomatic Dart code

I think it's better to just go back to exceptions. They have their
problems, but overall, I think it's a better approach.
2023-11-24 14:03:30 +01:00
f4a1df6604 Move cloning code back into GitJournal
I want the git_setup code to only have the UI. Nothing else. The cloning
process for GitJournal is very specific to GitJournal. It doesn't need
to be that complicated for other projects.
2022-06-27 13:21:10 +02:00
00e6f39e67 Move setup code into its own package 2022-06-26 15:08:55 +02:00
6aa62090a9 Use a standard git clone when there is no history
Clearly dart-git is still quite buggy. Lets go back to libgit2, this was
quite a big mistake.
2022-05-16 12:08:15 +02:00
90285eb039 Cloning libgit2: Better null check
This part doesn't have any automated tests, which is really bad. I need
to move to Dart FFI for libgit2 so I can write some proper tests.
2022-03-18 17:55:25 +01:00
65e5e93448 Select 'main' as the default branch if all other mechansims fail 2022-03-06 23:40:25 +01:00
944e187535 Clone: Add more debug statements
Sigh. This is still failing for some users.
2022-03-02 19:30:14 +01:00
849b2874c8 Clone: Use dart-git's merge function
The code has been thoroughly tested with lots of unit tests, at this
point I'm more confident about it than libgit2 (for this particular
usecase)
2022-02-23 17:27:29 +01:00
996cf78ce5 Fix stupid bug
Now most of this code is completely unit tested. It resulted in the
discovery of a race-condition.

Fixes #598
2022-02-23 17:23:44 +01:00
3b2dcd7181 Bump dart-git
Now the repo needs to be explicitly closed. This way, we avoid opening
and closing the packfiles again and again. It results in the "Reading
Git History .." page taking about 40% less time.
2022-01-25 11:41:55 +01:00
e2b6d94eda analyzer: Fix unnecessry includes 2022-01-13 19:03:16 +01:00
f9271edad3 Upgrade to latest dart-git
Most of dart-git's operations are synchronous by default now. The async
functions run on another isolate.
2022-01-13 18:14:01 +01:00
8962f3f745 Set default branch to be main 2021-12-29 15:31:25 +01:00
28f34ca5e6 Avoid catching only Exceptions
We also occasionally get Errors in runtime. It seems like a terrible
decission for Error and Exception to not have a common subtype.
2021-10-20 09:59:14 +02:00
33a731a3d7 Add reuse licensing to files in lib 2021-09-15 13:06:43 +02:00
3a71cca202 Move logging code to its own folder 2021-07-30 14:39:13 +02:00
471669e20b Add another dashbook experiment
This is being use to test out the cloning screen. It runs on Flutter
Web!
2021-07-30 12:57:35 +02:00
af83a70bf4 Setup: Top left arrow button should go back
It's extremely irritating that it closes setup.
2021-07-25 09:52:14 +02:00
dff717eb9a setup clone: put back old code for guessing the remote head
I don't think this is required, but I need to make another point
release, and I rather not have any modifications than what was
previously there.
2021-07-24 12:17:27 +02:00
d9ce74e249 setup clone: Simplify code
This way we can avoid the extra try/catch block
2021-07-23 16:37:52 +02:00
9597f35a44 clone: Split into multiple files and make it more pluggable
This way I can more easily choose if I want to use libgit2 or the git
executable or whatever. It's being done so that one can wrtie automated
tests for this cloneRemote function.

There are still some users for whom this doesn't work, and after so so
many iterations, it's time to write tests. This is just way too complex
for me without tests.
2021-07-23 15:18:25 +02:00