git log
または git show [commit id]
コマンドで commit history を確認するとき、修正したファイルリストも一緒に確認する方法を紹介します。
1. commit ログと変更されたファイルを一緒に表示する
git log
は次のようにコミット内容を表示します。
$ git log
commit 3fa9158be7952a03bc9731519cc4ca510edf5975
Author: Wonsik Kim <wonsik@google.com>
Date: Thu Dec 17 10:51:17 2020 -0800
MediaCodecInfo: do not alter performance points for 32-bit processes
commit f7dc3f6788d6ca53663d457a545b9de880e3cf02
Author: Nathan Harold <nharold@google.com>
Date: Thu Dec 17 10:04:07 2020 -0800
Fix permission on TM#isDataEnabled
-Allow isDataEnabled() to be read with READ_PHONE_STATE
This method just forwarded to another method in the public
API that only requires READ_PHONE_STATE, so it\'s just a bug.
-Fix a bug where TM#getDataEnabled ws ignoring the subId parameter.
....
1.1 --name-only オプション
commitで変更されたファイルのリストも一緒に表示するには、 --name-only
オプションを使用するだけです。
以下のように commit の description の下に修正されたファイルのリストが出力されます。
$ git log --name-only
commit 3fa9158be7952a03bc9731519cc4ca510edf5975
Author: Wonsik Kim <wonsik@google.com>
Date: Thu Dec 17 10:51:17 2020 -0800
MediaCodecInfo: do not alter performance points for 32-bit processes
media/java/android/media/MediaCodecInfo.java
commit f7dc3f6788d6ca53663d457a545b9de880e3cf02
Author: Nathan Harold <nharold@google.com>
Date: Thu Dec 17 10:04:07 2020 -0800
Fix permission on TM#isDataEnabled
-Allow isDataEnabled() to be read with READ_PHONE_STATE
This method just forwarded to another method in the public
API that only requires READ_PHONE_STATE, so it\'s just a bug.
-Fix a bug where TM#getDataEnabled ws ignoring the subId parameter.
core/api/current.txt
telephony/java/android/telephony/TelephonyManager.java
....
1.2 -pオプション
変更されたファイルのリストと修正の両方を表示したい場合は、 -p
オプションを使用できます。
$ git log -p
commit 3fa9158be7952a03bc9731519cc4ca510edf5975
Author: Wonsik Kim <wonsik@google.com>
Date: Thu Dec 17 10:51:17 2020 -0800
MediaCodecInfo: do not alter performance points for 32-bit processes
Bug: 173488434
Test: atest CtsMediaTestCases:MediaCodecListTest
Change-Id: Ie40557dc0401411cc51650ea42c0fd75f90c67ce
diff --git a/media/java/android/media/MediaCodecInfo.java b/media/java/android/media/MediaCodecInfo.java
index e7e83ebb001..9657b25e7c1 100644
--- a/media/java/android/media/MediaCodecInfo.java
+++ b/media/java/android/media/MediaCodecInfo.java
@@ -1865,10 +1865,6 @@ public final class MediaCodecInfo {
&& aligned.mMaxMacroBlockRate >= otherAligned.mMaxMacroBlockRate);
}
- /* package private */ boolean isEqualDimension(@NonNull PerformancePoint other) {
- return mWidth == other.mWidth && mHeight == other.mHeight;
- }
....
2. 特定のコミットのログと変更されたファイルのリストを確認する
git show [commit id]
は、特定の commit の description と修正されたファイル、修正内容の両方を表示します。
$ git show a2991e1
commit a2991e100165f293d0eb2fbd92fb741d8afe78c6
Author: Todd Kennedy <toddke@google.com>
Date: Thu Dec 17 17:20:04 2020 +0000
Add OWNERS for incremental
diff --git a/core/java/android/os/incremental/OWNERS b/core/java/android/os/incremental/OWNERS
new file mode 100644
index 00000000000..3795493b861
--- /dev/null
+++ b/core/java/android/os/incremental/OWNERS
@@ -0,0 +1,5 @@
+# Bug component: 554432
+alexbuy@google.com
+schfan@google.com
+toddke@google.com
+zyy@google.com
修正されたファイルのリストを見たい場合は、以下のように --name-only
オプションを入力してください。
$ git show a2991e1 --name-only
commit a2991e100165f293d0eb2fbd92fb741d8afe78c6
Author: Todd Kennedy <toddke@google.com>
Date: Thu Dec 17 17:20:04 2020 +0000
Add OWNERS for incremental
core/java/android/os/incremental/OWNERS
Related Posts
- git cloneコマンドでリモートリポジトリをローカルに保存する
- Git - 2つのコミットの違いを確認する(コードの違い、ファイルの違い)
- Git - ブランチ名を変更する方法
- Git - 特定のコミットを削除、元に戻す(reset、revert)
- Git - リモートブランチの作成と削除
- GitHubにssh-keyを登録する方法(Windows10)
- git log - 特定のauthorのcommitリストのみを出力する
- git log - commit リスト簡単に出力 (pretty)
- Git - revert 命令 (commit 元に戻す)
- git diffコマンドでファイルの変更を確認する
- git showコマンドでコミット情報を確認する
- Git - ブランチの作成、削除、チェックアウト
- Git - リモートリポジトリの追加、解除
- Git - Staging領域のファイルをUntrackedに変更する
- Git - commit logで修正されたファイルのリストを見る
- Git - 最後のコミットを修正、削除する方法(reset、amend命令)
- git commit message エディタの変更 (Vim, Sublime, Atom, VSCode)
- Git - blameコマンド、コードを修正した人とCommitを探す
- Git - Patchファイルの作成と適用