GumTreeDiff / gumtree

An awesome code differencing tool
https://github.com/GumTreeDiff/gumtree/wiki
GNU Lesser General Public License v3.0
933 stars 174 forks source link

Error while running gumtree with textdiff option #322

Closed nimisha-agarwal closed 12 months ago

nimisha-agarwal commented 1 year ago

Screenshot from 2023-11-07 13-02-22

How to resolve this error?

jrfaller commented 1 year ago

Hi! You have to install and put in the path tree sitter parser.

Cheers

nimisha-agarwal commented 1 year ago

Do I need to install the java-tree-sitter parser? Can you share the link that contains instructions for installing it?

jrfaller commented 1 year ago

It's all on the tree sitter parser repo, located in the same organization.

nimisha-agarwal commented 1 year ago

Thank you so much. I got it.

nimisha-agarwal commented 1 year ago

Screenshot from 2023-11-07 15-40-42

After installing the tree sitter and adding it to the system path, I got this new error. Can you help me in resolving it?

jrfaller commented 1 year ago

Apparently, there is a syntax error in your file.

nimisha-agarwal commented 1 year ago

Do you mean the error is in the GumTree code, as its binary is extracted from the zip file generated after the build?

jrfaller commented 1 year ago

Could you attach the files you are trying to diff? The syntax error should be in one of those

nimisha-agarwal commented 1 year ago

I am using the same file for both arguments. Here are the contents: solution.txt

jrfaller commented 1 year ago

Could you provide me the command? It works for me

nimisha-agarwal commented 1 year ago

./gumtree textdiff ~/solution.c ~/solution.c

jrfaller commented 1 year ago

OK it's definitively working on my side, although the result is not very interesting ;-)

Something is not right with your install. Could you try tree-sitter-parser.py solution.c c ? You should obtain the XML of the AST.

nimisha-agarwal commented 1 year ago

I am getting the following error on running this command: Screenshot from 2023-11-20 18-28-57

I have taken code from the main branch. This file is unavailable in my local repository. Where can I find it?

jrfaller commented 1 year ago

OK it seems that you did not checkout the submodules in the project tree-sitter-parser right ?

nimisha-agarwal commented 1 year ago

I have checked them out, and GumTree is also working now. Thanks for all the help :)

One more query: How can I install GumTree on Ubuntu 18.04 as the dependent packages are not available for this version?

jrfaller commented 1 year ago

if you don't need the dependent packages, you can install GumTree without them, it will work, if not you need to find how to compile manually the required native packages.