From: Andreas Ericsson <ae@op5.se>
To: Daniel <mjucde@o2.pl>
Cc: git@vger.kernel.org
Subject: Re: git log -S not finding all commits?
Date: Thu, 08 Oct 2009 11:12:06 +0200 [thread overview]
Message-ID: <4ACDACE6.9060509@op5.se> (raw)
In-Reply-To: <7ae12651.522df17b.4acda0f5.21a31@o2.pl>
On 10/08/2009 10:21 AM, Daniel wrote:
> Hi,
>
> I did:
>
> $ git version
> git version 1.6.4.4
> $ mkdir a&& cd a&& git init
> $ echo "Free data"> a
> $ git add a
> $ git commit -m1
> $ echo "Free data allocated by other function"> a
> $ git commit -a -m2
> $ PAGER=cat git log -S'Free' --oneline
> 2f34241 1
>
> I would expect "git log" to show both 1 and 2 commit, but it prints only 1.
>
> Is it the correct behavior?
>
Yes, it's the correct behaviour. -S finds only lines where what you search
for was added or deleted. It counts the number of occurrences of what you
specify in each resulting tree and only shows the commits where that number
changed. In your case, searching for "Free data " would have printed both
commits, since you first introduce that entire string and then remove it.
--
Andreas Ericsson andreas.ericsson@op5.se
OP5 AB www.op5.se
Tel: +46 8-230225 Fax: +46 8-230231
Considering the successes of the wars on alcohol, poverty, drugs and
terror, I think we should give some serious thought to declaring war
on peace.
next prev parent reply other threads:[~2009-10-08 9:16 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-08 8:21 git log -S not finding all commits? Daniel
2009-10-08 9:12 ` Andreas Ericsson [this message]
2009-10-08 11:07 ` Daniel
2009-10-08 11:40 ` Matthieu Moy
2009-10-08 11:57 ` Matthieu Moy
2009-10-08 12:49 ` Daniel
2009-10-08 18:23 ` Matthieu Moy
2009-10-08 22:52 ` Randal L. Schwartz
2009-10-09 8:55 ` Matthieu Moy
2009-10-09 12:41 ` Scott Wiersdorf
2009-10-09 14:07 ` Randal L. Schwartz
2009-10-09 14:26 ` Matthieu Moy
2009-10-09 14:28 ` Randal L. Schwartz
2009-10-09 14:33 ` Scott Wiersdorf
2009-10-08 22:02 ` Nanako Shiraishi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4ACDACE6.9060509@op5.se \
--to=ae@op5.se \
--cc=git@vger.kernel.org \
--cc=mjucde@o2.pl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).