From: Junio C Hamano <gitster@pobox•com>
To: "Peter Valdemar Mørch (Lists)" <4ux6as402@sneakemail•com>
Cc: git@vger•kernel.org
Subject: Re: git log -Sfoo ignores indentation (whitespace?) changes...
Date: Tue, 03 Mar 2009 07:58:56 -0800 [thread overview]
Message-ID: <7vprgyd2db.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <49AD3E78.1050706@sneakemail.com> (Peter Valdemar Mørch's message of "Tue, 03 Mar 2009 15:28:08 +0100")
"Peter Valdemar Mørch (Lists)" <4ux6as402@sneakemail•com> writes:
> Commits where only the indentation of 'foo' is changed are not shown
> with "git log -Sfoo". Is there any way to force showing them along
> with other changes involving foo? (E.g. for python, indentation
> matters!)
No. You should be running "git log -p" which spawns "less" and then type
/foo to jump to the occurrences of "foo".
The pickaxe -Sfoo looks for a filepair that contains different number
of substring "foo". It was designed as a basic building block for a very
different kind of Porcelain, whose final shape would look like the tool
described in http://article.gmane.org/gmane.comp.version-control.git/217,
but not yet written by anybody yet.
And I think it might be the good topic for a SoC project. From some GUI,
you let the user grab a block of text, feed it to "log -S<that multi-line
string> -1" to find where that block of text last changed, and inspect the
commit you have found very carefully using things like "git grep" to find
other places in the commit that could be related to the change of the
block of text, present all of them to the user. From there you let the
user dig deeper in the history by choosing what to look for next, most
likely giving the default selection to the block of text that roughly
corresponds to the original selection.
To make the iteration fast for this use case, the pickaxe cannot afford to
actually run diff and then grep inside the diff output (which is what you
would be doing with "log -p | less" and looking for your string in it).
prev parent reply other threads:[~2009-03-03 16:00 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-03 14:28 git log -Sfoo ignores indentation (whitespace?) changes "Peter Valdemar Mørch (Lists)"
2009-03-03 15:23 ` Jeff King
2009-03-03 15:40 ` [PATCH] doc: clarify how -S works Jeff King
2009-03-03 16:12 ` John Tapsell
2009-03-03 16:19 ` Jeff King
2009-03-03 16:22 ` John Tapsell
2009-03-03 16:42 ` Junio C Hamano
2009-03-03 17:11 ` Jeff King
2009-03-03 17:39 ` John Tapsell
2009-03-03 17:57 ` Jeff King
2009-03-03 18:24 ` Junio C Hamano
2009-03-03 15:48 ` git log -Sfoo ignores indentation (whitespace?) changes "Peter Valdemar Mørch (Lists)"
2009-03-03 16:03 ` Jeff King
2009-03-03 16:21 ` Junio C Hamano
2009-03-03 16:02 ` Michael J Gruber
2009-03-03 16:25 ` Jeff King
2009-03-03 15:58 ` Junio C Hamano [this message]
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=7vprgyd2db.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox$(echo .)com \
--cc=4ux6as402@sneakemail$(echo .)com \
--cc=git@vger$(echo .)kernel.org \
/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