"Linux/ubuntu Learning 11" Git view a file's modification history

Source: Internet
Author: User

Sometimes when compared to the code, see some changes, but not clear the author and reason for the change, do not know the corresponding bug number, that is, there is no way to find out the specific reasons for these changes ~

"Note": A file changes are limited, and each time the code changes submitted will have a commit description, we can start from here;

One, switch to the directory

First switch to the directory where you want to view the files:

CD packages/apps/mms/src/com/android/mms/ui/


Second, git log--pretty

Then use the following command to list all the changes to the file history, note that the focus here on a specific file, not the Git library, if it is a library, the changes can be more ~

git log--pretty=oneline file name

Such as:

[Email protected]:android_src/packages/apps/mms/src/com/android/mms/ui#git log--pretty=oneline messageitem.java 
27209385caf678abe878375a470f4edd67a2d806 fix to process force close when empty address containedIn card
0E04B16F1DAD7DC0A36E2235F7337BC656C365C7 DisplayFor1970-1-1
e4abf3a213197491e0855e101117b59b5dc0160d href#13954 receive, store, and display WAP push
356f6def9d3fb7f3b9032ff5aa4b9110d4cca87e Href#16265_uim_show_time_error
350F9D34C35AB50BDB4B2D43FB3FF9780E6C73FA fix xxxx
715e32f97bd9d8ce4b5ba650b97ba4b137150456 Fix ANRFrom calling contact.Get ()
fd8357ff5febab0141e1beb8dd3b26f70416b108 Fix missing from field
D130E2E6DC448FD80ECB70F0D31E3AFFB9888B9A Fix Bug2112925:don‘T display zip file garbage content in MMS.
0E19F738C114F86D0D88825EE48966015FB48B6D Don‘T always show sent timestamp
52f854cbb75e8f9975c7e33216b828eb2f981095 Don‘T show Anonymous as the MMS sender
331864544ec51ba6807fc5471cc6d537b7fef198 Add search capability
33a87f96f8c625aa10131a77a3968c97c4ec5a62 Remove all references to Contactinfocache except thoseIn the contact.
70c73e05a792832aa28da751cdaf3fa83a7b8113 Begin Moving all conversation data behind a data model with a cache.
48DA875F1BEEA835C6771977E5BD8A9AA3D4BC10 Begin adding UI unit tests to the Mms app.
66dde9460badebf8e740275cabde9cca256006eb Stop requiring a Context to be passedIn to Contactinfocache.
591D17E9A51BB9F829D6860DC7AA0BAD25062CD5 Auto ImportFrom//Branches/cupcake_rel/[email protected]
72735c62aba8fd2a9420a0f9f83d22543e3c164f Auto ImportFrom//depot/cupcake/@135843
892F2C5BF965B1431AE107B602444A93F4AAD4A3 Auto ImportFrom//depot/cupcake/@135843
153ae99e0a7d626a24d61475eeb133249deb448c Auto ImportFrom//depot/cupcake/@132589
ABD7B2D90F7491075F1DABA4B4CCCDFC82F8DDD1 Auto Importfrom //depot/cupcake/ @137055
59d72c57ce9c319b6cd43ce2ab36b7076c9e821f Auto import from //branches/cupcake/[email protected]< Span style= "color: #008000;" >
44cea74dc55e2459262d0d765ef4a69267dd09b0 Auto import from //branches/cupcake/[email protected]
0f236f55349f070ac94e12cca963847173393da8 Code drop from //branches/cupcake/[email protected]
8eed706474910ccb978acda03e85d3261037da6e Initial contribution

Third, git show


As shown above, the print is all the changes to the file Messageitem.java history, the first long list of each line is the hash value of each commit, and then use git show to display a specific change of the changes ~

356f6def9d3fb7f3b9032ff5aa4b9110d4cca87e

The results are as follows:

[Email protected]:/android_src/packages/apps/mms/src/com/android/mms/ui# git show 356f6def9d3fb7f3b9032ff5aa4b9110d4cca87e
Commit 356f6def9d3fb7f3b9032ff5aa4b9110d4cca87e
Author: A Certain < XXX's mailbox >
Date: £ º+0800

Description of the modification (which is filled in when the code commits)

Signed-off-by: A Certain < XXX's mailbox >

Diff--git A/src/com/android/mms/ui/messageitem.java B/src/com/android/mms/ui/messageitem.java
100644
---A/src/com/android/mms/ui/messageitem.java
+ + B/src/com/android/mms/ui/messageitem.java
+
+ List of specific changes
-
-

So you can know who made the changes, and the specific code to modify ~

Then whether to go directly to his communication or research code, there is a basis for ~

Linux/ubuntu Learn 11 git view a file's modification history

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.