2

4 Weeks ago, i typed "git log" in my project. and the result is :

commit 587b621b90ca3ba2332d252c04d3957028cbc6bc Author: Agus Priyono <[email protected]> Date: Fri Sep 28 07:56:44 2018 +0700 fixing middleware of status app/Http/Kernel.php | 3 ++- app/Http/Middleware/InvoiceMiddleware.php | 3 --- app/Http/Middleware/MatchingMiddleware.php | 3 ++- app/Http/Middleware/SeeProfileMiddleware.php | 24 ++++++++++++++++++++++++ resources/views/admin/set-matching.blade.php | 1 - routes/user.php | 18 +++++++++--------- 6 files changed, 37 insertions(+), 15 deletions(-) commit f997564af36a8bf700c37b298b54e6e07dd491a4 Author: Agus Priyono <[email protected]> Date: Fri Sep 28 07:29:01 2018 +0700 fixing update status app/Http/Controllers/Admin/CheckStatusController.php | 3 ++- resources/views/admin/set-matching.blade.php | 14 +++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) 

but now, when i type "git log", the result don't have line of code (insertions and deletions ) like this :

commit 80c0b0c4c4100649cd5dec6df16206f63fc27f7e Author: Dwi Yulianto <[email protected]> Date: Fri Nov 2 10:55:11 2018 +0700 update again commit f39df6add36d91373ba13b29039a5d576d7554d8 Author: Dwi Yulianto <[email protected]> Date: Fri Nov 2 10:31:11 2018 +0700 update tody commit 4bd1372236982c0e0db8921c8d96dae2dd3ef677 Author: Dwi Yulianto <[email protected]> Date: Wed Oct 31 16:10:16 2018 +0700 add blank 

how I can get the line of code for each commit? thank you.

1
  • I think you deleted, renamed, or changed your .gitconfig file, because Git does not change its output format by itself. Check your ~/.gitconfig file. Commented Apr 9, 2019 at 5:47

2 Answers 2

1

Try first:

git log --compact-summary 

That should give you back the type of log format you were seeing.

git log --compact-summary:

Output a condensed summary of extended header information such as file creations or deletions ("new" or "gone", optionally "+l" if it’s a symlink) and mode changes ("+x" or "-x" for adding or removing executable bit respectively) in diffstat.
The information is put between the filename part and the graph part.
Implies --stat.

Note that it is fairly recent: Git 2.17+ (Q2 2018).
So check your Git version.

As commented, git log --stat is similar (and older)

Sign up to request clarification or add additional context in comments.

3 Comments

git log --stat may get you similar result.
@josephting Yes, yhat is why I mention "implies --stat"
Great, Thank you @VonC for your help :)
0

Try git diff. Much cleaner and elegant way of getting the same information:

HarshMacBookPro:TitanAdserver harshprateek$ git diff diff --git a/app.py b/app.py index 2a93c2f..742ba79 100755 --- a/app.py +++ b/app.py @@ -52,6 +52,8 @@ class User(db.Model): username = db.Column(db.String(32), index=True) password_hash = db.Column(db.String(64)) role = db.Column(db.String(32)) + address = db.Column(db.String(128)) + country = db.Column(db.String(128)) def hash_password(self, password): self.password_hash = pwd_context.encrypt(password) @@ -119,6 +121,11 @@ def addFeed(): status = routes.addFeedToDB(request) return status [email protected]('/api/v1/createPublisherFeed') +def createPublisherFeed(): + status = routes.createPublisherFeed(request) + return status + @app.route('/api/v1/users/<int:id>') def get_user(id): user = User.query.get(id) @@ -304,7 +311,7 @@ def addPublisher(): @app.route('/viewPublishers') #@login_required def viewPublishers(): - json_feeds = mongo_db.feeds.find() + json_feeds = mongo_db.publisher_details.find() return render_template('viewpublishers.html',feeds=json_feeds) 

3 Comments

Welcome to StackOverflow! Please try to answer the question instead: diff does not show the number of modified lines, but the changes themselves.
'how I can get the line of code for each commit? thank you.' Isn't he looking for lines instead of number of lines???
Look at the command outputs in the question before/after the "bug".

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.