Chapter 5. Be a Puppet Master – Learn Fancy Features to Control Git's Functions

Having laid a perfect base by learning, practicing, and validating the concepts covered so far, we are ready to learn some fancy features that will build on our base knowledge to extend the functional usage.

In this chapter you will learn concepts that will help you to perform the following with respect to the content in your repositories:

  • Shortlog
  • Log search
  • Clean
  • Tag

Why learn such fancy features

Why would you need the "S" power in Contra or an M4 rifle in Counter-Strike when you have the default weapons?

Though you will be able to achieve the ultimate goal of killing the opponent even with the basic tools given to you, usage of those specialized tools facilitate the ease of achieving the said goal, that's why.

Similarly these functions that we are about to learn are going to provide us with easy ways of controlling Git to provide data according to the various situations which you can decide where it fits in, based on your job role. And moreover, it's fun to have some ready-made tricks in your pocket to pull out when the need arises, making you the apt person for the job.

Prerequisites

To learn these concepts better, we need to have a repository where there are quite a few commits and multiple people involved in the development of the repository's content. So we shall download any repository from famous Git hosting sites like GitHub or Bitbucket itself.

Here, I have downloaded a project called cappuccino and reduced the repository to fit our purpose.

Tip

Downloading the example code

You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.

You can also download your own from the Git hosting sites specified previously to carry out your learning.

Shortlog

Though information is wealth, sometimes Too Much Information kills the purpose it serves. Think about the value that is associated with the filter option in a spreadsheet application. Shortlog is one such function to command Git to limit the information it shows when viewing logs. It arranges all the users who were involved in building the data of the repository in alphabetical order mentioning the number of commits they made along with their commit descriptions.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.115.195