Coder Social home page Coder Social logo

cdiff is breaking blocks about ydiff HOT 2 CLOSED

ymattw avatar ymattw commented on August 22, 2024
cdiff is breaking blocks

from ydiff.

Comments (2)

snoblenet avatar snoblenet commented on August 22, 2024

To clarify, in the above minimal case, cdiff does actually work correctly.

But in a slightly more complex case designed to mimic real usage conditions, it fails in the way described above.

The slightly more complex case is...

Before:

case: 'one';
  return 'yes, one';
  break;
case: 'two';
  return 'yes, two';
  break;

After:

case: 'one';
  return 'yes, one';
  break;
case 'one-point-five';
  return 'yes, one-point-five';
  break;
case: 'two';
  return 'yes, two';
  break;

In that case git diff correctly identifies the added text as:

case 'one-point-five';
  return 'yes, one-point-five';
  break;

But when piped to cdiff, the change is presented as:

  break;
case 'one-point-five';
  return 'yes, one-point-five';

from ydiff.

ymattw avatar ymattw commented on August 22, 2024

It's a behavior of python difflib, which is slightly different to git/svn diff and patchutils, I imagine enhancing this requires to touch core diff algorithm in difflib. I agree it's confusing but IMHO not worth to "fix" as the diff format is still right. Thanks for reporting!

from ydiff.

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.