brick / money

A money and currency library for PHP
MIT License
1.65k stars 102 forks source link

Improve git diff output #34

Closed antonkomarev closed 3 years ago

antonkomarev commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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

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

antonkomarev commented 3 years ago

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

BenMorel commented 3 years ago

Good stuff! Thanks.

antonkomarev commented 3 years ago

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

antonkomarev commented 3 years ago

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