Coder Social home page Coder Social logo

Comments (3)

Wilfred avatar Wilfred commented on June 12, 2024

This isn't possible I'm afraid. --ignore-matchine-lines isn't passed to the external diff tool as far as I can see.

$ GIT_PAGER=cat DFT_LOG=trace GIT_EXTERNAL_DIFF=difft git diff --ignore-matching-lines 'app.kubernetes.io/version' --ext-diff
 2024-01-28T20:32:00.303Z INFO  difft::options > CLI arguments: ["src/conflicts.rs", "/tmp/git-blob-BI9V7X/conflicts.rs", "46602124597b3c0c7a20e89beee2a34ce9d376e1", "100644", "src/conflicts.rs", "0000000000000000000000000000000000000000", "100644"]

$ GIT_PAGER=cat DFT_LOG=trace GIT_EXTERNAL_DIFF=difft git diff --ext-diff                    
 2024-01-28T20:32:55.768Z INFO  difft::options > CLI arguments: ["src/conflicts.rs", "/tmp/git-blob-zpaXEJ/conflicts.rs", "46602124597b3c0c7a20e89beee2a34ce9d376e1", "100644", "src/conflicts.rs", "0000000000000000000000000000000000000000", "100644"]

Even if it was possible, I don't see how this feature could work for difftastic. Difftastic is diffing an abstract syntax tree (AST), and there's no way to apply a line-based exclude regex to an AST.

from difftastic.

davinkevin avatar davinkevin commented on June 12, 2024

Thank you for your answer @Wilfred

This isn't possible I'm afraid. --ignore-matchine-lines isn't passed to the external diff tool as far as I can see.

Maybe something to report to the git project if you think it should be passed to the external diff tool, no?

Difftastic is diffing an abstract syntax tree (AST), and there's no way to apply a line-based exclude regex to an AST

I worked on AST for Java & Kotlin annotation processor, it was possible to filter out some cases when we had the AST representation. I don't want to presume about complexity of difftastic, but a pre or post processing of the value could be possible, if not using the AST directly?

from difftastic.

0xdevalias avatar 0xdevalias commented on June 12, 2024

there's no way to apply a line-based exclude regex to an AST

Would it be possible to apply the line-based exclude after the AST-diffing occurs, when it is rendered back to a text format?

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.