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

[PATCH] doc: clarify how -S works

From
Jeff King <peff@peff.net>
Date
Mar 3, 2009, 15:40 UTC
Message-ID
<20090303154041.GA31265@coredump.intra.peff.net>
In-Reply-To
<20090303152333.GB24593@coredump.intra.peff.net>

The existing text was very vague about what exactly it means for difference to "contain" a change. This seems to cause confusion on the mailing list every month or two.

To fix it we:
  1. use "introduce or remove an instance of" instead of
     "contain"
  2. point the user to gitdiffcore(7), which contains a more
     complete explanation
Signed-off-by: Jeff King <peff@peff.net>
---
I wonder if "gitdiffcore" is a little scary for new people who just want
to use "-S", but hopefully point (1) above will get rid of most of the
confusion, and those who follow the link want to learn all about diff.
 Documentation/diff-options.txt |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt
index 813a7b1..9276fae 100644
--- a/Documentation/diff-options.txt
+++ b/Documentation/diff-options.txt
@@ -176,7 +176,10 @@ override configuration settings.
 	number.
 
 -S<string>::
-	Look for differences that contain the change in <string>.
+	Look for differences that introduce or remove an instance of
+	<string>. Note that this is different than the string simply
+	appearing in diff output; see the 'pickaxe' entry in
+	linkgit:gitdiffcore[7] for more details.
 
 --pickaxe-all::
 	When -S finds a change, show all the changes in that
-- 
1.6.2.rc2.330.gba39e
Previous: Jeff KingNext: John Tapsell
Message 3 of 17 in “git log -Sfoo ignores indentation (whitespace?) changes...”
  1. Peter Valdemar Mørch (Lists)Mar 3, 2009
  2. Jeff KingMar 3, 2009
  3. doc: clarify how -S worksJeff King, Mar 3, 2009
  4. John TapsellMar 3, 2009
  5. Jeff KingMar 3, 2009
  6. John TapsellMar 3, 2009
  7. Junio C HamanoMar 3, 2009
  8. Jeff KingMar 3, 2009
  9. John TapsellMar 3, 2009
  10. Jeff KingMar 3, 2009
  11. Junio C HamanoMar 3, 2009
  12. Peter Valdemar Mørch (Lists)Mar 3, 2009
  13. Jeff KingMar 3, 2009
  14. Junio C HamanoMar 3, 2009
  15. Michael J GruberMar 3, 2009
  16. Jeff KingMar 3, 2009
  17. Junio C HamanoMar 3, 2009

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.