threads / bug / 22732

[BUG] ? - git log :/text results are strange

Subject: [BUG] ? - git log :/text results are strange

## tl;dr

4 messages between Feb 19, 2010 and Feb 19, 2010.

replies: 3people: 2as markdown or json

Eugene Sajine· Feb 19, 2010, 21:50 UTC · lore
Hi,

When I’m executing $ git log :/fix

I expect to see commits with messages starting from word “fix” only in git.git I’m getting a list of commits where some of messages are starting from this word and some are not

as this:
$ git log :/fix
commit a525d2a41825530c01fd5eac497df0fcd82dca0b
Author: Junio C Hamano <gitster@pobox.com>
Date:   Tue Dec 8 22:16:55 2009 -0800
   fixup! rebase -i --autosquash
commit 66a357d9bac24cc9b8419c256b5e35c327d2997c
Author: Nanako Shiraishi <nanako3@lavabit.com>
Date:   Tue Dec 8 12:13:14 2009 +0900
   rebase -i --autosquash: auto-squash commits
   Teach a new option, --autosquash, to the interactive rebase.
   When the commit log message begins with "!fixup ...", and there
   is a commit whose title begins with the same ..., automatically
   modify the todo list of rebase -i so that the commit marked for
   squashing come right after the commit to be modified, and change
   the action of the moved commit from pick to squash.
   Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
   Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit 0205e72f088322a70a77643a7cd2d8b23ee07e14
Author: Michael Haggerty <mhagger@alum.mit.edu>
Date:   Mon Dec 7 10:20:59 2009 +0100
   Add a command "fixup" to rebase --interactive
   The command is like "squash", except that it discards the commit message
   of the corresponding commit.
   Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
   Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
   Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit 163f3925902446735b2f631dc44ab67882a93024
Author: Michael Haggerty <mhagger@alum.mit.edu>
Date:   Mon Dec 7 05:22:58 2009 +0100
   t3404: Use test_commit to set up test repository
   Also adjust "expected" text to reflect the file contents generated by
   test_commit, which are slightly different than those generated by the
   old code.
   Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
   Signed-off-by: Junio C Hamano gitster@pobox.com
And so on…

This is reproducible problem on Linux env git v 1.6.5.6 and in msysgit 1.6.4.msysgit.0

Thanks, Eugene

Thomas Rast· Feb 19, 2010, 22:34 UTC · re: Eugene Sajine · lore

Re: [BUG] ? - git log :/text results are strange

On Friday 19 February 2010 22:50:39 Eugene Sajine wrote:
> When I’m executing
> $ git log :/fix
> 
> I expect to see commits with messages starting from word “fix” only

You're not putting the puzzle together in the right way. The chain goes roughly like this:

* git-log wants to know what its arguments resolve to
  * (the internal equivalent of) git-rev-parse works out that :/fix is
    a525d2a, as it (apparently) is the youngest commit with a message
    starting with 'fix' (see man git-rev-parse)
* git-log feeds a525d2a to the revision walker
  * the revision walker starts outputting commits backwards through
    history, starting from a525d2a
and unsurprisingly, the log you pasted is just 'git log a525d2a'.
-- 
Thomas Rast
trast@{inf,student}.ethz.ch
Eugene Sajine· Feb 19, 2010, 23:41 UTC · re: Thomas Rast · lore

Re: [BUG] ? - git log :/text results are strange

oh. I see, thanks!
I had to do
$git log --pretty=oneline | grep fix
to get what i wanted...
On Fri, Feb 19, 2010 at 5:34 PM, Thomas Rast <trast@student.ethz.ch> wrote:
Show 26 quoted lines
> On Friday 19 February 2010 22:50:39 Eugene Sajine wrote:
>> When I’m executing
>> $ git log :/fix
>>
>> I expect to see commits with messages starting from word “fix” only
>
> You're not putting the puzzle together in the right way.  The chain
> goes roughly like this:
>
> * git-log wants to know what its arguments resolve to
>
>  * (the internal equivalent of) git-rev-parse works out that :/fix is
>    a525d2a, as it (apparently) is the youngest commit with a message
>    starting with 'fix' (see man git-rev-parse)
>
> * git-log feeds a525d2a to the revision walker
>
>  * the revision walker starts outputting commits backwards through
>    history, starting from a525d2a
>
> and unsurprisingly, the log you pasted is just 'git log a525d2a'.
>
> --
> Thomas Rast
> trast@{inf,student}.ethz.ch
>
Thomas Rast· Feb 19, 2010, 23:45 UTC · re: Eugene Sajine · lore

Re: [BUG] ? - git log :/text results are strange

On Saturday 20 February 2010 00:41:32 Eugene Sajine wrote:
Show 7 quoted lines
> oh. I see, thanks!
> 
> I had to do
> 
> $git log --pretty=oneline | grep fix
> 
> to get what i wanted...
Well, you can also do
  git log --grep=fix --pretty=oneline
Sorry for not mentioning that in my first reply...
-- 
Thomas Rast
trast@{inf,student}.ethz.ch

← back to recent threads