How to quickly locate code modifiers and other submission information in Android and iOS team development

How to quickly locate code modifiers and other submission information in Android and iOS team development

In the process of team collaboration and development, we often need to know who last modified a line of code and why. Of course, we can choose to ask in the team instant messaging group, or check the version submission record of this file in the version control system, but this is usually very time-consuming. No one in the group may respond to your question after a day. If this line of code was modified a long time ago, you may need to check a submission a long time ago. In fact, in the two IDEs, Android Studio and Xcode, a very convenient function of viewing code line submission records is built in by default, of course, we assume that your team code is hosted on Git.

Annotate in Android Studio

Android Studio provides the Annotate function, as shown in the figure below. Right-click the left column of the code editing box and you can see Annotate in the pop-up menu:

Click the Annotate button. A dialog box will pop up when you use it, asking you to enter the username and password of the version control system where this code is located. After entering successfully, the result shown in the figure below will be displayed. You can see who has changed that line of code at a glance, including the date of code submission, commit id and author name. Float the mouse over the corresponding line, and a brief introduction to this submission will also appear:

Click the corresponding line, and a dialog box containing more detailed information about this submission (all files involved in the submission) will pop up:

Xcode’s Show Blame For Line

Xcode's Show Blame For Line function is similar to Android Studio's Annotate function. Similarly, right-click the line of code where you want to view the commit record in the code editor, and Show Blame For Line will appear in the pop-up context menu, as shown below:

After clicking, the relevant information of the most recent commit of this line of code will pop up, including the user name of the committer, the date and time of the commit, the commit id, the files involved in the commit, and the description of the commit, as shown below:

Going a step further, if this basic information is not enough, we have three options:

  • Open in Blame: Displays simple information about the person who last modified all lines of code in this file, as shown below:

  • Open in Comparision: Displays the content comparison between the local file and the most recent commit on Git, as shown below:

  • Open in Log: Displays all historical submission records of this file, as shown below:

The buttons for switching between the three states above are located in the Show the Version editor toolbar in the upper right corner of Xcode:

<<:  Develop cross-platform HTML5 applications based on LeanCloud and Wex5

>>:  Developing mobile 3D games based on Three.js+WebGL

Recommend

Hot on the Internet! What is this plant that can produce "gems"?

Recently, a plant called "Opal Berry" h...

The "Sky Catcher" Builders on the 4,400-meter Plateau

How long does it take to walk 1.3 square kilomete...

How to use IIS to build a website on a VPS server?

For SEO website optimizers, knowing how to build ...

Methods and strategies for generating private domain traffic from 0 to 1!

Based on his own work experience and combined wit...

Understand "International Customs Day" in 80 seconds!

I am Dongdong Miao, International Customs Day is ...

Retention or virus? What should a product focus on in its early stages?

Many companies ask the question “How do we acquir...

Microsoft brings Android Wear apps to Android phones

If you want to know what it's like to use And...