daff icon indicating copy to clipboard operation
daff copied to clipboard

Diff corrupt if 2 columns are equal

Open wollgarten opened this issue 9 years ago • 2 comments

Hello, your daff tool is very comfortable - great work - but i have a problem with it:

Assume the following file: A,B,C a,b,c

Change the file to: A,B,C,C a,b,c,c

.. then "git diff" shows that the last column has been removed.

wollgarten avatar Mar 22 '16 11:03 wollgarten

Thanks for reporting that @wollgarten. The diff in this case is definitely unhelpful. daff does not currently have a way to deal gracefully with columns that have the same name. Will look at adding a way.

paulfitz avatar Mar 24 '16 03:03 paulfitz

Hi @paulfitz , also thanks from my side for working on daff!

I am currently experiencing a related issue. I am trying to use daff on csv files with more than one header row, e.g.:

1: category1, category1, category2, category2 2: subcat1, subcat2, subcat1, subcat2 3: data, data, data, data, data (...)

To daff, this must look as if all column names exist two or three times. In my case, the effect is different from what @wollgarten observed

: Daff does not detect any changes. That is, the output of daff diff a.csv b.csv is just empty. When I run daff diff a.csv b.csv --all, the data of a.csv is displayed, without any changes.

Daff only works when I delete columns until only very few columns with duplicate names are left.

Attached two example files and a diff html.

example csv.zip

//edit: In the example files I set all values to 1. However, the same bug appears when all cells hold unique values.

bluunk avatar May 11 '17 14:05 bluunk