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.
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 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.
More InformationRelated ArticlesGitHub Introduces Embedded Code Snippets 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, Facebook or Linkedin.
Comments
or email your comment to: comments@i-programmer.info |
|||
Last Updated ( Monday, 09 April 2018 ) |