In porcelain mode, git diff
advertises submodule changes:
$ cd /opt/staging # This is the main Git repository
$ cd software/zemke-rhyne # This is a submodule
$ git pull
$ git diff
diff --git a/software/zemke-rhyne b/software/zemke-rhyne
index 0fff2fc..cb69287 160000
--- a/software/zemke-rhyne
+++ b/software/zemke-rhyne
@@ -1 +1 @@
-Subproject commit 0fff2fc52bdc2a62a2647110e712b1b3baa48613
+Subproject commit cb69287a3540054ff85cd14199cf36b4b5098c1a
What plumbing commands could give the following information?
- the submodule updated, here software/zemke-rhyne
- the old hash, here 0fff2fc52bdc2a62a2647110e712b1b3baa48613
- the new hash, here cb69287a3540054ff85cd14199cf36b4b5098c1a
The goal is for example to automate a commit message to briefly document the changes in the updated submodule through git rev-list.