Coder Social home page Coder Social logo

Comments (7)

ymattw avatar ymattw commented on August 22, 2024

That's how it is designed. For unified diff we need the leading chars to
distinguish lines from original and new files, while for side by side diff
we do not need them, by nature left side is original and right side is new.

On Friday, April 24, 2015, Mathieu Arnold [email protected] wrote:

Hi,

I'm a FreeBSD port committer, and in that capacity, I patch software a lot
to coerce it to work on FreeBSD, or with newer version of software that
upstream does not support yet, and in that capacity, we deal with a lot of
patches, that change over time, and there's a bug in the side by side
thingie.

To get the diff I'm talking about, you can run svn diff -c 384636
https://svn0.eu.freebsd.org/ports
/head/devel/p5-Data-Alias/files/patch-Alias.xs

The unified version of cdiff looks quite all right:

[image: capture d ecran 2015-04-24 a 15 08 21]
https://cloud.githubusercontent.com/assets/75783/7319189/de571cb2-ea93-11e4-9ebc-539fcebddf19.png

But the side by side eats all the + at the beginning of the lines, and
does not look that good:

[image: capture d ecran 2015-04-24 a 15 08 38]
https://cloud.githubusercontent.com/assets/75783/7319198/fe78b4f6-ea93-11e4-85ea-69b677baaae9.png


Reply to this email directly or view it on GitHub
#44.

from ydiff.

mat813 avatar mat813 commented on August 22, 2024

If you look at the screenshots, you'll see it eats all the + at the start of the line, not just the first one.

from ydiff.

ymattw avatar ymattw commented on August 22, 2024

The source is a patch file so the output looks confusing, but cdiff indeed only "eat" the first - or +.

from ydiff.

mat813 avatar mat813 commented on August 22, 2024

I'm sorry, but no, it ate two.

line 147, it starts with <space>+#ifdef... shows up as +#ifdef...
line 148, starts with ++#if (PERL... shows up as #if (PERL... it's eating both +, which is bad.

from ydiff.

mat813 avatar mat813 commented on August 22, 2024

Note, it's eating in the side by side version, the unified diff version is fine.

from ydiff.

ymattw avatar ymattw commented on August 22, 2024

I got what you are saying, indeed it's a bug. Probably wrong use of lstrip. I will fix it soon, thanks for reporting!

from ydiff.

ymattw avatar ymattw commented on August 22, 2024

Fixed in commit 10fa1e8, new version 0.9.7 available on pypi.

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.