Coder Social home page Coder Social logo

[2; .txt, .js] Outputs entirety of generated file despite there being only two changes; tries to allocate 16.3 TiB about difftastic HOT 7 CLOSED

berrymot avatar berrymot commented on June 12, 2024
[2; .txt, .js] Outputs entirety of generated file despite there being only two changes; tries to allocate 16.3 TiB

from difftastic.

Comments (7)

Wilfred avatar Wilfred commented on June 12, 2024

lojbo .ui

Thanks for the report.

I think the first issue is probably trying to diff lines ending \r\n against files ending with just \n and concluding that they're different.

The second issue is probably due to line diffing trying to highlight words within the same line.

from difftastic.

Wilfred avatar Wilfred commented on June 12, 2024

I can repro the second issue, but not the first. Can you reproduce the first issue with local copies of the files? If so, could you attach them here?

from difftastic.

Wilfred avatar Wilfred commented on June 12, 2024

OK, I can reproduce the first issue if I have two files that differ by line ending, but I'm not convinced that difftastic's behaviour is wrong here.

$ echo "one\ntwo" > a.txt                            
$ echo "one\nfoo\ntwo" > b.txt
$ unix2dos b.txt       

$ difft a.txt b.txt
b.txt --- Text
1 one                             1 one
.                                 2 foo
2 two                             3 two

$ diff a.txt b.txt 
1,2c1,3
< one
< two
---
> one
> foo
> two

Plain GNU diff also considers these files to be completely different. Do you have any special crlf settings in your Windows git setup?

from difftastic.

berrymot avatar berrymot commented on June 12, 2024

I can repro the second issue, but not the first. Can you reproduce the first issue with local copies of the files? If so, could you attach them here?

Unfortunately I'll be away from my computer until next week, sorry. I don't think it's the line endings though? Pretty sure allwords.txt has been CRLF all along. When I get back I'll try adding a test entry to the database and regenerate allwords.txt and see if this still happens.

As for

Do you have any special crlf settings in your Windows git setup?

I don't remember ever messing with that- the one thing I know I've done to etc/config is using difftastic rather than the default diff lol

ni'o lu «lojbo .ui» li'u zo'u .ue xu do jbopre

from difftastic.

berrymot avatar berrymot commented on June 12, 2024

The test entry has been made, it happens to mean 'line terminator' lol; I'll rerun the parsing stuff when I can

from difftastic.

berrymot avatar berrymot commented on June 12, 2024

Reran the script with the new word.

allwords.txt still printed the entire file:
image

data.txt still didn't:
image

Replaced every \n with \r\n in the script, reran.

This fixed allwords.txt, but data.txt's changes were too big.
image

Reverted the changes to those two, manually replaced each LF with CRLF, committed, reran.

image

wheeeeeee

from difftastic.

berrymot avatar berrymot commented on June 12, 2024

Updated to 0.56.1, turns out printing such a giant diff is REALLY bad for my terminal lol

from difftastic.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.