diff options
author | Junio C Hamano <gitster@pobox.com> | 2013-06-11 15:23:52 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-06-11 15:23:52 -0700 |
commit | f1f5a7b64053a592c7655df84079443328582b68 (patch) | |
tree | 9f7d07ba52ea6281993ea65e4805aeb31d2f080b /git-diff.html | |
parent | 8d74cd3acd56a5e53475ddc934fdf2e135a634e8 (diff) | |
download | git-htmldocs-f1f5a7b64053a592c7655df84079443328582b68.tar.gz |
Autogenerated HTML docs for v1.8.3.1-377-g4d1c5
Diffstat (limited to 'git-diff.html')
-rw-r--r-- | git-diff.html | 34 |
1 files changed, 26 insertions, 8 deletions
diff --git a/git-diff.html b/git-diff.html index ff11cbe81..f1f5beab0 100644 --- a/git-diff.html +++ b/git-diff.html @@ -1457,20 +1457,38 @@ of a delete/create pair.</p></div> </dt>
<dd>
<p>
- 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 <em>pickaxe</em> entry in
- <a href="gitdiffcore.html">gitdiffcore(7)</a> for more details.
+ Look for differences that change the number of occurrences of
+ the specified string (i.e. addition/deletion) in a file.
+ Intended for the scripter’s use.
</p>
+<div class="paragraph"><p>It is useful when you’re looking for an exact block of code (like a
+struct), and want to know the history of that block since it first
+came into being: use the feature iteratively to feed the interesting
+block in the preimage back into <code>-S</code>, and keep going until you get the
+very first version of the block.</p></div>
</dd>
<dt class="hdlist1">
-G<regex>
</dt>
<dd>
<p>
- Look for differences whose added or removed line matches
- the given <regex>.
+ Look for differences whose patch text contains added/removed
+ lines that match <regex>.
</p>
+<div class="paragraph"><p>To illustrate the difference between <code>-S<regex> --pickaxe-regex</code> and
+<code>-G<regex></code>, consider a commit with the following diff in the same
+file:</p></div>
+<div class="listingblock">
+<div class="content">
+<pre><code>+ return !regexec(regexp, two->ptr, 1, &regmatch, 0);
+...
+- hit = !regexec(regexp, mf2.ptr, 1, &regmatch, 0);</code></pre>
+</div></div>
+<div class="paragraph"><p>While <code>git log -G"regexec\(regexp"</code> will show this commit, <code>git log
+-S"regexec\(regexp" --pickaxe-regex</code> will not (because the number of
+occurrences of that string did not change).</p></div>
+<div class="paragraph"><p>See the <em>pickaxe</em> entry in <a href="gitdiffcore.html">gitdiffcore(7)</a> for more
+information.</p></div>
</dd>
<dt class="hdlist1">
--pickaxe-all
@@ -1487,8 +1505,8 @@ of a delete/create pair.</p></div> </dt>
<dd>
<p>
- Make the <string> not a plain string but an extended POSIX
- regex to match.
+ Treat the <string> given to <code>-S</code> as an extended POSIX regular
+ expression to match.
</p>
</dd>
<dt class="hdlist1">
|