git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Expected behaviour of 'git log -S' when searching in a merged/deleted file?

From
Jonathan del Strother <jdelstrother@gmail.com>
Date
Dec 23, 2010, 17:27 UTC
Message-ID
<AANLkTinS6i0K4MMdr_E94ig-V3oMFZ+L7N=mqn0S3Y7T@mail.gmail.com>
In-Reply-To
<7vwrn0328p.fsf@alter.siamese.dyndns.org>
On 23 December 2010 16:03, Junio C Hamano <gitster@pobox.com> wrote:
Show 16 quoted lines
> Jonathan del Strother <jdelstrother@gmail.com> writes:
>
>> ....  If 'needle' was added
>> and removed within the duration of a single branch, I could understand
>> "git log -S" never finding 'needle' due to history simplication, but I
>> don't understand how simplification applies here.
>
> Ahh, sorry, I misunderstood the scenario.  Just like you do not see a
> patch output from "log -p", the diff machinery (including -S and its newer
> cousin -G) does not kick in by default for merge commits (this is a bit of
> white lie as "log -p" defaults to "combine diff", i.e. be silent on any
> uninteresting merge that takes its results literally from either parent).
>
> Please try it with "-m" (not "--full-history").  We _might_ want to change
> this behaviour for -S/-G but it needs a bit more thought.
>
Yep, '-m' produces the expected (or at least, *my* expected) results.
Previous: Junio C Hamano
Message 5 of 5 in “Expected behaviour of 'git log -S' when searching in a merged/deleted file?”
  1. Jonathan del StrotherDec 22, 2010
  2. Junio C HamanoDec 22, 2010
  3. Jonathan del StrotherDec 23, 2010
  4. Junio C HamanoDec 23, 2010
  5. Jonathan del StrotherDec 23, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.