Subject: Re: git log missing last line of output

From: "Neal Kreitzinger" <[email-masked]>
Date: Wed, 27 May 2009 12:17:09 -0500

Here is a 'copy and paste' of a testcase scenario that I recreated/executed 
in response to your reply (with comments added):

***CREATE NEW PROJECT SOURCE***
$ mkdir tstcase1
$ cd tstcase1
$ vi file1
$ cat file1
test1
***MAKE IT A GIT REPO***
$ git config --global user.name 'tstuser1'
$ git config --global user.name [email-masked]'
$ git config --list
user.name=tstuser1
user.email=[email-masked]
$ git init
Initialized empty Git repository in .git/
$ git add .
$ git status
# On branch master
#
# Initial commit
#
# Changes to be committed:
#   (use "git rm --cached <file>..." to unstage)
#
#       new file: file1
#
***INITIAL COMMIT***
$ git commit

initial commit
# Please enter the commit message for your changes.
# (Comment lines starting with '#' will not be included)
# On branch master
#
# Initial commit
#
# Changes to be committed:
#   (use "git rm --cached <file>..." to unstage)
#
#       new file: file1
#
~
~
~
~
~
~
~
~
~
~
~
".git/COMMIT_EDITMSG" 12L, 262C written
Created initial commit bee2e0f: initial commit
 1 files changed, 1 insertions(+), 0 deletions(-)
 create mode 100644 file1
***FIRST MODIFICATION TO REPO***
$ vi file1
$ cat file1
test1 mod1
$ git add file1
$ git status
# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#       modified:   file1
#
***FIRST COMMIT AFTER INITIAL COMMIT***
$ git commit

1st commit after initial commit
# Please enter the commit message for your changes.
# (Comment lines starting with '#' will not be included)
# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#       modified:   file1
#
~
~
~
~
~
~
~
~
~
~
~
~
~
~
".git/COMMIT_EDITMSG" 9L, 259C written
Created commit 9f9ed56: 1st commit after initial commit
 1 files changed, 1 insertions(+), 1 deletions(-)
***MODIFY THE REPO AGAIN FOR GOOD MEASURE***
$ vi file1
$ cat file1
test1 mod2
$ git add file1
$ git status
# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#       modified:   file1
#
***SECOND COMMIT AFTER INITIAL COMMIT***
$ git commit

2nd commit after initial commit
# Please enter the commit message for your changes.
# (Comment lines starting with '#' will not be included)
# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#       modified:   file1
#
~
~
~
~
~
~
~
~
~
~
~
~
~
~
".git/COMMIT_EDITMSG" 9L, 259C written
Created commit 7317049: 2nd commit after initial commit
 1 files changed, 1 insertions(+), 1 deletions(-)
$ clear

***EXECUTE GIT LOG***
$ git log

commit 73170498d68a0011b37d7ee095bf88b8dcb6fbb5
Author: tstuser1 <[email-masked]>
Date:   Wed May 27 11:48:30 2009 -0500

    2nd commit after initial commit

commit 9f9ed5663d180caefd0bcaff4578fdb2c542bf17
Author: tstuser1 <[email-masked]>
Date:   Wed May 27 11:14:38 2009 -0500

    1st commit after initial commit

commit bee2e0fa066aaa9fed99c15c2ab58744a34fda48
Author: tstuser1 <[email-masked]>
Date:   Wed May 27 11:13:13 2009 -0500

$
***NOTE THAT LAST LINE OF OUTPUT IS MISSING ABOVE (SHOULD BE THE TITLE LINE 
OF THE INITIAL COMMIT -- BUT ITS NOT THERE)***
$ clear
***GIT LOG LAST TWO COMMITS***
$ git log -2

commit 73170498d68a0011b37d7ee095bf88b8dcb6fbb5
Author: tstuser1 <[email-masked]>
Date:   Wed May 27 11:48:30 2009 -0500

    2nd commit after initial commit

commit 9f9ed5663d180caefd0bcaff4578fdb2c542bf17
Author: tstuser1 <[email-masked]>
Date:   Wed May 27 11:14:38 2009 -0500

$
***NOTE THAT THE LAST LINE OF OUTPUT IS MISSING (SHOULD BE THE TITLE LINE OF 
THE 1ST COMMIT AFTER INITIAL COMMIT -- BUT ITS NOT THERE)***
$ clear
***GIT LOG LAST COMMIT***
$ git log -1

commit 73170498d68a0011b37d7ee095bf88b8dcb6fbb5
Author: tstuser1 <[email-masked]>
Date:   Wed May 27 11:48:30 2009 -0500

$
***NOTE THAT LAST LINE OF OUTPUT IS MISSING (SHOULD BE THE TITLE LINE OF THE 
LAST COMMIT -- BUT ITS NOT THERE)***

Is this the kind of testcase that you are looking for?

v/r,
Neal

"Michael J Gruber" <[email-masked]> wrote in message 
news:[email-masked]...
> Neal Kreitzinger venit, vidit, dixit 27.05.2009 00:57:
>> Git log is not displaying the last line of output (for a plain "$ git 
>> log"
>> the last line of output should be the title line of the initial commit).
>
> It should be the last line of the commit message, which is the "title
> line" (subject) if and only if the message consists of the subject line
> only.
>
>> (I'm using git 1.5.5.6 on rhel 5.3.)  This missing last line also occurs
>> with "git log --since" in which the last line of output should be the 
>> title
>> line of the first commit after the specified date, but it is missing in 
>> this
>> scenario also.  I've searched the release notes for 1.5.6 thru 1.6.3.1 
>> and
>> did not find this mentioned.  Does this also happen in newer versions of 
>> git
>> after 1.5.5.6?
>
> I can't reproduce this with git 1.5.5.6 (vanilla, not rhel). Do you have
> a minimal reproducible test case?
>
> Michael