Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle unknown files gracefully #160

Closed
j-martin opened this issue Jul 20, 2021 · 4 comments
Closed

Handle unknown files gracefully #160

j-martin opened this issue Jul 20, 2021 · 4 comments
Labels
enhancement New feature or request
Projects

Comments

@j-martin
Copy link

j-martin commented Jul 20, 2021

Is your feature request related to a problem? Please describe.

In this discussion which spanned from #155 it was noted that diffsitter cannot handle files it does not have the grammar for. This is an issue when trying to show diff in a git repository with a mix of supported and unsupported files.

Describe the solution you'd like
It would be nice if diffsitter was able to show diffs the same way that diff shows diff when the files are not supported. I'd be happy even if it only invoked diff in the background

Describe alternatives you've considered
With an intermediary script I guess it could achieve naively this way: diffsitter "$@" || diff "$@". It has been suggested to use .gitattribute for the git case, but this won't scale beyond the git usecase.

@j-martin j-martin added the enhancement New feature or request label Jul 20, 2021
@afnanenayet
Copy link
Owner

Yeah I suppose we could do that. I think I'd prefer having this be a configurable option with an error being the default behavior, maybe have a "passthrough" option that invokes another executable if diffsitter doesn't support the file type?

@afnanenayet afnanenayet added this to To do in Features Sep 27, 2021
@afnanenayet afnanenayet moved this from To do to In progress in Features Oct 10, 2021
Features automation moved this from In progress to Done Oct 17, 2021
@j-martin
Copy link
Author

Great! Any idea if you are planning a new release soon?

@afnanenayet
Copy link
Owner

Hey, sorry about this, missed your comment, but I pushed 0.6.7 recently, and also set up nightly builds.

@j-martin
Copy link
Author

No worries!

Just confirming the change works well. I just had to figure out where exactly to put the config. #249

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
No open projects
Development

No branches or pull requests

2 participants