Getting a GIT change summary like GitHub -


i've got group of developers make git commit , merge mistakes (once in while).

i monitor 'large changes' somehow. see in github have following line when looking @ details of specific commit:

showing 759 changed files 21,736 additions , 3,237 deletions.

that example of real merge should have had 1 file changed , several additions/deletions.

is there way or tool exists send out alert via email or sms when commit breaches configured threshold?

if not, wondering if possible generate same type of output using git command line. way, if no tool exists, can script , send out email own tools.


update: 2014-03-20 18:52

based on nulltoken's suggestion, i've tried following command:

git diff --shortstat $(git rev-parse head head^)

and got needed (for last commit anyway). oddly enough though, observed github (1) provides following numbers, compared git provides (2):

1 : 759 changed files 21,736 additions , 3,237 deletions.

2 : 759 files changed, 3237 insertions(+), 21736 deletions(-)

so has bug! either github or git (version 1.7.10.4)... funny!


update: 2014-03-20 19:05

correction, inverted hashes , fixed it... mistake! no bug report.

if possible generate same type of output using git command line. way, if no tool exists, can script , send out email own tools.

you may after 1 of following options of git diff

  • git diff --stat <from_commit> <until_commit>

  • git diff --shortstat <from_commit> <until_commit>


those commands, when ran against libgit2sharp project, output following

$ git diff --stat a4c6c45 14ab41c  libgit2sharp.tests/stashfixture.cs  |  3 ++-  libgit2sharp/core/nativemethods.cs  |  8 +++-----  libgit2sharp/core/proxy.cs          | 18 +++++++++---  libgit2sharp/referencecollection.cs |  5 ++++-  4 files changed, 18 insertions(+), 16 deletions(-)  $ git diff --shortstat a4c6c45 14ab41c  4 files changed, 18 insertions(+), 16 deletions(-) 

you'll note pretty same content github page showcasing changes (note: clicking on "show diff stats" show per file counts).


Comments

Popular posts from this blog

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

php - Magento - Deleted Base url key -

android - How to disable Button if EditText is empty ? -