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

Re: [ANNOUNCE] Git 1.7.10-rc0

From
Jeff King <peff@peff.net>
Date
Mar 8, 2012, 06:53 UTC
Message-ID
<20120308065306.GA8799@sigill.intra.peff.net>
In-Reply-To
<7vk42vfv3c.fsf@alter.siamese.dyndns.org>
On Wed, Mar 07, 2012 at 10:46:47PM -0800, Junio C Hamano wrote:
Show 9 quoted lines
> >   * "git log -G" and "git log -S" learned to pay attention to the "-i"
> >     option. When "-i" is given, their patterns will match
> >     case-insensitively.
> 
> I was torn about this item, and indeed my earlier draft read like
> yours but I removed "-S" as it felt it was more confusing than it
> was worth.  The thing is that -S does not take any pattern --- it is
> meant to be given a (typically a multi-line) block of text to find
> where the exact block cease to exist in the file.

Yeah, though I think many people do treat it as a fixed-string pattern (I typically use "git log -Sfoo" to search for "foo", though perhaps that is because I trained my fingers long before "-G" existed. "-S" is also a lot faster).

My initial reaction to your statement was "well, if we can't justify it in the release notes, then perhaps it is wrong for -S to be respecting -i". But I don't think that is right. The code is doing the right thing, and it is merely that "-S" is a little-used and often-misunderstood tool, and you would naturally want to avoid mentioning it to avoid complicating the notes and confusing the reader.

Show 6 quoted lines
>  * "git log -G" and "git log -S" learned to pay attention to the "-i"
>    option.  With "-i", "log -G" finds patch hunks that introduce or
>    remove a string that matches the given pattern ignoring the case.
>    Similarly with "-i", "log -S" finds where the given block of text
>    appears or disappears from the file, but this comparison is done
>    case-insensitively.
I think that's much better.

Though as a minor nit, the thing I had trouble parsing originally was "...that matches the given pattern ignoring the case". I think "...ignores the case when finding patch hunks that introduce..." is a little easier to read.

-Peff
Previous: Junio C HamanoNext: Junio C Hamano
Message 5 of 22 in “[ANNOUNCE] Git 1.7.10-rc0”
  1. Junio C HamanoMar 8, 2012
  2. Jeff KingMar 8, 2012
  3. Junio C HamanoMar 8, 2012
  4. Junio C HamanoMar 8, 2012
  5. Jeff KingMar 8, 2012
  6. Junio C HamanoMar 8, 2012
  7. 1/2 perf: load test-lib-functions from the correct directoryThomas Rast, Mar 8, 2012
  8. 2/2 perf: export some important test-lib variablesThomas Rast, Mar 8, 2012
  9. Ramkumar RamachandraSep 17, 2012
  10. Thomas RastMar 8, 2012
  11. Nguyen Thai Ngoc DuyMar 8, 2012
  12. Junio C HamanoMar 8, 2012
  13. Jakub NarebskiMar 8, 2012
  14. Junio C HamanoMar 8, 2012
  15. Jakub NarebskiMar 8, 2012
  16. Junio C HamanoMar 8, 2012
  17. Tim HeniganMar 8, 2012
  18. Junio C HamanoMar 8, 2012
  19. RelNotes: noted the addition of contrib/diffallTim Henigan, Mar 9, 2012
  20. Junio C HamanoMar 9, 2012
  21. Tim HeniganMar 9, 2012
  22. Marc BranchaudMar 8, 2012

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.