[PATCH] display shortlog after git-commit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This might be useful to make people review their log messages
as recorded by git, to make sure they match project guidelines:
among the things most commonly misconfigured are author mail,
and the commit title line.

Signed-off-by: Michael S. Tsirkin <mst@xxxxxxxxxxxxxxxxxx>

---

> I actually find it awkward that author/summary information is never
> shown during git commit - sometimes one does git commit
> on a machine where GIT_AUTHOR_EMAIL has not been setup
> correctly, and the result often is mst@mst-desktop.(none).
> Or people sometimes forget that the first line will show up
> in the pretty=short summary and the result is that what
> ends up being there is just 2 first lines of the long description.
>
> One has to remember to always do git log --pretty=short
> after commit to verify that one did get these details right.
>
> Ideas:
> - Maybe have git-commit display shortlog summary for commit just created?

Hopefully this will make people fix the git config up and amend their commits themselves.
Does this sound like a good idea?
BTW, it's a pity that --no-commit-id breaks --pretty=short.
Maybe use something like --pretty='format:Author: %an <%ae>%n%s' instead?

diff --git a/git-commit.sh b/git-commit.sh
index 292cf96..88e487f 100755
--- a/git-commit.sh
+++ b/git-commit.sh
@@ -650,7 +650,7 @@ then
 	if test -z "$quiet"
 	then
 		echo "Created${initial_commit:+ initial} commit $commit"
-		git-diff-tree --shortstat --summary --root --no-commit-id HEAD --
+		git-diff-tree --shortstat --pretty=short --summary --root HEAD --
 	fi
 fi
 
-- 
MST
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]