public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Matthieu Moy <Matthieu.Moy@grenoble-inp•fr>
To: Daniel <mjucde@o2•pl>
Cc: Andreas Ericsson <ae@op5•se>, git@vger•kernel.org
Subject: Re: git log -S not finding all commits?
Date: Thu, 08 Oct 2009 13:40:45 +0200	[thread overview]
Message-ID: <vpqbpkixgea.fsf@bauges.imag.fr> (raw)
In-Reply-To: <362436ca.6b5d0fc3.4acdc7e1.41b23@o2.pl> (Daniel's message of "Thu\, 08 Oct 2009 13\:07\:13 +0200")

Daniel <mjucde@o2•pl> writes:

> Andreas Ericsson <ae@op5•se> wrote:
>
>> 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.
>
> Thanks. However, your suggestion doesn't work. It prints only commit 2. Maybe
> you meant:
>
> $ PAGER=cat git log --pickaxe-regex -S'Free data$' --oneline
>
> but that doesn't solve my problem. I want to find all commits which changed
> lines containing "Free data" (the example I posted is simplified).
>
> Seems I have to use "git log -p" and search its output using pager...

Search the ML's archives, this is a FAQ. People have proposed an
option to allow log -S to actually search the diff (much slower, but
sometimes what you really want), but AFAIK, no one wrote the code. But
I think someone posted a small perl script along the lines of

git log -p --format="%s\n%x00"  | perl -0 -ne 'print if(/whatever-you-search/);'

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

  reply	other threads:[~2009-10-08 11:43 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
2009-10-08 11:07   ` Daniel
2009-10-08 11:40     ` Matthieu Moy [this message]
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=vpqbpkixgea.fsf@bauges.imag.fr \
    --to=matthieu.moy@grenoble-inp$(echo .)fr \
    --cc=ae@op5$(echo .)se \
    --cc=git@vger$(echo .)kernel.org \
    --cc=mjucde@o2$(echo .)pl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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