Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to get git log without the commit message

I want to get the git log only with the no of additions and deletionswithout the author, date,commit hash and the commit message details, for identifying how many lines of codes have been modified. Currently I am being able to remove all the above except the commit message by using the following bash command

git log origin/master --numstat --since="2 weeks ago"  --no-merges | egrep -v 'Author|Date|commit

The output of the above is as follows

Adding test case for IDENTITY-3591

4 0 modules/integration/tests-common/admin-clients/pom.xml 129 0 modules/integration/tests-common/admin-clients/src/main/java/org/wso2/identity/integration/common/clients/challenge/questions/mgt/ChallengeQuestionMgtAdminClient.java 223 0 modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/challenge/questions/mgt/ChallengeQuestionManagementAdminServiceTestCase.java 2 0 modules/integration/tests-integration/tests-backend/src/test/resources/testng.xml 5 0 pom.xml

Updating SAML metadata version

10 10 modules/p2-profile-gen/pom.xml 2 2 pom.xml

Updating dependency versions

4 4 pom.xml

Changing value of the version tag in carbon.xml to be picked from the project version

1 0 modules/distribution/pom.xml

Fixing carbon.identity.auth.version name

1 1 pom.xml

Downgrading identity.data.publisher.oauth.version to avoid test failures

1 1 pom.xml

Update dependencies to latest versions.

10 8 pom.xml

Adding dependencies for each version property to be used by maven version plugin.

29 28 modules/p2-profile-gen/pom.xml 175 4 pom.xml

How can I get the output without the commit message? Thanks in advance

like image 987
Kasun Siyambalapitiya Avatar asked Nov 28 '16 04:11

Kasun Siyambalapitiya


2 Answers

You can do:

$ git log --stat --format="%H"

You can customize it as you needed. Here

$ git log --pretty=format:"%h $ad- %s [%an]"

Here:
- %ad = author date
- %an = author name
- %h = commit hash (short)
- %H = commit hash (full)
- %s = subject
- %d = ref names
 

Git's pretty docs lists all placeholders.

like image 196
Sajib Khan Avatar answered Oct 12 '22 14:10

Sajib Khan


Try this

git log --numstat --format=
like image 34
bskr Avatar answered Oct 12 '22 15:10

bskr