git-submodule summary: show commit summary
This patch does the hard work to show submodule commit summary.
For a modified submodule, a series of commits will be shown with
the following command:
git log --pretty='format:%m %s' \
--first-parent sha1_src...sha1_dst
where the sha1_src is from the given super project commit and the
sha1_dst is from the index or working tree (switched by --cached).
For a deleted, added, or typechanged (blob<->submodule) submodule,
only one single newest commit from the existing end (for example,
src end for submodule deleted or type changed from submodule to blob)
will be shown.
If the src/dst sha1 for a submodule is missing in the submodule
directory, a warning will be issued except in two cases where the
submodule directory is deleted (type 'D') or typechanged to blob
(one case of type 'T').
In the title line for a submodule, the src/dst sha1 and the number
of commits (--first-parent) between the two commits will be shown.
The following example demonstrates most cases.
Example: commit summary for modified submodules sm1-sm5.
--------------------------------------------
$ git submodule summary
* sm1
354cd45...
3f751e5 (4):
< one line message for C
< one line message for B
> one line message for D
> one line message for E
* sm2
5c8bfb5...000000 (3):
< one line message for F
* sm3
354cd45...
3f751e5:
Warn: sm3 doesn't contain commit
354cd45
* sm4
354cd34(submodule)-> 235efa(blob) (1):
< one line message for G
* sm5
354cd34(blob)-> 235efa(submodule) (5):
> one line message for H
--------------------------------------------
Signed-off-by: Ping Yin <pkufranky@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>