All of lore.kernel.org
 help / color / mirror / Atom feed
From: Neal Kreitzinger <nkreitzinger@gmail.com>
To: Sebastian Schuberth <sschuberth@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: How to find a commit that introduces (not removes) a string?
Date: Thu, 03 Nov 2011 10:56:23 -0500	[thread overview]
Message-ID: <4EB2B9A7.5090909@gmail.com> (raw)
In-Reply-To: <j8to8h$vqd$1@dough.gmane.org>

On 11/3/2011 4:50 AM, Sebastian Schuberth wrote:
> Hi all,
>
> I know about git log's -S / -G, but I'm unable to make these search through *introduced* strings only. Is there a way to do so?
>
> Thanks!
>
> PS: I also read [1], but although the author claims to be interested in introduced strings only, he seems to be satisfied with -G, which slightly puzzles me.
>
> [1] http://stackoverflow.com/questions/5816134/git-finding-a-commit-that-introduced-a-string
>
If you are using linux, here is git diff command I use to find leftover 
debug statements.  I imagine the -S option will work the same in git 
log.  I pipe the results into grep to filter the results to show only 
the additions. (I'm using git 1.7.1)

$ git diff --unified=0 -S"DEBUG" <commit> <commit> -- <path> | grep -e 
"diff --" -e "+" | grep -v -e "@@" -e "+++"

maybe you will find this helpful.

v/r,
neal

  reply	other threads:[~2011-11-03 15:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-03  9:50 How to find a commit that introduces (not removes) a string? Sebastian Schuberth
2011-11-03 15:56 ` Neal Kreitzinger [this message]
2011-11-03 16:13 ` Vijay Lakshminarayanan
2011-11-04 10:59 ` Sebastian Schuberth

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=4EB2B9A7.5090909@gmail.com \
    --to=nkreitzinger@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=sschuberth@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.