Thread (1 message) 1 message, 1 author, 2016-06-15

Re: git log -S doesn't find some commits

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:45:36

Johannes Schindelin [off-list ref] writes:
On Tue, 4 Nov 2008, Bernt Hansen wrote:
quoted
Commits B, C, and D are not included in the git log -S output even
though with gitk you can see that 'org-publish-validate-link' is in the
patch.
It is not sufficient for it to be in the patch, it has to be added or 
deleted in whole.  So for example if you had a line

	org-publish-validate-link Hello

and you changed it to

	org-publish-validate-link World

git log -SWorld will find the commit, but git log 
-Sorg-publish-validate-link will not.
It seems nobody has looked at the actual commits, but Dscho got it 80%
right.

There seems to be a misconception on what -S<foo> does.  It does *NOT*
grep for string <foo> in the patch text.  It counts number of <foo> in
preimage and postimage and decides that the commit is worth showing iff
they differ.

If you look at, for example (B):

    http://repo.or.cz/w/org-mode.git?a=commitdiff;h=837c81ce51

You can see that in org-publish.el, org-publish-validate-link appears once
as removed and once as added, so the total number of the appearance of the
symbol in preimage and postimage are the same.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help