-
Notifications
You must be signed in to change notification settings - Fork 622
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
Add support for diff-highlight #313
Comments
oh how I miss not having this.. |
So.. I was wondering- how viable is including this? Is it possible to "shell out to perl" for this? I've negligible experience in C, so I could use any help I can get in implementing this. Thanks |
There's two things required to make this work. First, the diff view will
need to learn how to parse ASCII control characters. To start with, only
the ones to enter/exit highlighting are required. Since the diff view is
line-based, `struct line` will need a flag to indicate whether `diff_draw`
needs to "interpret" the line characters.
Next, is the actual running of `diff-highlight` as a sort of filter of the
underlying `git-diff`/`git-show` command. Tig will need to set up the pipe
using the IO module. And also have hooks to kill/close the filter process.
It is not supported right now.
|
It would be really nice to have this feature (or even better diff-so-fancy), it saves a lot of time. |
Would be nice indeed. |
+1 for that feature |
How did you configure it? First of all I assume you are using Git's diff-highlight and not the fancy one?
Right now it only understands the standout terminal escape codes used by an "unconfigured" diff-highlight so did you configure anything under |
yeah I seem to have configured things under
[edit] And I'm using git's diff-highlight and configuring .tigrc with |
Set environment to `GIT_CONFIG=/dev/null` to avoid that diff-highlight loads custom configuration. Refs #313
@dwijnand OK, thanks, reproduced. I am new to diff-highlight so it's great to learn some tricks. I pushed a new commit to fix this so that it works without support for colors. Will add tests for this when I have some time. Implementing full support for terminal color escape codes would be nice but I think it would be better to support git's porcelain diff format which would open the doors to have split diff view, color words etc. |
@jonas thanks! |
@jonas I have some trouble with your awesome But I have this kind of weird stuff in the diff view: As you mentioned, I've checked that i'm using Git's diff-highlight without any configuration. Do you have any idea ? |
@gweodoo Do you have the diff-highlight script in your PATH? |
Fix issue with diff-highlight that the env variable is not null terminated Refs jonas#313 Signed-off-by: David Lin <[email protected]>
Fix issue with diff-highlight that the env variable is not null terminated Refs #313 Signed-off-by: David Lin <[email protected]> Signed-off-by: Jonas Fonseca <[email protected]>
Confirming this works nicely. Thanks so much! (Revision: e59bec5, tigrc: |
Can we use diff-so-fancy now? |
@Liooo No, not yet. With the infra put in place it should be doable. Do you mind creating a ticket for this? |
I can confirm that this works in tig 2.2.1, but only when used directly from terminal (iTerm2 for instance). |
I suggest opening a separate issue. I don't use tmux myself so
contributions in that regard would very appreciated.
|
Issue #559 created. |
@danielmanesku No idea how I'd go about troubleshooting it, but it works perfectly well in tmux for me. |
@jonas I'm sorry, I'm quite a bit late to respond (almost 5 months) Thanks ! |
For those on OSX who installed tig with the HomeBrew command 'brew install tig', somehow this won't work. You need to compile from sources and install before git through 'brew install git', in order to not use git default installed version. |
Works on macOS after |
What is the best / easiest way to get Thank you 🙏🏻 |
Installing git via |
Thank you so much @koutcher ! For others with git installed though Xcode, here are the steps to "install"
|
I would be really nice if tig supported diff-highlight.
The text was updated successfully, but these errors were encountered: