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

git-changebar: fix compatibility with libgit2 0.28 API #821

Merged
merged 1 commit into from
Feb 13, 2019
Merged

git-changebar: fix compatibility with libgit2 0.28 API #821

merged 1 commit into from
Feb 13, 2019

Conversation

maxice8
Copy link
Contributor

@maxice8 maxice8 commented Feb 12, 2019

Namely rename the deprecated git_buf_free to git_buf_dispose and change
giterr calls to git_error.

@elextr
Copy link
Member

elextr commented Feb 12, 2019

This needs to select which name to use depending on the version of libgit the plugin is being built against.

@maxice8 maxice8 changed the title git-changebar: fix compatibility with libgit2 0.28 API [WIP] git-changebar: fix compatibility with libgit2 0.28 API Feb 12, 2019
@maxice8
Copy link
Contributor Author

maxice8 commented Feb 12, 2019

Ok they have been guarded under

#if LIBGIT2_VER_MAJOR == 0 && LIBGIT2_VER_MINOR >= 28
/* new api */
#else 
/* old api */
#endif 

@elextr
Copy link
Member

elextr commented Feb 12, 2019

According to the release notes API removals for 0.28, the old names are being kept for backward compatibility "for the foreseeable future", so this isn't really needed.

@b4n b4n self-requested a review February 12, 2019 13:08
@b4n b4n self-assigned this Feb 12, 2019
@b4n
Copy link
Member

b4n commented Feb 12, 2019

I didn't check the new API yet, but it's probably good to use it. But I'd rather see a backward compatibility chunk like there's around line 35, and change the code to use the new name.

git-changebar/src/gcb-plugin.c Outdated Show resolved Hide resolved
@maxice8
Copy link
Contributor Author

maxice8 commented Feb 12, 2019

I removed the individual checks and added a block that defines git_buf_dispose to git_buf_free and git_error_last to giterr_last when libgit2 version is under 0.28.0

@maxice8 maxice8 changed the title [WIP] git-changebar: fix compatibility with libgit2 0.28 API git-changebar: fix compatibility with libgit2 0.28 API Feb 12, 2019
Copy link
Member

@b4n b4n left a comment

Choose a reason for hiding this comment

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

Otherwise looks good, although I didn't test it yet (will try to do tomorrow).

git-changebar/src/gcb-plugin.c Outdated Show resolved Hide resolved
git-changebar/src/gcb-plugin.c Outdated Show resolved Hide resolved
Namely rename the deprecated git_buf_free to git_buf_dispose and change
giterr calls to git_error.
Copy link
Member

@b4n b4n left a comment

Choose a reason for hiding this comment

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

Works fine with 0.27 and 0.28, and indeed fixes support for a naive libgit2 build (which is not too nice on their part, but well… might actually be a bug).

@b4n b4n merged commit e18cc0c into geany:master Feb 13, 2019
@maxice8
Copy link
Contributor Author

maxice8 commented Feb 13, 2019

👍

@b4n
Copy link
Member

b4n commented Feb 14, 2019

and indeed fixes support for a naive libgit2 build (which is not too nice on their part, but well… might actually be a bug).

It is indeed a libgit2 bug and they are working on a fix.

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

Successfully merging this pull request may close these issues.

3 participants