# git log -S problem

4 messages from 2007-05-20 to 2007-05-21. Participants: Johannes Sixt, Junio C Hamano.
Thread: https://gitlist.dev/t/8252

## Johannes Sixt, 2007-05-20 19:15

Subject: git log -S problem
Message-ID: <200705202115.39325.johannes.sixt@telecom.at>
URL: https://gitlist.dev/e/200705202115.39325.johannes.sixt%40telecom.at

```
There is something odd with -S of git log. Try this in your git.git:

$ git log --pretty=oneline -Sbuiltin-merge-base -- Makefile 
71dfbf224ff980f4085f75868dc409118418731e Make merge-base a built-in.

$ git log --pretty=oneline -Smerge-base -- Makefile
e468305a954d95a26bfcdec3bc6e4bd477d95676 [PATCH] Remove the explicit ...
a3df180138b85a603656582bde6df757095618cf Rename git core commands ...
cef661fc799a3a13ffdea4a3f69f1acd295de53d Add support for alternate ...
e590d694ead8d50c2afc7086161d4ddc5d907655 Add more header dependencies.
6683463ed6b2da9eed309c305806f9393d1ae728 Do a very simple "merge-base"...

$ git version
git version 1.5.2

I had expected that the set of commits found by the second search string are a 
proper superset of those found by the first one. What's wrong here? Why does 
a search for 'merge-base' not find occurences of 'builtin-merge-base'?

-- Hannes

```

## Junio C Hamano, 2007-05-20 21:05

Subject: Re: git log -S problem
Message-ID: <7vy7jjjjdm.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vy7jjjjdm.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <200705202115.39325.johannes.sixt@telecom.at>

```
Johannes Sixt <johannes.sixt@telecom.at> writes:

> There is something odd with -S of git log. Try this in your git.git:
>
> $ git log --pretty=oneline -Sbuiltin-merge-base -- Makefile 
> 71dfbf224ff980f4085f75868dc409118418731e Make merge-base a built-in.
>
> $ git log --pretty=oneline -Smerge-base -- Makefile
> e468305a954d95a26bfcdec3bc6e4bd477d95676 [PATCH] Remove the explicit ...
> a3df180138b85a603656582bde6df757095618cf Rename git core commands ...
> cef661fc799a3a13ffdea4a3f69f1acd295de53d Add support for alternate ...
> e590d694ead8d50c2afc7086161d4ddc5d907655 Add more header dependencies.
> 6683463ed6b2da9eed309c305806f9393d1ae728 Do a very simple "merge-base"...
>
> $ git version
> git version 1.5.2
>
> I had expected that the set of commits found by the second search string are a 
> proper superset of those found by the first one. What's wrong here? Why does 
> a search for 'merge-base' not find occurences of 'builtin-merge-base'?

71dfbf224 removes one line that has "git-merge-base$X" and adds
one line that has "builtin-merge-base.o".  If you count the
number of occurences of substring "builtin-merge-base" in the
preimage and the postimage, you see one addition.  If you count
the same for substring "merge-base", the net difference is 0.

```

## Johannes Sixt, 2007-05-21 05:27

Subject: Re: git log -S problem
Message-ID: <200705210727.23898.johannes.sixt@telecom.at>
URL: https://gitlist.dev/e/200705210727.23898.johannes.sixt%40telecom.at
In-Reply-To: <7vy7jjjjdm.fsf@assigned-by-dhcp.cox.net>

```
On Sunday 20 May 2007 23:05, Junio C Hamano wrote:
> Johannes Sixt <johannes.sixt@telecom.at> writes:
> > I had expected that the set of commits found by the second search string
> > are a proper superset of those found by the first one. What's wrong here?
> > Why does a search for 'merge-base' not find occurences of
> > 'builtin-merge-base'?
>
> 71dfbf224 removes one line that has "git-merge-base$X" and adds
> one line that has "builtin-merge-base.o".  If you count the
> number of occurences of substring "builtin-merge-base" in the
> preimage and the postimage, you see one addition.  If you count
> the same for substring "merge-base", the net difference is 0.

But is this how -S is *designed* to work? 

Hm, the documentation says (diff-options.txt):

-S<string>::
	Look for differences that contain the change in <string>.

which can be interpreted both to match my expectations as well as the current 
implementation.

-- Hannes

```

## Junio C Hamano, 2007-05-21 07:34

Subject: Re: git log -S problem
Message-ID: <7vmyzyfx4d.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vmyzyfx4d.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <200705210727.23898.johannes.sixt@telecom.at>

```
Johannes Sixt <johannes.sixt@telecom.at> writes:

> On Sunday 20 May 2007 23:05, Junio C Hamano wrote:
>> Johannes Sixt <johannes.sixt@telecom.at> writes:
>> > I had expected that the set of commits found by the second search string
>> > are a proper superset of those found by the first one. What's wrong here?
>> > Why does a search for 'merge-base' not find occurences of
>> > 'builtin-merge-base'?
>>
>> 71dfbf224 removes one line that has "git-merge-base$X" and adds
>> one line that has "builtin-merge-base.o".  If you count the
>> number of occurences of substring "builtin-merge-base" in the
>> preimage and the postimage, you see one addition.  If you count
>> the same for substring "merge-base", the net difference is 0.
>
> But is this how -S is *designed* to work? 

http://thread.gmane.org/gmane.comp.version-control.git/14869/focus=14871

For the design background, 

http://thread.gmane.org/gmane.comp.version-control.git/6214

```
