On Thu, Feb 19, 2015 at 2:53 AM, Salvador Cuñat <salvador.cu...@gmail.com>
wrote:

>
>
> 2015-02-19 1:14 GMT+01:00 Lubomir I. Ivanov <neolit...@gmail.com>:
>
>>
>>
>> i'm not sure why we have the wrapper for a 3 parameter
>> git_remote_fetch(), as i can't find it in their log.
>> fe3a40a4ff056400 is when git_remote_fetch() was added with one param
>> and then it changed to 4 params at c3ab1e5af4c43d.
>>
>> what a mess.
>>
>> > I've just remembered I had a built (not debian package) libgit2
>> library, may
>> > be it's still hanging around, as /usr/local/include/ is not the usual
>> > install dir for debian.
>> > Gonna take a look.
>> >
>>
>> could be the case, but our macro may be wrong as well.
>> l
>>
>
> Hi Lubomir.
>
> As supossed, I had a v0.20.0  version built from scratch overlaped with
> the debian package. Cleaned it and the macro worked fine as debian version
> (v0.21.3) has three parameters defined .
>
> I think the wrapper was set to support three parameters because v0.21 (at
> least the one packaged in debian) had only those 3 and fourth was
> introduced  later.  But agree with you  3 completely different versions of
> the same library function in less than a  year is a mess  (saying it smooth
> and politely).
>
> On Ubuntu Utopic (14.10) I also have the problem with only 1 parameter for
git_remote _fetch
#define LIBGIT2_VERSION "0.20.0"

I use the attached patch on my tree, but never sent it out as I have no
clue about how the libgit versioning/API works.

miika
From 13a65f95a176f7c1c794521703391741a3ad304b Mon Sep 17 00:00:00 2001
From: Miika Turkia <miika.tur...@gmail.com>
Date: Thu, 19 Feb 2015 07:00:44 +0200
Subject: [PATCH] properly use git_remote_fetch on libgit2 0.20.0

Signed-off-by: Miika Turkia <miika.tur...@gmail.com>
---
 git-access.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/git-access.c b/git-access.c
index 99dfe37..c79f378 100644
--- a/git-access.c
+++ b/git-access.c
@@ -18,7 +18,10 @@
  * the interfaces, often just renaming things without any sane way to know which
  * version you should check for etc etc. It's a disgrace.
  */
-#if !LIBGIT2_VER_MAJOR && LIBGIT2_VER_MINOR < 22
+#if !LIBGIT2_VER_MAJOR && LIBGIT2_VER_MINOR <= 20
+  #define git_remote_lookup(res, repo, name) git_remote_load(res, repo, name)
+  #define git_remote_fetch(remote, refspecs, signature, reflog) git_remote_fetch(remote)
+#elif !LIBGIT2_VER_MAJOR && LIBGIT2_VER_MINOR < 22
   #define git_remote_lookup(res, repo, name) git_remote_load(res, repo, name)
   #define git_remote_fetch(remote, refspecs, signature, reflog) git_remote_fetch(remote, signature, reflog)
 #endif
-- 
2.1.0

_______________________________________________
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface

Reply via email to