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

4 messages from 2010-02-19 to 2010-02-19. Participants: Eugene Sajine, Thomas Rast.
Thread: https://gitlist.dev/t/22732

## Eugene Sajine, 2010-02-19 21:50

Subject: [BUG] ? - git log :/text results are strange
Message-ID: <76c5b8581002191350h61d6d8c2jd0245c0963fcc85f@mail.gmail.com>
URL: https://gitlist.dev/e/76c5b8581002191350h61d6d8c2jd0245c0963fcc85f%40mail.gmail.com

```
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, 2010-02-19 22:34

Subject: Re: [BUG] ? - git log :/text results are strange
Message-ID: <201002192334.52495.trast@student.ethz.ch>
URL: https://gitlist.dev/e/201002192334.52495.trast%40student.ethz.ch
In-Reply-To: <76c5b8581002191350h61d6d8c2jd0245c0963fcc85f@mail.gmail.com>

```
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, 2010-02-19 23:41

Subject: Re: [BUG] ? - git log :/text results are strange
Message-ID: <76c5b8581002191541x95c3378je6f0528c11aaba4f@mail.gmail.com>
URL: https://gitlist.dev/e/76c5b8581002191541x95c3378je6f0528c11aaba4f%40mail.gmail.com
In-Reply-To: <201002192334.52495.trast@student.ethz.ch>

```
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:
> 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, 2010-02-19 23:45

Subject: Re: [BUG] ? - git log :/text results are strange
Message-ID: <201002200045.59908.trast@student.ethz.ch>
URL: https://gitlist.dev/e/201002200045.59908.trast%40student.ethz.ch
In-Reply-To: <76c5b8581002191541x95c3378je6f0528c11aaba4f@mail.gmail.com>

```
On Saturday 20 February 2010 00:41:32 Eugene Sajine wrote:
> 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

```
