Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update libgit2 to 0.19.0 #56

Merged
merged 12 commits into from
Jul 1, 2013
Merged

Update libgit2 to 0.19.0 #56

merged 12 commits into from
Jul 1, 2013

Conversation

ben
Copy link
Member

@ben ben commented Jul 1, 2013

🚧👷 WIP DO NOT MERGE 👷🚧

Libgit2 recently released v0.19.0, and there are a number of improvements that node-gitteh could take advantage of (see #8).

However, there are also a number of API changes that need to be adjusted for. In some cases this will probably mean changing the gitteh API as well.

A quick summary:

  • The GIT_DIR_* macros were changed into an enum, and their names changed.
  • git_indexer_stats is now called git_transfer_progress, and its fields have changed names and semantics.
  • All the calls that ended with _oid now end with _id
  • Callbacks passed to git_submodule_foreach now take a git_submodule* as a parameter. We may be able to do better inside Repository::SubmoduleListCallback with this, but for now I've just added the parameter to the signature.
  • Push and fetch refspecs are now arrays, which affects the way we create remotes.
  • Once the C++ compiles, the JS API surface will have to change to match.

@ben
Copy link
Member Author

ben commented Jul 1, 2013

Opening this early so I can get some feedback. I've done most of the work to get gitteh compiling again, but I haven't actually been able to run the tests yet, so none of the api changes have made it into the coffeescript source.

@mildsunrise
Copy link
Contributor

👍 Great work!

Hey, what about the -fPIC flag issue we discussed earlier (0.18 doesn't
add the flag when producing static lib, which causes build to fail in x64 systems).

And since 0.19 inherits this behaviour, we should manually add the flag.

@@ -56,7 +56,7 @@ async.series([
envpassthru("mkdir", "-p", buildDir, cb);
},
function(cb) {
envpassthru("cmake", "-DTHREADSAFE=1", "-DBUILD_CLAR=0", "..", {
envpassthru("cmake", "-DCMAKE_C_FLAGS='-fPIC'", "-DTHREADSAFE=1", "-DBUILD_CLAR=0", "..", {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jmendeth, this forces cmake to include the -fPIC flag when building. We might have to revise that when we do Windows support, but this should fix it for now.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, that will do it for now.

@ben
Copy link
Member Author

ben commented Jul 1, 2013

Travis is 💚! I'd like some more eyes on the changes to refspecs and progress notifications, but otherwise I think this is good to go.

@samcday
Copy link
Contributor

samcday commented Jul 1, 2013

@ben Just reviewed and it all looks rather sexcellent actually. Awesome work!

I'm a little confused though - I tried running the tests locally and I'm getting a few fails. Also the merge commit that Travis built (dd6d82e) I can't even find in my local repo, though I can see the HEAD of this PR (a3e10bb)... O.o

@samcday
Copy link
Contributor

samcday commented Jul 1, 2013

Oh jesus I forgot to run cake build... Coffee hasn't kicked in yet.

@samcday
Copy link
Contributor

samcday commented Jul 1, 2013

@ben as you said there's some issues with the JS api now (particularly around the refspec changes), and these unfortunately aren't being picked up by the tests (possibly because there is none yet for remotes ... derp).

I'm going to merge this in now and fix up the JS API.

@samcday samcday merged commit a3e10bb into libgit2:master Jul 1, 2013
@ben
Copy link
Member Author

ben commented Jul 1, 2013

Good point – I was just making sure the tests passed, I didn't try to fix up anything that wasn't covered by them. 😊

@ben ben deleted the libgit2-0.19.0 branch July 1, 2013 22:28
@samcday
Copy link
Contributor

samcday commented Jul 1, 2013

Haha yeah it's totoally my bad not having better coverage. I'm going to rectify that as I update the broken parts of the API ;)

@iamwilhelm
Copy link
Contributor

quick question: how different is 0.19's API from 0.17? I'm still in the middle of upgrading to 0.17, and if it's significantly different, I might as well just move all the way to 0.19

@ben
Copy link
Member Author

ben commented Jul 1, 2013

Pretty different. Here's the quick bullet list from 0.18.0:

  • major improvements to API consistency
  • fetch and push over several protocols (including native WinHTTP support)
  • new/improved APIs for branch management, clone, checkout, notes, pack building, remotes, revparse (for both single and commit ranges), reset, stash, submodules
  • custom backend support for objects (odb) and references (refdb)
  • beautifully reworked clar testing framework and more than 600 new tests
  • diff rename detection, typechange and submodule support, and iteration APIs
  • builds for MinGW, OpenBSD, FreeBSD, Android, Solaris, AmigaOS, et al. on top of 32-bit and 64-bit Windows, MacOS, and Linux

And here's the list for v0.19.0:

  • New (threadsafe) cache for objects
  • Iterator for Status
  • New Merge APIs
  • SSH support on *NIX
  • Function context on diff
  • Namespaces support
  • Index add/update/remove with wildcard support
  • Iterator for References
  • Fetch and push refspecs for Remotes
  • Rename support in Status
  • New 'sys/` namespace for external headers with low-level APIs

And a quick function-level changelist. We're trying to get all of the breaking changes done before marking a 1.0 release, so lots of stuff has happened.

@iamwilhelm
Copy link
Contributor

Thanks for the info. I should have been a little clearer with my question, since the version numbers for gitteh are close to the version numbers for libgit2. Will the API for gitteh change significantly from 0.17 to 0.19?

@samcday
Copy link
Contributor

samcday commented Jul 2, 2013

@iamwilhelm it will change, as is expected when the major version component is still 0.

That said however, the API for gitteh is pretty far removed from libgit2 itself, so things like naming changes won't affect Gitteh API so much, and added features will generally not cause existing API changes either.

That said the move to gitteh version 0.17.0 is significant as it was a complete refactor, so if you move up to 0.17 now you won't have many problems moving up to 0.19.0 when it's available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants