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

Use diff-highlight for a better diff output. #587

Closed
vonavi opened this issue Mar 11, 2013 · 7 comments
Closed

Use diff-highlight for a better diff output. #587

vonavi opened this issue Mar 11, 2013 · 7 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@vonavi
Copy link
Contributor

vonavi commented Mar 11, 2013

Hi guys!

Git supports a nice diff-highlight feature from https://github.com/git/git/tree/master/contrib/diff-highlight. My workaround is to put the diff-highlight script in $PATH. Then I use Elisp snippet magit-diff-highlight.el and get a better diff output. For the details, see the description of diff-highlight. But my code is a hack, and I'm very interested in to incorporate such an opportunity into Magit immediately. What do you think about this?

Best regards,
Vladimir.

@mgalgs
Copy link
Contributor

mgalgs commented May 14, 2013

I would like to see this feature as well but would rather see it implemented in elisp. It's better not to depend on an external script (even if that script is bundled with the git source (not everyone has the git source around, for example)). It's only 173 lines of perl, should be a fairly straightforward port :).

@tarsius
Copy link
Member

tarsius commented May 26, 2013

A before/after screenshot could help motivating me to look into this.

@ghost ghost assigned tarsius May 26, 2013
@vonavi
Copy link
Contributor Author

vonavi commented May 26, 2013

I updated magit-diff-highlight.el, and now a Magit diff looks like this screenshot.

Best regards,
Vladimir.

@tarsius
Copy link
Member

tarsius commented Jul 6, 2013

That looks interesting I will try to have a closer look soon.

@tarsius
Copy link
Member

tarsius commented Jul 8, 2013

Actually magit already supports something like this. Try customizing magit-diff-refine-hunk.

@mgalgs
Copy link
Contributor

mgalgs commented Jul 9, 2013

magit-diff-refine-hunk (or magit-toggle-diff-refine-hunk, bound to h) works for me! That's so awesome...

@vonavi
Copy link
Contributor Author

vonavi commented Jul 12, 2013

Thanks a lot @tarsius! magit-toggle-diff-refine-hunk looks excellent! Unfortunately, there is no documentation about this feature.

@vonavi vonavi closed this as completed Jul 12, 2013
@tarsius tarsius added this to the 2.1.0 milestone Feb 17, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

3 participants