Hello community, here is the log from the commit of package libgit2-glib for openSUSE:Factory checked in at 2019-05-10 09:17:12 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libgit2-glib (Old) and /work/SRC/openSUSE:Factory/.libgit2-glib.new.5148 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libgit2-glib" Fri May 10 09:17:12 2019 rev:33 rq:701612 version:0.28.0.1 Changes: -------- --- /work/SRC/openSUSE:Factory/libgit2-glib/libgit2-glib.changes 2019-02-24 17:07:08.000573790 +0100 +++ /work/SRC/openSUSE:Factory/.libgit2-glib.new.5148/libgit2-glib.changes 2019-05-10 09:17:15.428229759 +0200 @@ -1,0 +2,13 @@ +Tue May 7 08:03:21 UTC 2019 - Bjørn Lie <[email protected]> + +- Update to version 0.28.0.1: + + Added push support. + + Add merge support. + + Fix macOS support. + + Add push operation. + + Compatibility with libgit2 0.28. + + Several meson improvements. + + Misc bug fixes. +- Drop libgit2-glib-libgit2_028-compat.patch: Fixed upstream. + +------------------------------------------------------------------- Old: ---- libgit2-glib-0.27.8.tar.xz libgit2-glib-libgit2_028-compat.patch New: ---- libgit2-glib-0.28.0.1.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libgit2-glib.spec ++++++ --- /var/tmp/diff_new_pack.B6eEh5/_old 2019-05-10 09:17:15.856230421 +0200 +++ /var/tmp/diff_new_pack.B6eEh5/_new 2019-05-10 09:17:15.860230427 +0200 @@ -18,15 +18,13 @@ Name: libgit2-glib -Version: 0.27.8 +Version: 0.28.0.1 Release: 0 Summary: GLib wrapper library around libgit2 License: LGPL-2.1-or-later Group: Development/Libraries/C and C++ URL: https://wiki.gnome.org/Projects/Libgit2-glib -Source0: https://download.gnome.org/sources/libgit2-glib/0.27/%{name}-%{version}.tar.xz -# PATCH-FIX-UPSTREAM libgit2-glib-libgit2_028-compat.patch -- Fix build with new libgit2 0.28 -Patch0: libgit2-glib-libgit2_028-compat.patch +Source0: https://download.gnome.org/sources/libgit2-glib/0.28/%{name}-%{version}.tar.xz BuildRequires: gtk-doc BuildRequires: meson ++++++ libgit2-glib-0.27.8.tar.xz -> libgit2-glib-0.28.0.1.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgit2-glib-0.27.8/NEWS new/libgit2-glib-0.28.0.1/NEWS --- old/libgit2-glib-0.27.8/NEWS 2019-02-13 08:17:38.000000000 +0100 +++ new/libgit2-glib-0.28.0.1/NEWS 2019-04-24 06:18:53.000000000 +0200 @@ -1,3 +1,13 @@ +News in 0.28.0.1 +-------------- +* Added·push·support +* Add merge support +* Fix macOS support +* Add push operation +* Compatibility with libgit2 0.28 +* Several meson improvements +* Misc bug fixes + News in 0.27.8 -------------- * Add body property to DiffFormatEmailOptions diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgit2-glib-0.27.8/README new/libgit2-glib-0.28.0.1/README --- old/libgit2-glib-0.27.8/README 2019-02-13 08:17:38.000000000 +0100 +++ new/libgit2-glib-0.28.0.1/README 2019-04-24 06:18:53.000000000 +0200 @@ -15,16 +15,16 @@ Installation ============ -libgit2-glib requires libgit2-0.27.x, glib 2.44.x, gio 2.26.x and +libgit2-glib requires libgit2-0.25.x, glib 2.44.x, gio 2.26.x and gobject-introspection 0.9.x. Simple install procedure: - % tar Jxf libgit2-glib-0.27.8.tar.xz # unpack the sources - % cd libgit2-glib-0.27.8 # change to the toplevel directory - % meson builddir # run meson - % ninja -C builddir # build libgit2-glib + % tar Jxf libgit2-glib-0.28.0.1.tar.xz # unpack the sources + % cd libgit2-glib-0.28.0.1 # change to the toplevel directory + % meson builddir # run meson + % ninja -C builddir # build libgit2-glib # [ Become root if necessary ] - % ninja -C builddir install # install libgit2-glib + % ninja -C builddir install # install libgit2-glib See the file 'INSTALL' for more detailed information. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgit2-glib-0.27.8/libgit2-glib/ggit-annotated-commit.c new/libgit2-glib-0.28.0.1/libgit2-glib/ggit-annotated-commit.c --- old/libgit2-glib-0.27.8/libgit2-glib/ggit-annotated-commit.c 2019-02-13 08:17:38.000000000 +0100 +++ new/libgit2-glib-0.28.0.1/libgit2-glib/ggit-annotated-commit.c 2019-04-24 06:18:53.000000000 +0200 @@ -109,4 +109,39 @@ return _ggit_oid_wrap ((git_oid *)oid); } + +/** + * ggit_annotated_commit_new_from_ref: + * @repository: the repository + * @ref: the reference to use to lookup the git_annotated_commit + * @error: a #GError for error reporting, or %NULL. + * + * Create a GgitAnnotatedCommit from the given reference + * + * Returns: (transfer full): a #GgitAnnotatedCommit. + * + */ +GgitAnnotatedCommit * +ggit_annotated_commit_new_from_ref (GgitRepository *repository, + GgitRef *ref, + GError **error) +{ + gint ret; + git_annotated_commit *commit; + + g_return_val_if_fail (GGIT_IS_REPOSITORY (repository), NULL); + g_return_val_if_fail (ref != NULL, NULL); + + ret = git_annotated_commit_from_ref(&commit, + _ggit_native_get (repository), + _ggit_native_get (ref)); + + if (ret != GIT_OK) + { + _ggit_error_set (error, ret); + return NULL; + } + return _ggit_annotated_commit_wrap (commit); +} + /* ex:set ts=8 noet: */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgit2-glib-0.27.8/libgit2-glib/ggit-annotated-commit.h new/libgit2-glib-0.28.0.1/libgit2-glib/ggit-annotated-commit.h --- old/libgit2-glib-0.27.8/libgit2-glib/ggit-annotated-commit.h 2019-02-13 08:17:38.000000000 +0100 +++ new/libgit2-glib-0.28.0.1/libgit2-glib/ggit-annotated-commit.h 2019-04-24 06:18:53.000000000 +0200 @@ -26,6 +26,8 @@ #include <git2.h> #include "ggit-types.h" +#include "ggit-repository.h" +#include "ggit-error.h" G_BEGIN_DECLS @@ -43,6 +45,10 @@ GgitOId *ggit_annotated_commit_get_id (GgitAnnotatedCommit *annotated_commit); +GgitAnnotatedCommit *ggit_annotated_commit_new_from_ref (GgitRepository *repository, + GgitRef *ref, + GError **error); + G_DEFINE_AUTOPTR_CLEANUP_FUNC (GgitAnnotatedCommit, ggit_annotated_commit_unref) G_END_DECLS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgit2-glib-0.27.8/libgit2-glib/ggit-branch.c new/libgit2-glib-0.28.0.1/libgit2-glib/ggit-branch.c --- old/libgit2-glib-0.27.8/libgit2-glib/ggit-branch.c 2019-02-13 08:17:38.000000000 +0100 +++ new/libgit2-glib-0.28.0.1/libgit2-glib/ggit-branch.c 2019-04-24 06:18:53.000000000 +0200 @@ -181,6 +181,32 @@ } /** + * ggit_branch_set_upstream: + * @branch: a #GgitBranch. + * @upstream_branch_name: name of the upstream branch; if %NULL unsets it. + * @error: a #GError for error reporting, or %NULL. + * + * Sets the upstream branch, for a given local branch reference + */ +void +ggit_branch_set_upstream (GgitBranch *branch, + const gchar *upstream_branch_name, + GError **error) +{ + gint ret; + + g_return_if_fail (GGIT_IS_BRANCH (branch)); + g_return_if_fail (error == NULL || *error == NULL); + + ret = git_branch_set_upstream (_ggit_native_get (branch), upstream_branch_name); + + if (ret != GIT_OK) + { + _ggit_error_set (error, ret); + } +} + +/** * ggit_branch_is_head: * @branch: a #GgitBranch. * @error: a #GError for error reporting, or %NULL. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgit2-glib-0.27.8/libgit2-glib/ggit-branch.h new/libgit2-glib-0.28.0.1/libgit2-glib/ggit-branch.h --- old/libgit2-glib-0.27.8/libgit2-glib/ggit-branch.h 2019-02-13 08:17:38.000000000 +0100 +++ new/libgit2-glib-0.28.0.1/libgit2-glib/ggit-branch.h 2019-04-24 06:18:53.000000000 +0200 @@ -50,6 +50,10 @@ GgitRef *ggit_branch_get_upstream (GgitBranch *branch, GError **error); +void ggit_branch_set_upstream (GgitBranch *branch, + const gchar *upstream_branch_name, + GError **error); + gboolean ggit_branch_is_head (GgitBranch *branch, GError **error); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgit2-glib-0.27.8/libgit2-glib/ggit-clone-options.c new/libgit2-glib-0.28.0.1/libgit2-glib/ggit-clone-options.c --- old/libgit2-glib-0.27.8/libgit2-glib/ggit-clone-options.c 2019-02-13 08:17:38.000000000 +0100 +++ new/libgit2-glib-0.28.0.1/libgit2-glib/ggit-clone-options.c 2019-04-24 06:18:53.000000000 +0200 @@ -149,7 +149,11 @@ if (error != NULL) { +#if LIBGIT2_SOVERSION >= 28 + git_error_set_str (GIT_ERROR, error->message); +#else giterr_set_str (GIT_ERROR, error->message); +#endif g_error_free (error); if (repository != NULL) @@ -187,7 +191,11 @@ if (error) { +#if LIBGIT2_SOVERSION >= 28 + git_error_set_str (GIT_ERROR, error->message); +#else giterr_set_str (GIT_ERROR, error->message); +#endif g_error_free (error); if (remote != NULL) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgit2-glib-0.27.8/libgit2-glib/ggit-config.c new/libgit2-glib-0.28.0.1/libgit2-glib/ggit-config.c --- old/libgit2-glib-0.27.8/libgit2-glib/ggit-config.c 2019-02-13 08:17:38.000000000 +0100 +++ new/libgit2-glib-0.28.0.1/libgit2-glib/ggit-config.c 2019-04-24 06:18:53.000000000 +0200 @@ -191,7 +191,11 @@ if (git_config_find_global (&buf) == GIT_OK) { path = g_file_new_for_path (buf.ptr); +#if LIBGIT2_SOVERSION >= 28 + git_buf_dispose (&buf); +#else git_buf_free (&buf); +#endif } return path; @@ -220,7 +224,11 @@ if (git_config_find_system (&buf) == GIT_OK) { path = g_file_new_for_path (buf.ptr); +#if LIBGIT2_SOVERSION >= 28 + git_buf_dispose (&buf); +#else git_buf_free (&buf); +#endif } return path; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgit2-glib-0.27.8/libgit2-glib/ggit-diff.c new/libgit2-glib-0.28.0.1/libgit2-glib/ggit-diff.c --- old/libgit2-glib-0.27.8/libgit2-glib/ggit-diff.c 2019-02-13 08:17:38.000000000 +0100 +++ new/libgit2-glib-0.28.0.1/libgit2-glib/ggit-diff.c 2019-04-24 06:18:53.000000000 +0200 @@ -786,13 +786,21 @@ if (ret != GIT_OK) { +#if LIBGIT2_SOVERSION >= 28 + git_buf_dispose (&buf); +#else git_buf_free (&buf); +#endif _ggit_error_set (error, ret); return NULL; } retval = g_strndup (buf.ptr, buf.size); +#if LIBGIT2_SOVERSION >= 28 + git_buf_dispose (&buf); +#else git_buf_free (&buf); +#endif return retval; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgit2-glib-0.27.8/libgit2-glib/ggit-error.c new/libgit2-glib-0.28.0.1/libgit2-glib/ggit-error.c --- old/libgit2-glib-0.27.8/libgit2-glib/ggit-error.c 2019-02-13 08:17:38.000000000 +0100 +++ new/libgit2-glib-0.28.0.1/libgit2-glib/ggit-error.c 2019-04-24 06:18:53.000000000 +0200 @@ -51,7 +51,11 @@ g_return_if_fail (err < 0); /* TODO: add more kind of errors, see git_error_t */ +#if LIBGIT2_SOVERSION >= 28 + git2_err = git_error_last (); +#else git2_err = giterr_last (); +#endif g_set_error_literal (error, GGIT_ERROR, err, git2_err == NULL ? "" : git2_err->message); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgit2-glib-0.27.8/libgit2-glib/ggit-message.c new/libgit2-glib-0.28.0.1/libgit2-glib/ggit-message.c --- old/libgit2-glib-0.27.8/libgit2-glib/ggit-message.c 2019-02-13 08:17:38.000000000 +0100 +++ new/libgit2-glib-0.28.0.1/libgit2-glib/ggit-message.c 2019-04-24 06:18:53.000000000 +0200 @@ -46,7 +46,11 @@ git_message_prettify (&buf, message, strip_comments, comment_char); d = g_strdup (buf.ptr); +#if LIBGIT2_SOVERSION >= 28 + git_buf_dispose (&buf); +#else git_buf_free (&buf); +#endif return d; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgit2-glib-0.27.8/libgit2-glib/ggit-oid.c new/libgit2-glib-0.28.0.1/libgit2-glib/ggit-oid.c --- old/libgit2-glib-0.27.8/libgit2-glib/ggit-oid.c 2019-02-13 08:17:38.000000000 +0100 +++ new/libgit2-glib-0.28.0.1/libgit2-glib/ggit-oid.c 2019-04-24 06:18:53.000000000 +0200 @@ -104,7 +104,7 @@ /** * ggit_oid_new_from_raw: - * @raw: the raw input bytes to be copied. + * @raw: (array zero-terminated=1) (element-type guchar): the raw input bytes to be copied. * * Creates a new #GgitOId from a raw oid. * diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgit2-glib-0.27.8/libgit2-glib/ggit-patch.c new/libgit2-glib-0.28.0.1/libgit2-glib/ggit-patch.c --- old/libgit2-glib-0.27.8/libgit2-glib/ggit-patch.c 2019-02-13 08:17:38.000000000 +0100 +++ new/libgit2-glib-0.28.0.1/libgit2-glib/ggit-patch.c 2019-04-24 06:18:53.000000000 +0200 @@ -194,7 +194,11 @@ if (ret == GIT_OK) { result = g_strdup (buf.ptr); +#if LIBGIT2_SOVERSION >= 28 + git_buf_dispose (&buf); +#else git_buf_free (&buf); +#endif } return result; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgit2-glib-0.27.8/libgit2-glib/ggit-push-options.c new/libgit2-glib-0.28.0.1/libgit2-glib/ggit-push-options.c --- old/libgit2-glib-0.27.8/libgit2-glib/ggit-push-options.c 2019-02-13 08:17:38.000000000 +0100 +++ new/libgit2-glib-0.28.0.1/libgit2-glib/ggit-push-options.c 2019-04-24 06:18:53.000000000 +0200 @@ -28,7 +28,8 @@ typedef struct _GgitPushOptionsPrivate { - git_push_options options; + git_push_options options; + GgitRemoteCallbacks *callbacks; } GgitPushOptionsPrivate; G_DEFINE_TYPE_WITH_PRIVATE (GgitPushOptions, ggit_push_options, G_TYPE_OBJECT) @@ -36,7 +37,8 @@ enum { PROP_0, - PROP_PARALLELISM + PROP_PARALLELISM, + PROP_CALLBACKS }; static void @@ -55,6 +57,10 @@ case PROP_PARALLELISM: priv->options.pb_parallelism = g_value_get_int (value); break; + case PROP_CALLBACKS: + ggit_push_options_set_remote_callbacks(options, + g_value_get_object (value)); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -77,6 +83,9 @@ case PROP_PARALLELISM: g_value_set_int (value, priv->options.pb_parallelism); break; + case PROP_CALLBACKS: + g_value_set_object (value, priv->callbacks); + break; } } @@ -100,6 +109,15 @@ G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (object_class, + PROP_CALLBACKS, + g_param_spec_object ("callbacks", + "Callbacks", + "Callbacks", + GGIT_TYPE_REMOTE_CALLBACKS, + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); } static void @@ -191,4 +209,51 @@ g_object_notify (G_OBJECT (options), "parallelism"); } +/** + * ggit_push_options_set_remote_callbacks: + * @options: a #GgitPushOptions. + * @callbacks: the #GgitRemoteCallbacks + * + * Set the remote callbacks for the push options + * + **/ +void +ggit_push_options_set_remote_callbacks (GgitPushOptions *options, + GgitRemoteCallbacks *callbacks) +{ + GgitPushOptionsPrivate *priv; + + g_return_if_fail (GGIT_IS_PUSH_OPTIONS (options)); + g_return_if_fail (callbacks != NULL || GGIT_IS_REMOTE_CALLBACKS (callbacks)); + + + priv = ggit_push_options_get_instance_private (options); + + priv->callbacks = g_object_ref (callbacks); + priv->options.callbacks = *_ggit_remote_callbacks_get_native (priv->callbacks); + + g_object_notify (G_OBJECT (options), "callbacks"); +} + +/** + * ggit_push_options_get_remote_callbacks: + * @options: a #GgitPushOptions. + * + * gets the remote callbacks object + * + * Returns: (transfer none) (nullable): the object's id or %NULL. + * + **/ +GgitRemoteCallbacks* +ggit_push_options_get_remote_callbacks (GgitPushOptions *options) +{ + GgitPushOptionsPrivate *priv; + + g_return_val_if_fail (GGIT_IS_PUSH_OPTIONS (options), 0); + + priv = ggit_push_options_get_instance_private (options); + + return priv->callbacks; +} + /* ex:set ts=8 noet: */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgit2-glib-0.27.8/libgit2-glib/ggit-push-options.h new/libgit2-glib-0.28.0.1/libgit2-glib/ggit-push-options.h --- old/libgit2-glib-0.27.8/libgit2-glib/ggit-push-options.h 2019-02-13 08:17:38.000000000 +0100 +++ new/libgit2-glib-0.28.0.1/libgit2-glib/ggit-push-options.h 2019-04-24 06:18:53.000000000 +0200 @@ -23,6 +23,7 @@ #include <glib-object.h> #include <git2.h> +#include <libgit2-glib/ggit-remote-callbacks.h> #include "ggit-types.h" @@ -37,15 +38,17 @@ }; const git_push_options * - _ggit_push_options_get_push_options ( - GgitPushOptions *options); + _ggit_push_options_get_push_options (GgitPushOptions *options); -GgitPushOptions *ggit_push_options_new (void); +GgitPushOptions *ggit_push_options_new (void); -gint ggit_push_options_get_parallelism (GgitPushOptions *options); -void ggit_push_options_set_parallelism (GgitPushOptions *options, - gint parallelism); +gint ggit_push_options_get_parallelism (GgitPushOptions *options); +void ggit_push_options_set_parallelism (GgitPushOptions *options, + gint parallelism); +GgitRemoteCallbacks * ggit_push_options_get_remote_callbacks (GgitPushOptions *options); +void ggit_push_options_set_remote_callbacks (GgitPushOptions *options, + GgitRemoteCallbacks *callbacks); G_END_DECLS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgit2-glib-0.27.8/libgit2-glib/ggit-remote-callbacks.c new/libgit2-glib-0.28.0.1/libgit2-glib/ggit-remote-callbacks.c --- old/libgit2-glib-0.27.8/libgit2-glib/ggit-remote-callbacks.c 2019-02-13 08:17:38.000000000 +0100 +++ new/libgit2-glib-0.28.0.1/libgit2-glib/ggit-remote-callbacks.c 2019-04-24 06:18:53.000000000 +0200 @@ -160,7 +160,11 @@ { if (error) { +#if LIBGIT2_SOVERSION >= 28 + git_error_set_str (GIT_ERROR, error->message); +#else giterr_set_str (GIT_ERROR, error->message); +#endif g_error_free (error); return GIT_ERROR; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgit2-glib-0.27.8/libgit2-glib/ggit-remote.c new/libgit2-glib-0.28.0.1/libgit2-glib/ggit-remote.c --- old/libgit2-glib-0.27.8/libgit2-glib/ggit-remote.c 2019-02-13 08:17:38.000000000 +0100 +++ new/libgit2-glib-0.28.0.1/libgit2-glib/ggit-remote.c 2019-04-24 06:18:53.000000000 +0200 @@ -29,6 +29,7 @@ #include "ggit-signature.h" #include "ggit-transfer-progress.h" #include "ggit-fetch-options.h" +#include "ggit-push-options.h" struct _GgitRemoteHead { @@ -362,6 +363,46 @@ git_remote_disconnect (_ggit_native_get (remote)); } + +/** + * ggit_remote_push: + * @remote: a #GgitRemote. + * @specs: (array zero-terminated=1) (allow-none): the ref specs. + * @push_options: a #GgitPushOptions. + * @error: a #GError for error reporting, or %NULL. + * + * Connect to the remote if not yet connected, negotiate with the remote + * about which objects are missing, create a packfile with the missing + * objects and send it. + * + * Returns: %TRUE if successful, %FALSE otherwise. + */ +gboolean +ggit_remote_push (GgitRemote *remote, + const gchar * const *specs, + GgitPushOptions *push_options, + GError **error) +{ + gint ret; + git_strarray gspecs; + + g_return_val_if_fail (GGIT_IS_REMOTE (remote), FALSE); + g_return_val_if_fail (error == NULL || *error == NULL, FALSE); + + ggit_utils_get_git_strarray_from_str_array (specs, &gspecs); + + ret = git_remote_push (_ggit_native_get (remote), &gspecs, + _ggit_push_options_get_push_options (push_options)); + + if (ret != GIT_OK) + { + _ggit_error_set (error, ret); + return FALSE; + } + + return TRUE; +} + /** * ggit_remote_download: * @remote: a #GgitRemote. @@ -547,4 +588,41 @@ return retval; } +/** + * ggit_remote_upload: + * @remote: a #GgitRemote. + * @specs: (array zero-terminated=1) (allow-none): the ref specs. + * @push_options: a #GgitPushOptions + * @error: a #GError for error reporting, or %NULL. + * + * Create a packfile and send it to the server + * + * Returns: %TRUE if successful, %FALSE otherwise. + */ +gboolean +ggit_remote_upload (GgitRemote *remote, + const gchar * const *specs, + GgitPushOptions *push_options, + GError **error) +{ + gint ret; + git_strarray gspecs; + + g_return_val_if_fail (GGIT_IS_REMOTE (remote), FALSE); + g_return_val_if_fail (error == NULL || *error == NULL, FALSE); + + ggit_utils_get_git_strarray_from_str_array (specs, &gspecs); + + ret = git_remote_upload (_ggit_native_get (remote), &gspecs, + _ggit_push_options_get_push_options (push_options)); + + if (ret != GIT_OK) + { + _ggit_error_set (error, ret); + return FALSE; + } + + return TRUE; +} + /* ex:set ts=8 noet: */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgit2-glib-0.27.8/libgit2-glib/ggit-remote.h new/libgit2-glib-0.28.0.1/libgit2-glib/ggit-remote.h --- old/libgit2-glib-0.27.8/libgit2-glib/ggit-remote.h 2019-02-13 08:17:38.000000000 +0100 +++ new/libgit2-glib-0.28.0.1/libgit2-glib/ggit-remote.h 2019-04-24 06:18:53.000000000 +0200 @@ -28,6 +28,7 @@ #include <libgit2-glib/ggit-native.h> #include <libgit2-glib/ggit-remote-callbacks.h> #include <libgit2-glib/ggit-proxy-options.h> +#include <libgit2-glib/ggit-push-options.h> G_BEGIN_DECLS @@ -83,6 +84,11 @@ void ggit_remote_disconnect (GgitRemote *remote); +gboolean ggit_remote_push (GgitRemote *remote, + const gchar * const *specs, + GgitPushOptions *push_options, + GError **error); + gboolean ggit_remote_download (GgitRemote *remote, const gchar * const *specs, GgitFetchOptions *fetch_options, @@ -104,6 +110,11 @@ GgitRemoteHead **ggit_remote_list (GgitRemote *remote, GError **error); +gboolean ggit_remote_upload (GgitRemote *remote, + const gchar * const *specs, + GgitPushOptions *push_options, + GError **error); + G_END_DECLS #endif /* __GGIT_REMOTE_H__ */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgit2-glib-0.27.8/libgit2-glib/ggit-repository.c new/libgit2-glib-0.28.0.1/libgit2-glib/ggit-repository.c --- old/libgit2-glib-0.27.8/libgit2-glib/ggit-repository.c 2019-02-13 08:17:38.000000000 +0100 +++ new/libgit2-glib-0.28.0.1/libgit2-glib/ggit-repository.c 2019-04-24 06:18:53.000000000 +0200 @@ -1013,7 +1013,11 @@ if (ret == GIT_OK) { rep = g_file_new_for_path (buf.ptr); +#if LIBGIT2_SOVERSION >= 28 + git_buf_dispose (&buf); +#else git_buf_free (&buf); +#endif } else { @@ -2215,7 +2219,7 @@ g_return_if_fail (error == NULL || *error == NULL); ret = git_remote_add_push (_ggit_native_get (repository), - _ggit_native_get (remote), + ggit_remote_get_name (remote), refspec); if (ret != GIT_OK) @@ -3680,7 +3684,11 @@ } ref = g_strdup (buf.ptr); +#if LIBGIT2_SOVERSION >= 28 + git_buf_dispose (&buf); +#else git_buf_free (&buf); +#endif return ref; } @@ -3894,6 +3902,96 @@ } /** + * ggit_repository_merge: + * @repository: a #GgitRepository. + * @their_heads: (array length=their_heads_length): the heads to merge into + * @their_heads_length: the length of their_heads + * @merge_opts: merge options + * @checkout_opts: checkout options + * @error: a #GError for error reporting, or %NULL. + * + * Merges the given commit(s) into HEAD, writing the results into the working directory. + * Any changes are staged for commit and any conflicts are written to the index. + * + * Callers should inspect the repository's index after this completes, resolve any conflicts and prepare a commit. + */ +void +ggit_repository_merge (GgitRepository *repository, + GgitAnnotatedCommit **their_heads, + gsize *their_heads_length, + GgitMergeOptions *merge_opts, + GgitCheckoutOptions *checkout_opts, + GError **error) +{ + gint ret, i; + git_annotated_commit **their_heads_native; + + g_return_if_fail (GGIT_IS_REPOSITORY (repository)); + g_return_if_fail (their_heads != NULL); + g_return_if_fail (their_heads_length > 0); + g_return_if_fail (GGIT_IS_CHECKOUT_OPTIONS (checkout_opts)); + g_return_if_fail (error == NULL || *error == NULL); + + their_heads_native = g_new0 (git_annotated_commit *, their_heads_length); + + for (i = 0; i < their_heads_length; ++i) + { + their_heads_native[i] = _ggit_annotated_commit_get_annotated_commit (their_heads[i]); + } + + ret = git_merge (_ggit_native_get (repository), + their_heads_native, + their_heads_length, + _ggit_merge_options_get_merge_options(merge_opts), + _ggit_checkout_options_get_checkout_options(checkout_opts)); + + if (ret != GIT_OK) + { + _ggit_error_set (error, ret); + } +} + +/** + * ggit_repository_merge_base: + * @repository: a #GgitRepository. + * @oid_one: the oid of one of the commits. + * @oid_two: the oid of the second of the commits + * @error: a #GError for error reporting, or %NULL. + * + * Find the merge base between two commits + * + * Returns: (transfer full) (nullable): a new #GgitOId or %NULL if an error occurred. + * + */ +GgitOId * +ggit_repository_merge_base (GgitRepository *repository, + GgitOId *oid_one, + GgitOId *oid_two, + GError **error) +{ + git_oid oid; + gint ret; + + g_return_val_if_fail (GGIT_IS_REPOSITORY (repository), NULL); + g_return_val_if_fail (oid_one != NULL, NULL); + g_return_val_if_fail (oid_two != NULL, NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + ret = git_merge_base (&oid, + _ggit_native_get (repository), + _ggit_oid_get_oid (oid_one), + _ggit_oid_get_oid (oid_two)); + + if (ret != GIT_OK) + { + _ggit_error_set (error, ret); + return NULL; + } + + return _ggit_oid_wrap (&oid); +} + +/** * ggit_repository_merge_trees: * @repository: a #GgitRepository. * @ancestor_tree: the common ancestor between the trees, or %NULL. @@ -3926,7 +4024,7 @@ ret = git_merge_trees (&out, _ggit_native_get (repository), - _ggit_native_get (ancestor_tree), + ancestor_tree == NULL ? NULL : _ggit_native_get (ancestor_tree), _ggit_native_get (our_tree), _ggit_native_get (their_tree), _ggit_merge_options_get_merge_options (merge_options)); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgit2-glib-0.27.8/libgit2-glib/ggit-repository.h new/libgit2-glib-0.28.0.1/libgit2-glib/ggit-repository.h --- old/libgit2-glib-0.27.8/libgit2-glib/ggit-repository.h 2019-02-13 08:17:38.000000000 +0100 +++ new/libgit2-glib-0.28.0.1/libgit2-glib/ggit-repository.h 2019-04-24 06:18:53.000000000 +0200 @@ -491,6 +491,18 @@ const gchar *path, GError **error); +void ggit_repository_merge (GgitRepository *repository, + GgitAnnotatedCommit **their_heads, + gsize *their_heads_length, + GgitMergeOptions *merge_opts, + GgitCheckoutOptions *checkout_opts, + GError **error); + +GgitOId *ggit_repository_merge_base (GgitRepository *repository, + GgitOId *oid_one, + GgitOId *oid_two, + GError **error); + GgitIndex *ggit_repository_merge_trees (GgitRepository *repository, GgitTree *ancestor_tree, GgitTree *our_tree, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgit2-glib-0.27.8/libgit2-glib/ggit-submodule.c new/libgit2-glib-0.28.0.1/libgit2-glib/ggit-submodule.c --- old/libgit2-glib-0.27.8/libgit2-glib/ggit-submodule.c 2019-02-13 08:17:38.000000000 +0100 +++ new/libgit2-glib-0.28.0.1/libgit2-glib/ggit-submodule.c 2019-04-24 06:18:53.000000000 +0200 @@ -439,7 +439,7 @@ g_return_if_fail (submodule != NULL); g_return_if_fail (submodule->valid); - g_return_val_if_fail (options == NULL || GGIT_IS_SUBMODULE_UPDATE_OPTIONS (options), NULL); + g_return_if_fail (options == NULL || GGIT_IS_SUBMODULE_UPDATE_OPTIONS (options)); g_return_if_fail (error == NULL || *error == NULL); ret = git_submodule_update (submodule->submodule, init, options ? _ggit_submodule_update_options_get_submodule_update_options (options) : NULL); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgit2-glib-0.27.8/libgit2-glib/ggit-types.h new/libgit2-glib-0.28.0.1/libgit2-glib/ggit-types.h --- old/libgit2-glib-0.27.8/libgit2-glib/ggit-types.h 2019-02-13 08:17:38.000000000 +0100 +++ new/libgit2-glib-0.28.0.1/libgit2-glib/ggit-types.h 2019-04-24 06:18:53.000000000 +0200 @@ -1140,7 +1140,7 @@ /** * GgitDiffLineCallback: * @delta: a #GgitDiffDelta. - * @hunk: a #GgitDiffHunk. + * @hunk: (nullable): a #GgitDiffHunk. * @line: a #GgitDiffLine. * @user_data: (closure): user-supplied data. * diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgit2-glib-0.27.8/libgit2-glib/meson.build new/libgit2-glib-0.28.0.1/libgit2-glib/meson.build --- old/libgit2-glib-0.27.8/libgit2-glib/meson.build 2019-02-13 08:17:38.000000000 +0100 +++ new/libgit2-glib-0.28.0.1/libgit2-glib/meson.build 2019-04-24 06:18:53.000000000 +0200 @@ -205,21 +205,15 @@ libgit2_dep, ] -if cc.get_id() == 'msvc' - libgit2_glib_link_args = [] -else - libgit2_glib_link_args = ['-Wl,-Bsymbolic-functions'] -endif - libgit2_glib = shared_library( 'git2-glib-' + libgit2_glib_api_version, version: libversion, soversion: soversion, + darwin_versions: darwin_versions, sources: sources + enum_sources, include_directories: top_inc, dependencies: platform_deps, c_args: cflags + ['-DG_LOG_DOMAIN="@0@"'.format(libgit2_glib_ns)], - link_args: libgit2_glib_link_args, install: true, ) @@ -245,9 +239,10 @@ ) if enable_python - install_data( + python.install_sources( 'Ggit.py', - install_dir: join_paths(python.sysconfig_path('purelib'), 'gi', 'overrides'), + pure: false, + subdir: 'gi/overrides', ) endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgit2-glib-0.27.8/meson.build new/libgit2-glib-0.28.0.1/meson.build --- old/libgit2-glib-0.27.8/meson.build 2019-02-13 08:17:38.000000000 +0100 +++ new/libgit2-glib-0.28.0.1/meson.build 2019-04-24 06:18:53.000000000 +0200 @@ -1,9 +1,9 @@ project( 'libgit2-glib', 'c', - version: '0.27.8', + version: '0.28.0.1', default_options: 'buildtype=debugoptimized', license: 'LGPL2+', - meson_version: '>= 0.48.0', + meson_version: '>= 0.49.0', ) libgit2_glib_version = meson.project_version() @@ -35,6 +35,7 @@ current = libgit2_glib_minor_version * 100 + libgit2_glib_micro_version - libgit2_glib_interface_age revision = libgit2_glib_interface_age libversion = '@0@.@1@.@2@'.format(soversion, current, revision) +darwin_versions = [current + 1, '@0@.@1@'.format(current + 1, revision)] libgit2_glib_prefix = get_option('prefix') libgit2_glib_libdir = get_option('libdir') @@ -106,6 +107,11 @@ add_project_arguments(common_flags, language: 'c') +if cc.has_link_argument('-Wl,-Bsymbolic-functions') + add_project_link_arguments('-Wl,-Bsymbolic-functions', language : 'c') +endif + + # Termios have_termios = cc.has_header('termios.h') @@ -151,7 +157,7 @@ # Check for python enable_python = get_option('python') if enable_python - python = import('python3') + python = import('python').find_installation('python3') python_req = '3.2.3'
