Update libgit2 fork to v1.9.0#2683
Conversation
libgit2 changed which one it embeds.
- Update source excludes (mostly, libgit2 source files were moved into new `libgit2, `util` and `cli` subfolders) - Update compiler options to reflect changes in libgit2's CMake config
This replaces the libssh2 SSH backend, and enables support of .ssh/config.
We're not interested in these when working on GitUp itself.
These warnings are emitted *after* the actual libgit2 build, so these compiler options need to be in the project build settings, rather than the Third-Party package build settings. This commit only adds -Wno-documentation-deprecated-sync to the each list; previously, we were using the default values, which are now explicit.
These tests failed if you'd set the default branch name to e.g. main in your global Git config. This builds on “Specify `initial_head` when initializing a repository for tests so the global git config doesn't make it fail (git-up#988)” (aabbc8a).
45d2a88 to
91abdb9
Compare
|
Hi, I've built and tested the branch associated with this PR, and wanted to share my feedback. Firstly, thank you for adding support for However, I encountered an issue where GitUp would sometimes termination with Signal 13 (SIGPIPE) when
Tracing the issue, it seems to happen around the call to As a workaround, I added Interestingly, it looks like While my workaround with Thanks again for your work on this valuable feature! |
This seems to happen whenever we pull from a remote with changes.
|
Thank you for investigating, and writing it all up! Turns out, we implemented a similar solution in Retcon (a Git client that relies on GitUp's core framework—and that was exhibiting the same issue since switching over to this GitUp PR). It's encouraging that you ended up with the same fix when you looked into the bug. Also, the Retcon update has been in testing (and then publicly released) for a bit over a month, so the fix seems safe, as heavy-handed as it feels. So, I've updated the PR to add the call to GitUp. (also, sorry, I could have done it sooner! I don't daily-drive GitUp, and the crash slipped my mind) You found a bunch of context I wasn't aware of, too. It's interesting that libgit2 has something that looks like a solution but isn't working. If the signal ignore does become a problem at some point, that'll be worth looking into more deeply. |
|
Sorry for dragging my feet on this. I'll dedicate Friday morning to testing it out and hopefully merging. |
|
Sorry, meant to update on Friday. I'm going to live on the branch today just to make sure there isn't anything glaring, but the review looks good. Code itself looks great! @Cykelero Do you want me to open a PR on the libgit2 side to pull in your work? |
|
That's great to hear, thank you! As for updating the libgit2 repo, maybe you can just fetch the You could also hard-reset master to the update branch, but I think this wasn't done for the last update, not sure why. |
|
@Cykelero Will do. Just wasn't sure if you wanted to open one yourself for any personal reasons. If not, I'm happy to move the code to the right place. |
|
Ahh, of course, thank you for the consideration! Plus, it'll serve as a bit of documentation, why not. |
Summary
This PR updates the libgit2 fork to v1.9.0, and makes accompanying changes in the GitUp build config.
This PR is for the GitUp repo, and relies on a libgit2 branch currently in my fork of the repo.
This update:
core.manyFiles/index.skipHashGit options, which forced index version 4, and made the index unreadable to GitUpKit..ssh/configfiles are now supported: complex setups where different keys are used depending on the domain/username should now work in GitUp, and integration with third-party SSH agents like 1Password should be simpler.Of note, switching to OpenSSH seems to have broken the
credentialscallback, which doesn't called anymore when SSH auth fails.GitUp already displayed a cryptic error in that case (
Failed connecting to "origin" remote: authentication required but no callback set) but the error is now even less clear:Failed connecting to "origin" remote: could not read refs from remote repository.This is something I'm still investigating.
Changes
In the libgit2 repo
The
update-to-1.9.0branch is a rebase of thegitup_libgit_updatedbranch onto the latest libgit2 v1.9.0 commit.The first commit contains most of the fork's changes. Some conflicts were resolved while rebasing it. Code that was calling
libssh2_session_set_timeout()to set the timeout to 30 has been dropped, as libssh2 is no longer used. (that function call was superseded by thegit_socket_stream__timeoutvariable, too)These commits have been dropped because they're now part of the main libgit2 tree:
A couple of fix commits have been added.
In the GitUpKit repo
This is what's listed in this PR.
Most of the changes are to the build settings of the embedded Third-Party Swift package, which is used to embed libgit2. Since libgit2 relies on CMake but the GitUpKit build does not run CMake, we need to inline resolved settings (included source files, and compiler options) in
Package.swift.Testing the PR
To test the PR locally, you need to fetch the libgit2 update branch from the other repo, before checking out this PR's branch: