gumtree icon indicating copy to clipboard operation
gumtree copied to clipboard

Directory textdiff: Error while parsing arguments of client 'textdiff' Source must be a file

Open dayaad opened this issue 3 years ago • 3 comments

When using textdiff to compare packages/multiple files I see the following error:

Error while parsing arguments of client 'textdiff'.
java.lang.reflect.InvocationTargetException
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
	at com.github.gumtreediff.gen.Registry.lambda$defaultFactory$1(Registry.java:127)
	at com.github.gumtreediff.client.Run.startClient(Run.java:79)
	at com.github.gumtreediff.client.Run.main(Run.java:115)
Caused by: com.github.gumtreediff.client.Option$OptionException: Source must be a file: /Users/diyaayaa/Downloads/python-basics-exercises-master/ch06-functions-and-loops
	at com.github.gumtreediff.client.diff.TextDiff.<init>(TextDiff.java:43)
  • I would like to get the diff output in JSON format that's the reason am using textdiff.

dayaad avatar Feb 16 '21 18:02 dayaad

Hi!

Currently textdiff accept only two files as arguments (source and destination files).

However it could be nice to have a whole directory diff such as webdiff. I am not sure however what would be the output...

Cheers.

jrfaller avatar Feb 16 '21 18:02 jrfaller

Hi @jrfaller ,

So am assuming that textdiff won't give me the (Deleted/Added files). I think for file differences maybe for now I can create a small script to go through the files that've been modified. But, I am still thinking of a way to use GumTree to list out what files have been added/deleted and get that list output on terminal or a file.. not through webdiff.

dayaad avatar Feb 16 '21 19:02 dayaad

Hi, there is the DirectoryComparator (https://github.com/GumTreeDiff/gumtree/blob/main/core/src/main/java/com/github/gumtreediff/io/DirectoryComparator.java) that does exactly that, but it is not associated to a CLI command 😢

Then we could use this inside the textdiff command, but we have to think about how the output would look like, especially between the multiple diffs (filenames? special syntax to enable post-processing?).

jrfaller avatar Feb 16 '21 19:02 jrfaller