Comments (6)
@imbrish I have a similar issue and a scenario which I believe to be relevant here:
I have generated files which are committed to a repo. Those files are marked as binary mainly to tell git to not perform any kind of merging on those files. It also hides the diffs on Github/Gitlab which is useful as they should not be reviewed/edited when merging.
However locally, there a few times where I do need to look at the code generation process and investigate what changed in those files. I can easily do this with git diff
by passing the --text
option, essentially telling git to treat those files as as text (which they actually are).
I want to use delta to do a diff between two generation versions of my files in two separate dir. Ideally I'd like to do delta dirA dirB
. Since this calls git
it doesn't work. My current work around is to call:
git diff --no-index --color --text -- dirA dirB | delta
which works but is a bit cumbersome.
I believe the issue is here where delta
calls git
but does not allow passing any extra options to git
. It would be great if we could do something along the lines of
delta [OPTIONS] [MINUS_FILE] [PLUS_FILE] -- [GIT_OPTIONS]
which would look like delta dirA dirB -- --text
.
from delta.
By unsetting the diff
in .gitattributes
, you are telling git
that it is not possible to diff the *.md
files. Which, if i understand correctly, is what you want on GitHub. The standard behavior is showing such files as binary. It has nothing to do with delta.
If you want to skip these diffs on GitHub, but generate them locally, I guess you could have another attributes file, not included in version control, where you tell git
it should diff these files. I am a bit unsure about inheritance though.
from delta.
I did think that is the case, does that imply then that vscode is behaving how I want due to the fact that it's probably behaving incorrectly?
from delta.
I don't use vscode myself, but I would imagine it talks with git to be helpful, and not necessarily promises to follow all the rules.
from delta.
The gitattributes are applied to the output before it is sent to delta
or any other pager, see git diff | less
- this is what delta
works on, and it already mentions binary files.
Setting a different file via git -c core.attributesFile=my_gitattributes diff
seemingly can not override the -diff
setting.
However, in your specific case, @0xjac, PR #1697 will add an option so you can call -@=--text
from delta.
@th1000s I missed that PR. Thanks a lot, it seems perfect. I'll wait for it to be released. π
from delta.
Related Issues (20)
- π Always using light theme on dark background HOT 9
- π 0.17.0 seems much slower then 0.16.5 HOT 13
- π --navigate n/N jumps to next/prev hunk, not file? HOT 3
- RUSTSEC-2024-0320: yaml-rust is unmaintained.
- π Incorrect syntax-highlight with comment tag "#"
- π [Docs] Show the default config values HOT 1
- π Extra newline before diffs
- π Empty diff for proc files
- [Feature Request] Show percentage of how far the entire diff has been read
- `git grep -l` replaces first `-` with a `:` HOT 1
- Not working in Ubuntu 22.04 as intendedπ
- π inserted/deleted blank lines are sometimes hard to see
- Specify light and dark themes simultaneously, and auto-switch based on system appearance HOT 1
- π ripgrep JSON output causes panic with UTF character
- π PAGER env variable will omit command line parameters
- Weird EOL characters in side-by-side diff output ( ^[[0K )
- π Mouse scroll not working in jetbrains ide's terminal
- π output using html <ins> and <del> tags
- π Printing special terminal control characters "^[]11;rgb:0000/0000/0000^G" HOT 2
- π Memory allocation error for non root user HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from delta.