spotrh / libxdiff

libxdiff 1.0 - A merged codebase of libxdiff for use with git and libgit2 - LGPLv2+
GNU Lesser General Public License v2.1
6 stars 4 forks source link

Cannot build new libgit2 #2

Open nacho opened 10 years ago

nacho commented 10 years ago

/builddir/build/BUILD/libgit2-0.20.0/src/blame_git.c: In function 'diff_hunks': /builddir/build/BUILD/libgit2-0.20.0/src/blame_git.c:351:7: error: 'xdemitconf_t' has no member named 'emit_func'

Although libgit2's xdiff copy seems to not have been updated since 2012...

bochecha commented 10 years ago

In libgit2's bundled xdiff, the xdemitconf_t structure is defined as follows:

typedef struct s_xdemitconf {
        long ctxlen;
        long interhunkctxlen;
        unsigned long flags;
        find_func_t find_func;
        void *find_func_priv;
        void (*emit_func)(void);
} xdemitconf_t;

In @spotrh's unbundled libxdiff, the same structure is defined as follows:

typedef struct s_xdemitconf {
        long ctxlen;
        long interhunkctxlen;
        unsigned long flags;
        find_func_t find_func;
        void *find_func_priv;
        xdl_emit_hunk_consume_func_t hunk_func;
} xdemitconf_t;

So the error message is actually quite obvious, spot's unbundled libxdiff indeed does not have an emit_func member.

nacho commented 10 years ago

Now the problem is, we are targetting mainly git and libgit2, we know libgit2 is using emit_func but what about git? is git using hunk_func? If yes we have a conflict here and either git or libgit2 should be fixed...

nacho commented 10 years ago

Adding @arrbee too

bochecha commented 10 years ago

In its xdiff/xdiff.h, Git 1.8.4.2 has:

typedef struct s_xdemitconf {
        long ctxlen;
        long interhunkctxlen;
        unsigned long flags;
        find_func_t find_func;
        void *find_func_priv;
        xdl_emit_hunk_consume_func_t hunk_func;
} xdemitconf_t;

So spot's libxdiff has the same thing as Git.

arrbee commented 10 years ago

I'm afraid I still don't see any evidence of activity on this project that motivates me to adopt it for libgit2 (as I have explained in libgit2/libgit2#1658 in more detail). I could be convinced to pull more recent code over from core Git because there is some evidence of active maintenance, but this project seems to be unmaintained (as I feared when this came up 6 months ago).

nacho commented 10 years ago

@arrbee pulling the latest stuff from git also works for us, since in that way we can always keep this up to date from the git's copy. Thoughts?

arrbee commented 10 years ago

@nacho I've started looking at pulling in the latest code from git.git directly into libgit2. There are significant API changes to accessing diff data so it is not a small change, but it does seem worthwhile to me. I will continue to work on it this week and see how much is actually involved.

By the way, I would still love it if this project became an effort to maintain and maybe even document an actual new libxdiff library. But I see that no xdiff related commits from git.git have ever been pulled into this repo since the initial creation, even though some of those are now more than 6 months old. Ah well.

nacho commented 10 years ago

@arrbee what about making this a submodule of libgit2? the idea would be to be pushing all the latest git stuff here and use it in libgit2. This way:

  1. libgit2 would decide which commit to use
  2. distributions would have a single place where to fetch the module

See also that would mean making you part of the maintainers of this module

bochecha commented 10 years ago

Seconding @nacho's submodule suggestion.

Also, I've just opened #3 which updates to the latest xdiff code in Git, as @arrbee correctly found that this repository was out of date.

nacho commented 10 years ago

@spotrh any comments on this?

spotrh commented 10 years ago

I have just merged bochecha's changes to sync with the latest code in git. I haven't had anywhere near as much time as I would have liked to push this, but I greatly appreciate the help.

nacho commented 10 years ago

@spotrh what about making a new release with these changes so we can create a new package for libxdiff and patch libgit2 to use it?