Highlights from Git 2.19 and PHP syntax

微信扫一扫,分享到朋友圈

Highlights from Git 2.19 and PHP syntax

GitHub blog covers the highlights from Git 2.19 , which was recently released .

One particular change that I want to highlight (which GitHub skipped in their highlights, but which exists in the Git release notes for this version) is the syntax pattern update for the PHP files.

Let’s have a look at the full diff of this release . The particular change I am referring to is in the userdiff.c file . Git now understands final, abstract, interface, and trait keywords.

If you are not sure where and how it is used, here are a couple of useful links for you:

Now that you have it all configured, there are a couple of ways to benefit from this functionality. First, you’ll see a more useful context comment in the diffs. Here’s the screenshot (using an older git version still). On the left, the diff without the PHP syntax configured, and on the right is the diff with the PHP syntax configured:

As you can see, on the left, the context shows that the change was done somewhere in the ChangeLogTrait trait. On the right, the context is much more specific – it shows that the change was done in the public function changelog.

This makes reviewing code changes a lot easier. But there is also one other place where this is useful – in reviewing the history of a particular function. For example, running “ git log -L :changelog:ChangelogTrait.php ” will produce the git log output containing only the commits and diffs on the function changelog in the file ChangelogTrait.php. Very handy!

微信扫一扫,分享到朋友圈

Highlights from Git 2.19 and PHP syntax

Unity3D研究院GPU Instancing实战(九十七)

上一篇

国庆贺礼 魅族16th系统获Flyme最新版本推送

下一篇

你也可能喜欢

Highlights from Git 2.19 and PHP syntax

长按储存图像,分享给朋友