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

Improve git diff output #34

Merged
merged 1 commit into from
Oct 24, 2020
Merged

Conversation

antonkomarev
Copy link
Contributor

This improves the hunk diffing when using git diff.

More details could be found in article: https://tekin.co.uk/2020/10/better-git-diff-output-for-ruby-python-elixir-and-more

@BenMorel
Copy link
Member

Hi, I'm very surprised indeed that Git ships with this feature but does not activate it by default!
Do you have an example diff that I could try to show me how this changes the output for PHP files?

@antonkomarev
Copy link
Contributor Author

Before:
Screenshot from 2020-10-24 21-24-08

After:
Screenshot from 2020-10-24 21-24-44

@antonkomarev
Copy link
Contributor Author

As you can see in the second screenshot, it displays the exact method in which the changes were made.

@BenMorel BenMorel merged commit 87e1e41 into brick:master Oct 24, 2020
@BenMorel
Copy link
Member

Good stuff! Thanks.

@antonkomarev antonkomarev deleted the improve-git-diff-output branch October 24, 2020 19:43
@antonkomarev
Copy link
Contributor Author

antonkomarev commented Oct 24, 2020

@BenMorel here is complete reference from the official git docs: https://www.git-scm.com/docs/gitattributes#_defining_a_custom_hunk_header

@antonkomarev
Copy link
Contributor Author

I've tested css, markdown and html but didn't noticed any difference in output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants