Open davinkevin opened 8 months ago
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.
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?
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?
Hello π ,
First, I would like to thank you for your project, it's a good one, and I want to use it⦠thank you for it!
My "bug" report is about the standard parameter
--ignore-matching-lines
I would like to use to simplify the review process, especially on lengthy diff including a version number in files (yaml
, for example).For example, on this project, if I run the following command without
difftastic
:Almost all 237 lines are for the exact change, about the line
app.kubernetes.io/version: 0.34.0
.If I use the standard
git diff
parameter to ignore this line, I have this:Which is precisely what I wanted.
However, If I run it with
difftastic
, the parameter is completely ignored.Is it a bug or a thing not yet supported or not even planned?
Additional information:
I am running on macOS, which is installed with
brew
.