Git 2.17 Clarifies Moved Code
Git 2.17 Clarifies Moved Code
Written by Kay Ewbank   
Monday, 09 April 2018

Git 2.17 has been released with support for coloring moved code, and new hooks to speed up status.

Git is the most popular version control system. Originally developed as a bunch of scripts to maintain the development of the linux kernel, it is fast, compresses well and has a lot of tools and resources that work with and around it.

The improvements to moving code overcome the problem where you're looking at a commit that moved some code. Traditionally, this shows as the lines that were moved being deleted in the original location, and inserted at the new location. This will appear as being simple code movement. The new option gives you a clearer view of what happened and whether any lines needed to be changed.The --color-moved option colors groups of moved lines differently. The colors used are user definable, but you can have one color for lines that were moved without being changed, and another color for lines that were moved and changed. By default, old and new blocks get their own colors, and non-adjacent groups of lines are colored independently.

 

gitcolormoved

 

The second improvement reduces the time taken to check the status of files. Git status uses the system stats to see whether each file’s size or timestamp has changed since the last time Git checked. If not, it assumes that its contents haven’t changed. However, while this is faster than reading all the files, it still means git has to call stat() once for every file in your working copy, which can take time if you have a lot of files. Git now has a new fsmonitor hook that relies on the operating system to say what has changed. The hook provides a generic interface into which you can plug any tool, but given the popularity of the watchman tool, Git ships with a sample hook for using watchman.

Another improvement is the addition of a find object command. This provides a way to work out where an object appeared in the history in terms of commits and paths, letting you select the commits you want and display them however you like.

The final improvement of note is a change to the way grep works function context. This change improves the way grep works so that when you use grep with the --function-context option, which shows the whole function surrounding a match, it also shows any comments before the start of a function.

gitlogo
 

 

More Information

Git On GitHub

Related Articles

GitHub Introduces Embedded Code Snippets

Git 2.5 Released 

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on, Twitter, FacebookGoogle+ or Linkedin.

Banner


Would You Prefer A Robot?
08/04/2018

A recent survey in the UK revealed that 1 in 4 people would prefer to have a robot as their political representative, although only 11% and 14% wanted AI assistance for medical and legal assistance re [ ... ]



ONVIF Challenge Now Underway
03/04/2018

The ONVIF Open Source Spotlight challenge has a $20,000 prize pool for innovative desktop or mobile apps that connect to IP security cameras and help resolve security issues. Qualifying apps will be r [ ... ]


More News

 
 



Comments




or email your comment to: comments@i-programmer.info

Last Updated ( Monday, 09 April 2018 )
 
 

   
Banner
RSS feed of news items only
I Programmer News
Copyright © 2018 i-programmer.info. All Rights Reserved.
Joomla! is Free Software released under the GNU/GPL License.